Tuesday, July 22, 2008

Difference Between normal XML & config(ASP.NET web.config, machine.config) files

  • Both are XML files
  • *.xml Files can be rendered on browser i.e, if u know the path of XML you can access it and see the contents on Browser.
  • *.config file can't be rendered on browser i.e, even if u know the path of XML(*.config) file you can't access it and see the contents on Browser so it is secured.
Thanks to my TL Jeebu.

Tuesday, July 15, 2008

Protecting your Enterprise databases

SQL Server has a SQL Profiler tool, which helps Security Administrators to have a complete view of users who have logged in or out of the server.This information can be used for legal purposes to document activity & for technical purposes to track security policy violations.

For more information please go through the documentation provided with your SQL Server.

Wednesday, June 04, 2008

CSS Hacks: DIV Height Problem and Solution

If you set height in css for a div and check it in IE and Firefox you will get two different heights.

Empty divs in IE have a minimum height, more or less equal to the current line-height.

The way to solve this is:

1) Put a comment inside the div: <div style="height: 10px;"><!-- --></div>
2) Put a inside the div and add this to its style: font-size:1px; line-height:0.

Friday, May 30, 2008

Inflation is 8.1% in India

All are aware of the recent inflation thats happening in India, but one thing i have observed is, whenever prices go high and come down after some days or months the people who increased the prices of the goods carry the same high prices. Government must take action and it should avoid problems happening due to this issue.

What are your opinions?

Friday, May 02, 2008

Sequence Generator Function in SQL

Here is the sequence generator function written in SQL, which when passed starting and end numbers will generate the rest sequence automatically.

CREATE FUNCTION fn_p(    @exp  int)
RETURNS @result TABLE (id int)
AS
BEGIN
DECLARE @pow int
SET @pow = POWER(10, @exp)
INSERT @result SELECT 0 id UNION ALL SELECT 1 * @pow UNION ALL SELECT 2 * @pow UNION ALL SELECT 3 * @pow UNION ALL SELECT 4 * @pow UNION ALL SELECT 5 * @pow UNION ALL SELECT 6 * @pow UNION ALL SELECT 7 * @pow UNION ALL SELECT 8 * @pow UNION ALL SELECT 9 * @pow RETURNENDGO

CREATE FUNCTION fn_sequence
(
@start int,
@end int
)
RETURNS @result TABLE(id int)
AS
BEGIN
IF @start > @end
RETURN
IF @end < 10
INSERT @result SELECT id FROM ( SELECT a0.id id FROM fn_p(0) a0 ) d WHERE id BETWEEN @start AND @end ELSE
IF @end < 100 INSERT @result SELECT id FROM ( SELECT (a1.id + a0.id) id FROM fn_p(1) a1 CROSS JOIN fn_p(0) a0 ) d WHERE id BETWEEN @start AND @end ELSE
IF @end < 1000 INSERT @result SELECT id FROM ( SELECT (a2.id + a1.id + a0.id) id FROM fn_p(2) a2 CROSS JOIN fn_p(1) a1 CROSS JOIN fn_p(0) a0 ) d WHERE id BETWEEN @start AND @end ELSE
IF @end < 10000 INSERT @result SELECT id FROM ( SELECT (a3.id + a2.id + a1.id + a0.id) id FROM fn_p(3) a3 CROSS JOIN fn_p(2) a2 CROSS JOIN fn_p(1) a1 CROSS JOIN fn_p(0) a0 ) d WHERE id BETWEEN @start AND @end
RETURNENDGO

Friday, April 11, 2008

Classic: Algebraic Proof of 1=2

Thursday, March 27, 2008

Tuesday, March 25, 2008

Nanotechnology: The Future

See the below video by Nokia, which shows the future based on Nanotechnology. It's pretty impressive to see such things which are futuristic. I think we are living in wonderful era with so many inventions.


Here goes the explanation given for it on you tube. And Find out more from Nokia .

Morph is a concept demonstrating some of the possibilities nanotechnologies might enable in future communication devices. Morph can sense its environment, is energy harvesting and self cleaning .
Morph is a flexible two-piece device that can adapt its shape to different use modes. Nanotechnology enables to have adaptive materials yet rigid forms on demand.
It is also featured in the MoMA online exhibition "Design and the Elastic Mind". It has been a collaboration project of Nokia Research Center and Cambridge Nanoscience Center.

Recapturing the milestones of Networking and Internet

It's really exciting to see the developments that lead to current situations. The way we communicate and collaborate,do business and every thing else has been revolutionized by the Internet.

