Daily Tips- Tip #4 - How will you kill a user's session variable explicitly?

Wednesday, July 8, 2009


Session.Abandon()


www.codecollege.NET

Daily Tips- Tip #4 - How will you kill a user's session variable explicitly?


Session.Abandon()


www.codecollege.NET

What base class do all Web Forms inherit from?


System.web.UI.Page class.


www.codecollege.NET

What base class do all Web Forms inherit from?


System.web.UI.Page class.


www.codecollege.NET

Which Authentication methods are based on cookies?


1. Forms
2. Passport


www.codecollege.NET

Which Authentication methods are based on cookies?


1. Forms
2. Passport


www.codecollege.NET

Which Authentication method require Active Directory?

Digest.


www.codecollege.NET

Which Authentication method require Active Directory?

Digest.


www.codecollege.NET

What area the differences between Global.asax and Web.Config?

























Sno
global.asax
web.config
1 Class File Its an XML file
2 There can be only one for an application there can be many if under different sub-folders
3
Can have Application
and Session events

Can't
4
Need
to be recompiled when changes are made
No need to compile
when changes are made.


www.codecollege.NET

What area the differences between Global.asax and Web.Config?

























Sno
global.asax
web.config
1 Class File Its an XML file
2 There can be only one for an application there can be many if under different sub-folders
3
Can have Application
and Session events

Can't
4
Need
to be recompiled when changes are made
No need to compile
when changes are made.


www.codecollege.NET

What are test cases you should go through in unit testing?


You need to check 3 test cases, which are the following,

1. Positive test cases (correct data, correct output)

2. Negative test cases (broken or missing data, proper handling)

3. Exception test cases (exceptions are thrown and caught properly)


www.codecollege.NET

What are test cases you should go through in unit testing?


You need to check 3 test cases, which are the following,

1. Positive test cases (correct data, correct output)

2. Negative test cases (broken or missing data, proper handling)

3. Exception test cases (exceptions are thrown and caught properly)


www.codecollege.NET

What are the different Debugging tools which come with .NET ?


Two debugging tools come with .NET, they are :


1. CorDBG
– command-line debugger


2.  DbgCLR – graphic debugger.


www.codecollege.NET

What are the different Debugging tools which come with .NET ?


Two debugging tools come with .NET, they are :


1. CorDBG
– command-line debugger


2.  DbgCLR – graphic debugger.


www.codecollege.NET

What are the differences between const and readonly ?

























Sno
const
readonly
1 Can't be static. Can be instance level or static
2 evaluated at design time evaluated at run time
3
Initialized at declaration

Initialized at declaration and in constructor
4
must be of integral type or enumeration
In addition it can have complex types with new keyword and
enumerations are not allowed


www.codecollege.NET

What are the differences between const and readonly ?

























Sno
const
readonly
1 Can't be static. Can be instance level or static
2 evaluated at design time evaluated at run time
3
Initialized at declaration

Initialized at declaration and in constructor
4
must be of integral type or enumeration
In addition it can have complex types with new keyword and
enumerations are not allowed


www.codecollege.NET

How can you tell the application to look for assemblies at the locations other than its installed location?

You can do that by adding the following entry in the web.config file,


<probing privatePath="c:\yourlibrary; bin\debug" />
www.codecollege.NET

How can you tell the application to look for assemblies at the locations other than its installed location?

You can do that by adding the following entry in the web.config file,


<probing privatePath="c:\yourlibrary; bin\debug" />
www.codecollege.NET

What’s the difference between authentication and authorization?

what is Authentication?


Is a process by which the system decides whether the user is valid to login to the site as a whole.


what is Authorization?


Is a process by which the system decides which are the areas and functionalities the user is allowed to access, at the component level.
www.codecollege.NET

What’s the difference between authentication and authorization?

what is Authentication?


Is a process by which the system decides whether the user is valid to login to the site as a whole.


what is Authorization?


Is a process by which the system decides which are the areas and functionalities the user is allowed to access, at the component level.
www.codecollege.NET

How to download webpage using asp.net and c# ?

See the following code,

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;

