Pages

Monday, January 23, 2012

Deploying an ASP .Net Application

XCopy Deployment
This is the simplest type of deployment.You simple copy the files from your development server to the production server.

Precompiled Deployment
The entire application is complied and then the compiled assemblies are copied to the production server.

Setup Project
Create a setup for the website and then it is deployed by running the setup at the production server.

Normalizing the database

Normalization refers to removal of redundant information from a database Design
Following are the basic normal Forms

1st Normal Form
When each table row is free of repeated data.So a relation is in first normal form if and only if all underlying domains contain atomic values

2nd Normal Form
Applies to tables that have composite keys i.e. the primary key is made up of 2 or more columns.When a table has a composite key then every column must depend on the whole key instead of a particular column.

A relation must be in 1st NF and every nonkey attribute must be fully dependent on the primary key.

3rd Normal Form
When every column in a table depends on entire primary key and no nonkey columns depend on each other.

2nd NF + nonkey attribute is non transitively dependent on primary key

Boyce-Codd Normal Form
A table is in Boyce–Codd normal form if and only if for every one of its nontrivial dependencies X → Y, X is a superkey—that is, X is either a candidate key or a superset thereof.

4th Normal Form
A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X \twoheadrightarrow Y, X is a superkey—that is, X is either a candidate key or a superset thereof.

5th Normal Form
Every join dependency in R is implied by the candidate keys of R

Saturday, October 29, 2011

Configure Eclipse for Android Dev/Tools not found Error

Just started up with my first development with Android here is the link to how to setup Android ADT Package in Eclipse...
 
http://developer.android.com/sdk/eclipse-adt.html#installing
 
Here is the link for complete guide.
 
http://developer.android.com/sdk/installing.html#Installing
 
And if you are still getting an error like tools not found in android sdk in Eclipse
  
Run Android SDK Manager from start menu 
 
On the top you will see SDK Path

copy that path(you won't be able to copy it practically.I meant just take a note of that path)

run eclipse 
 
it will show an error that tools not found in a given directory

click on window menu select preferences

select Android from the list on left hand side 
 
on the right hand side you will find "SDK Location". Copy that path next to that and Bingo issue resolved 

Tuesday, October 18, 2011

Storage Types in C Sharp

C Sharp has following types to Manage Data 1. Value 2. Reference 3. Pointer 4. Void Value types are used to store data.Two types are Struct and Enumeration Struct types include structures and built in simple types(int,float) Enumeration is a user type defined variables or we can say set of named constants Reference types are used to store references to data elsewhere in your c# program.Reference type keywords include Class,Interface,Delegate,Object,String Pointer types let you point to specific location in memory Use Void type in a method to specify that method does not returns a value...

Difference between Structure a class and its use.

The basic difference between a structure and a class is that a class is a reference type while a structure is not.All the information regarding different properties and functionality of an of an object are contained in the structure it self. Though Classes have an edge over structures as they belong to the Oops family structures are much handy in cases where there are limited range of values for a particular entity For example color of car and its model....etc...Structures are handy where we require less space comparatively Structures can include constructors but these must include parameters Structures cannot inherit another structure but they can implement interfaces.... Classes use Heap method for storage to which further space can be allocated easily while Structures use stacks as a storage medium so their storage is not expandable that is why where memory constraint is a factor structures and Unions are preferred over classes

Tuesday, September 27, 2011

Usage of Obsolete attribute

Recently I came across a fine technique to mark your old code as obsolete in C#. I did some research work and Book called the same as an Insert attribute.Leaving the theory apart the practical was was that interested me the most and here I present an example of the same.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Types
{
class Program
{
enum weekdays {mon=1,tue,wed,thurs,fri,sat,sun}

//Use of obsolete attribute to mark a function a obsolete
[Obsolete("Use newmethod", true)]
static void oldmethod()
{
Console.WriteLine("No");
}

static void newmethod()
{
Console.WriteLine("Yes");
}

public static void Main(string[] args)
{
int x = (int)weekdays.wed;
Console.WriteLine("The wednesday Enum value is {0}",x);
newmethod();
}
}
}

now when I call "oldmethod()" It gives an error with a message specified as in the code...

and on calling "newmethod()" it runs fine

I peeped more into their family and found following attributes also as a part which I will discuss later

AttributeUsage
AttributeTargets
Conditional
Obsolete as discussed in this post...

Boxing and Unboxing in OOPS

Boxing is a process of conversion of a value to generic object type for example

Consider the following code

Int alpha=1;
object boxed_alpha= alpha;

This conversion to generic type is called as boxing

Unboxing is the reverse of a boxing continuing with the above example let us unbox boxed_alpha as a string

String string_alpha=(String) boxed_alpha;

OR

String string_alpha=boxed_alpha.ToString();

I will discuss its use subsequent comments