Networking has changed our world…
Email, the web, peer-to-peer networks, blogging …
State of the art is changing fast…
Just in the last 10 years
Maturation of web 1.0 (NCSA Mosaic, Netscape, IE, firefox)
Internet searching (Google) and online Ads Market
Deployment / popularization of VoIP
Broadband
Wireless LANs (and NATs)
Peer-to-peer systems and multimedia
From illegal music (Napster/Kazaa) to legal (iTunes) to illegal movies (BitTorrent) and Video Sharing
Cheap web servers
Blogging
Social Networking
Wikis …
And much more is coming…

Monday, March 24, 2008

C# Code for measuring application performance

The DateTime class is not very exact and only can measure in milliseconds. When doing performance measuring on an application you most certainly need to be able to measure with smaller time units than that. High-resolution timers are supported in the Win32 API so following code wraps it up in a simple class:

public class PerformanceTimer
{
[DllImport("Kernel32.dll")]
public static extern void QueryPerformanceCounter(ref long ticks);

long startTime = 0;
long stopTime = 0;

public void Start()
{
QueryPerformanceCounter(ref startTime);
}

public void Stop()
{
QueryPerformanceCounter(ref stopTime);
}

public long Time
{
get
{
return stopTime - startTime;
}
}
}

I’m sure the code is easy to understand. Here is the sample code to show how to use it.

PerformanceTimer perfoTimer = new PerformanceTimer();
perfTimer.Start();

// Do something

perfTimer.Stop();
System.Diagnostics.Trace.WriteLine(perfoTimer.Time);

Number 1 on Google

If you search on my name Kiran Tikare on Google.com, then this blog is displayed as the number one choice.

To see which Google servers you are currently hooked up to, open a command window and enter "nslookup google.com" which should list a couple of IP addresses. McDar.net has a handy Google Watch Tool which does a web search on all known Google servers for you so you don’t manually have to try different IP addresses.

So it took me some time to reach Google fame. I started this blog in March 2006 and was working on SEO. Finally i reached the desired destination with respect to my blog.

Friday, March 21, 2008

Celebrity Morph by MyHeritage

MyHeritage: Celebrity Morph - Free family tree - Lineage

My Celebrity Look Alikes



The website MyHeritage apparently does some face recognition to determine who your celebrity lookalikes are. Mine include Tobey Maguire (Spider Man), Johnny Depp (Pirates Of the Caribbean) , Halle Berry .

Whats Happening?

I think I need to really get a life and find the meaning of it. I don't know what is happening in India (i mean to say Karnataka, i don't know about other states.).Most of the people I know happen to be engineers. Yeah, I mean the BE/B.Tech sort.

I know very few folks doing commerce and related courses. A couple of them doing pure sciences. And very, very few in Arts. And just, just ONE person pursuing fine arts. And anyway, these aren’t people I interact with on a daily basis - just old friends who I get together with once in a while in the name of a reunion.

Around where I live is surrounded by software folks, and those who aren’t Software Engineers or not into IT are into ITES. At home… my parents aren’t engineering graduates.

My interaction with non-engineers is minimal.We try to analyze the ‘railway ticket allotment and booking algorithm’ while waiting in queues. And queues are where we crib about people not optimizing using queuing theory.

And we are also the sort who commit very less to memory, for everything is available on the Net - it is commonplace to have a information like - wikipedia+James Bond film, String+theory+Philosophy. As per my analysis, the amount of information and knowledge is so huge that we know only basic things and we depend on other things on Internet,we can't live without Internet.

It's very disturbing thing that if some terrorist organizations break the very backbone aka.Internet or some company like Google, many things will go down to where they all started, it may put humanity in trouble.

And we are not at all concentrating towards fundamental science, which is essential for technological advancement for humanity.

Can any body tell me what is happening? where are we moving? What is life?

Thursday, March 13, 2008

What AI people are trying to do?

While thinking about AI, i was struck by two questions. Which i feel will decide whether we are going in right direction or not. Here are the questions that we need to answer.

1. Are we trying to produce programs that do the tasks the same way people do?
2. Are we attempting to produce programs that simply do the tasks in whatever way appears easiest?

Based on the answers to above questions we can think whether we are moving in right direction or not.

People are aware of "The Matrix" moview and its views on AI. If we try to produce programs that simply do the task in whatever way appears easiest then, there are chances that once the machines gain the intelligence of doing the tasks which is easier for them they may think that humans are obstacles to achieve the simple tasks and they can start destroying the humans.

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