namespace DownloadingFile
{
class Program
{
static void Main(string[] args)
{
WebRequest reqFile = WebRequest.Create("http://www.codecollege.net/2009/07/cloud-computing.html");

WebResponse resFile = reqFile.GetResponse();

Stream smFile = resFile.GetResponseStream();
// Output the downloaded stream to the console
StreamReader sr = new StreamReader(smFile);
string line;
while ((line = sr.ReadLine()) != null)
Console.WriteLine(line);
Console.Read();
}
}
}
www.codecollege.NET

How to download webpage using asp.net and c# ?

See the following code,

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;

namespace DownloadingFile
{
class Program
{
static void Main(string[] args)
{
WebRequest reqFile = WebRequest.Create("http://www.codecollege.net/2009/07/cloud-computing.html");

WebResponse resFile = reqFile.GetResponse();

Stream smFile = resFile.GetResponseStream();
// Output the downloaded stream to the console
StreamReader sr = new StreamReader(smFile);
string line;
while ((line = sr.ReadLine()) != null)
Console.WriteLine(line);
Console.Read();
}
}
}
www.codecollege.NET

Cloud Computing


A good article on cloud computing,

Cloud Computing


www.codecollege.NET

Cloud Computing

CloudComputing


Cloud computing, demystified
Everyone in the IT industry is talking about cloud computing, but there is still confusion about what the cloud is, how it should be used and what problems and challenges it might introduce. This FAQ will answer some of the key questions enterprises are asking about cloud computing.

What is cloud computing?
Gartner defines cloud computing as "a style of computing in which massively scalable IT-related capabilities are provided 'as a service' using Internet technologies to multiple external customers." Beyond the Gartner definition, clouds are marked by self-service interfaces that let customers acquire resources at any time and get rid of them the instant they are no longer needed.

The cloud is not really a technology by itself. Rather, it is an approach to building IT services that harnesses the rapidly increasing horsepower of servers as well as virtualization technologies that combine many servers into large computing pools and divide single servers into multiple virtual machines that can be spun up and powered down at will.

How is cloud computing different from utility, on-demand and grid computing?
Cloud by its nature is "on-demand" and includes attributes previously associated with utility and grid models. Grid computing is the ability to harness large collections of independent compute resources to perform large tasks, and utility is metered consumption of IT services, says Kristof Kloeckner, the cloud computing software chief at IBM. The coming together of these attributes is making the cloud today's most "exciting IT delivery paradigm," he says.

Fundamentally, the phrase cloud computing is interchangeable with utility computing, says Nicholas Carr, author of "The Big Switch" and "Does IT Matter?" The word "cloud" doesn't really communicate what cloud computing is, while the word "utility" at least offers a real-worth analogy, he says. "However you want to deal with the semantics, I think grid computing, utility computing and cloud computing are all part of the same trend," Carr says.

Carr is not alone in thinking cloud is not the best word to describe today's transition to Web-based IT delivery models. For the enterprise, cloud computing might best be viewed as a series of "online business services," says IDC analyst Frank Gens.

What is a public cloud?
Naturally, a public cloud is a service that anyone can tap into with a network connection and a credit card. "Public clouds are shared infrastructures with pay-as-you-go economics," explains Forrester analyst James Staten in an April report. "Public clouds are easily accessible, multitenant virtualized infrastructures that are managed via a self-service portal."

What is a private cloud?
A private cloud attempts to mimic the delivery models of public cloud vendors but does so entirely within the firewall for the benefit of an enterprise's users. A private cloud would be highly virtualized, stringing together mass quantities of IT infrastructure into one or a few easily managed logical resource pools.

Like public clouds, delivery of private cloud services would typically be done through a Web interface with self-service and chargeback attributes. "Private clouds give you many of the benefits of cloud computing, but it's privately owned and managed, the access may be limited to your own enterprise or a section of your value chain," Kloeckner says. "It does drive efficiency, it does force standardization and best practices."

The largest enterprises are interested in private clouds because public clouds are not yet scalable and reliable enough to justify transferring all of their IT resources to cloud vendors, Carr says.

"A lot of this is a scale game," Carr says. "If you're General Electric, you've got an enormous amount of IT scale within your own company. And at this stage the smart thing for you to do is probably to rebuild your own internal IT around a cloud architecture because the public cloud isn't of a scale at this point and of a reliability and everything where GE could say 'we're closing down all our data centers and moving to the cloud.'"

Is cloud computing the same as software-as-a-service?
You might say software-as-a-service kicked off the whole push toward cloud computing by demonstrating that IT services could be easily made available over the Web. While SaaS vendors originally did not use the word cloud to describe their offerings, analysts now consider SaaS to be one of several subsets of the cloud computing market.

