Thursday, February 21, 2008

Making Sense of Application Paths in ASP.NET

Path names in ASP.NET may be confusing, but the concepts are simple:

Physical paths refer to the server's filesystem (e.g., c:\inetpub\wwwroot\index.aspx).
Virtual paths refer to HTTP paths, the stuff in the browser address bar.

They come in two types: absolute and relative.

Absolute virtual paths are exactly what you see in the browser, starting with the / after the host name (e.g., /kiran/articles).
Relative (or app-relative) virtual paths start with ~/. The ~/ is magic and always represents the root virtual path of your application. So for an IIS application deployed at /India/culture/ ASP.NET transforms ~/ into /India/culture/. If the app is deployed to the IIS root (/), then ~/ simply becomes /.

For more information please refer to
1. ASP.NET Paths

Tuesday, February 05, 2008

The Noah Phase

Couple of hours ago i read the article published in The Newyork Times written by famous Thomas Friedman (Author of The World Is Flat).

He discusses about the current phase of our human race. He mentions that we are the first generation in the whole human history that literally acting like Noah ( Hope many people know stroy of Noah, who as instructed by God, saved the animals from the Great Flood.).

He says that currently we are in Noah Phase.As many of you are aware that because of our activities many species are threatened with extinction. Now it is on entire human race to save the very living specieses of our planet from extinction.Otherwise we will end up on a dead planet without Plants, Trees and Animals, which slowly leads us to our end.

Let us conserve our environment before its too late........

Calculate the sum of a column in a dataset

Problem : Calculate the sum of a column in a dataset

Solution :
After filling the dataset from your query you can calculate the sum of a numeric column.

Dataset's DataTable provides a default method called Compute through which you can perform any aggregate function based operation on columns in a DataTable.

Suppose you have

1. Column : Salary
2. DataSet : dsData
3. DataTable Name : Payroll

Then

dsData.Tables("Payroll").Compute("SUM(Salary)", String.Empty)

Gives the sum of that column.

Compute accepts two arguments : 1. Expression (Any aggregate Expression)
2. Filter (Any Filtering option, here String.Empty means no filter value)

Monday, February 04, 2008

P = NP problem and the Valentine's Day Song

Here is a nice Song i found on the Net, which reminds us about the Famous Unsolved Mathematical Problem P = NP .

its a love story
of two strange people
who never knew they could
fall for each other
when they first met
they only ended up fighting
but slowy it became clear to them
that they sure shared something

a small problem happened
when pride overtook him
he thought she was
less smarter than him
she would solve a puzzle
and he would solve it again
he would tell her
that she was simply
an idea away from him...
he said that he always gets this idea
and then he does all that she can
and probably much more...

one day she decided
his behaviour had to be checked
she thought for a while and
then she said...
fine, then you sure
can do everything
but if you are strictly more smart
you have to do the following
think of some puzzle
that you can easily do
and then give it to me
to solve and lets see if
i can't do....

all the king's men and
all the king's horses
could not come up
with a puzzle like this
the duo got closer and
the world around more curious

today as it stands
the puzzle is still not found
and hence the duo
lives happily close bound
they two are well known
as simply, inseparable
P is the queen and
NP the king of our fable...

Hope you all enjoy it.......
Source : Nutan's Blog