What types of services are available via the cloud computing model?
Public cloud services are breaking down into three broad categories: software-as-a-service, infrastructure-as-a-service, and platform-as-a-service. SaaS is well known and consists of software applications delivered over the Web. Infrastructure-as-a-service refers to remotely accessible server and storage capacity, while platform-as-a-service is a compute-and-software platform that lets developers build and deploy Web applications on a hosted infrastructure.

How do vendors charge for these services?
SaaS vendors have long boasted of selling software on a pay-as-you-go, as-needed basis, preventing the kind of lock-in inherent in long-term licensing deals for on-premises software. Cloud infrastructure providers like Amazon are doing the same. For example, Amazon's Elastic Compute Cloud charges for per-hour usage of virtualized server capacity. A small Linux server costs 10 cents an hour, while the largest Windows server costs $1.20 an hour.

Storage clouds are priced similarly. Nirvanix's cloud storage platform has prices starting at 25 cents per gigabyte of storage each month, with additional charges for each upload and download.

What types of applications can run in the cloud?
Technically, you can put any application in the cloud. But that doesn't mean it's a good idea. For example, there's little reason to run a desktop disk defragmentation or systems analysis tool in the cloud, because you want the application sitting on the desktop, dedicated to the system with little to no latency, says Pund-IT analyst Charles King.

More importantly, regulatory and compliance concerns prevent enterprises from putting certain applications in the cloud, particularly those involving sensitive customer data.

IDC surveys show the top uses of the cloud as being IT management, collaboration, personal and business applications, application development and deployment, and server and storage capacity.

Can applications move from one cloud to another?
Yes, but that doesn't mean it will be easy. Services have popped up to move applications from one cloud platform to another (such as from Amazon to GoGrid) and from internal data centers to the cloud. But going forward, cloud vendors will have to adopt standards-based technologies in order to ensure true interoperability, according to several industry groups. The recently released "Open Cloud Manifesto" supports interoperability of data and applications, while the Open Cloud Consortium is promoting open frameworks that will let clouds operated by different entities work seamlessly together. The goal is to move applications from one cloud to another without having to rewrite them

How does traditional software licensing apply in the cloud world?
Vendors and customers alike are struggling with the question of how software licensing policies should be adapted to the cloud. Packaged software vendors require up-front payments, and make customers pay for 100% of the software's capabilities even if they use only 25% or 50%, Gens says. This model does not take advantage of the flexibility of cloud services.

Oracle and IBM have devised equivalency tables that explain how their software is licensed for the Amazon cloud, but most observers seem to agree that software vendors haven't done enough to adapt their licensing to the cloud.

The financial services company ING, which is examining many cloud services, has cited licensing as its biggest concern. "I haven't seen any vendor with flexibility in software licensing to match the flexibility of cloud providers," says ING's Alan Boehme, the company's senior vice president and head of IT strategy and enterprise architecture. "This is a tough one because it's a business model change. … It could take quite some time."

What types of service-level agreements are cloud vendors providing?
Cloud vendors typically guarantee at least 99% uptime, but the ways in which that is calculated and enforced differ significantly. Amazon EC2 promises to make "commercially reasonable efforts" to ensure 99.95% uptime. But uptime is calculated on a yearly basis, so if Amazon falls below that percentage for just a week or a month, there's no penalty or service credit.

GoGrid promises 100% uptime in its SLA. But as any lawyer points out, you have to pay attention to the legalese. GoGrid's SLA includes this difficult-to-interpret phrase: "Individual servers will deliver 100% uptime as monitored within the GoGrid network by GoGrid monitoring systems. Only failures due to known GoGrid problems in the hardware and hypervisor layers delivering individual servers constitute failures and so are not covered by this SLA."

Attorney David Snead, who recently spoke about legal issues in cloud computing at Sys-Con's Cloud Computing Conference & Expo in New York City, says Amazon has significant downtime but makes it difficult for customers to obtain service credits.

"Amazon won't stand behind its product," Snead said. "The reality is, they're not making any guarantees."

How can I make sure my data is safe?
Data safety in the cloud is not a trivial concern. Online storage vendors such as The Linkup and Carbonite have lost data, and were unable to recover it for customers. Secondly, there is the danger that sensitive data could fall into the wrong hands. Before signing up with any cloud vendor, customers should demand information about data security practices, scrutinize SLAs, and make sure they have the ability to encrypt data both in transit and at rest.

How can I make sure that my applications run with the same level of performance if I go with a cloud vendor?
Before choosing a cloud vendor, do your due diligence by examining the SLA to understand what it guarantees and what it doesn't, and scour through any publicly accessible availability data. Amazon, for example, maintains a "Service Health Dashboard" that shows current and historical uptime status of its various services.

There will always be some network latency with a cloud service, possibly making it slower than an application that runs in your local data center. But a new crop of third-party vendors are building services on top of the cloud to make sure applications can scale and perform well, such as RightScale.

By and large, the performance hit related to latency "is pretty negligible these days," RightScale CTO Thorsten von Eicken. The largest enterprises are distributed throughout the country or world, he notes, so many users will experience a latency-caused performance hit whether an application is running in the cloud or in the corporate data center.




Thanks & regards,

KannappaN Venkatachalam
www.codecollege.NET

How to read and write from a text file using c#.net ?

See the following sample,

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace ReadWriteFromTxt
{
class Program
{
static void readFile()
{
FileStream fsEmp = new FileStream("c:\\Emp.html", FileMode.Open, FileAccess.Read);
StreamReader srEmp = new StreamReader(fsEmp);
string s;
while ((s = srEmp.ReadLine()) != null)
{
Console.WriteLine(s);
Console.Read();
}
srEmp.Close();
fsEmp.Close();
}

static void writeFile()
{
FileStream fsEmp = new FileStream("c:\\Emp.html", FileMode.Open, FileAccess.Write );
StreamWriter swEmp = new StreamWriter(fsEmp );

string s="Have you seen god? Is there anything else to see";
swEmp.WriteLine(s);
swEmp.Close();
fsEmp.Close();

}


static void Main(string[] args)
{
writeFile();
readFile();
}
}
}
www.codecollege.NET

How to read and write from a text file using c#.net ?

See the following sample,

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace ReadWriteFromTxt
{
class Program
{
static void readFile()
{
FileStream fsEmp = new FileStream("c:\\Emp.html", FileMode.Open, FileAccess.Read);
StreamReader srEmp = new StreamReader(fsEmp);
string s;
while ((s = srEmp.ReadLine()) != null)
{
Console.WriteLine(s);
Console.Read();
}
srEmp.Close();
fsEmp.Close();
}

static void writeFile()
{
FileStream fsEmp = new FileStream("c:\\Emp.html", FileMode.Open, FileAccess.Write );
StreamWriter swEmp = new StreamWriter(fsEmp );

string s="Have you seen god? Is there anything else to see";
swEmp.WriteLine(s);
swEmp.Close();
fsEmp.Close();

}


static void Main(string[] args)
{
writeFile();
readFile();
}
}
}
www.codecollege.NET

what are the Differences between Abstract Class and Interface ?




























Sno Abstract
Class
Interface
1 Can have implemented Methods Cant
2 A class can inherit only one abstract class A Class can implement any number of Interfaces.
3 We go for Abstract classes on such situations
where we need to give common functionality for group of related classes
We go for Interface on such situations where we
need to give common functionality for group of un-related classes
4 If you add a new method, then you can provide a
default implementation and so no need to make any change to existing work.
If you add a new method, then you need to change
all the existing work.
5
Static and Instance constants are possible.
Only
Static  constants are possible.


www.codecollege.NET

what are the Differences between Abstract Class and Interface ?




























Sno Abstract
Class
Interface
1 Can have implemented Methods Cant
2 A class can inherit only one abstract class A Class can implement any number of Interfaces.
3 We go for Abstract classes on such situations
where we need to give common functionality for group of related classes
We go for Interface on such situations where we
need to give common functionality for group of un-related classes
4 If you add a new method, then you can provide a
default implementation and so no need to make any change to existing work.
If you add a new method, then you need to change
all the existing work.
5
Static and Instance constants are possible.
Only
Static  constants are possible.


www.codecollege.NET

World No 1 kaspersky Antivirus Free for 6 Months


kaspersky-antivirus2010-get-6-months

World No 1 kaspersky Antivirus Free for 6 Months


kaspersky-antivirus2010-get-6-months

Blog Widget by LinkWithin