13 February 2010

Print 1 to N without using Looping Statement and goto in C Language royalarun.blogspot.com

Print 1 to N without using Looping and goto Statement in C Language:


void main()
{
int n;
printf("Enter the limit:");
scanf("%d",&n);
fun(n);
}
int fun(int n)
{
static int i=0;
i++;
(i<=n)?printf("\n%d",i):getch();
fun(n);
return 0;
}

8 February 2010

Why Space Pen is invented? Why Pencil Not used in Space royalarun.blogspot.com

Space Pen
The Space Pen (also known as the Zero Gravity Pen), marketed by Fisher Space Pen Company, is a pen that uses pressurized ink cartridges and is claimed to write in zero gravity, upside down, underwater, over wet and greasy paper, at any angle, and in extreme temperature ranges.

Why Pencil is not used in Space?

There exists a common urban legend claiming that the Americans spent millions of dollars developing the Space Pen, and the Russians used a pencil.In fact, NASA programs have used pencils (for example a 1965 order of mechanical pencils) but because of the danger that a broken-off pencil tip poses in zero gravity and the flammable nature of the wood present in pencils a better solution was needed.

NASA never approached Paul Fisher to develop a pen, nor did Fisher receive any government funding for the pen's development. Fisher invented it independently, and then asked NASA to try it. After the introduction of the AG7 Space Pen, both the American and Soviet (later Russian) space agencies adopted it. Previously both the Russian and American astronauts used grease pencils and plastic slates.


3Idiots

In the 2009 Bollywood movie, 3 Idiots, Aamir Khan (as the rebellious Rancho) momentarily flummoxes the college Dean with the pencil conundrum, which the Dean finally sets right towards the end (by explaining how a broken pencil tip would harm people in space, and clog the instruments). However, the Dean awarded that pen to Rancho (Aamir Khan) in order to acknowledge his presence of mind and also to approve him as an "extraordinary student".

Why Java is not Purely Object Oriented? royalarun.blogspot.com

Object-Orientation

Many languages claim to be Object-Oriented. While the exact definition of the term is highly variable depending upon who you ask, there are several qualities that most will agree an Object-Oriented language should have:

1.Encapsulation/Information Hiding
2.Inheritance
3.Polymorphism/Dynamic Binding
4.All pre-defined types are Objects
5.All operations performed by sending messages to Objects
6.All user-defined types are Objects

For the purposes of this discussion, a language is considered to be a "pure" Object-Oriented languages if it satisfies all of these qualities. A "hybrid" language may support some of these qualities, but not all. In particular, many languages support the first three qualities, but not the final three.

Eiffel, Smalltalk, and Ruby are all pure Object-Oriented languages, supporting all six qualities listed above. Java claims to be a pure Object-Oriented language, but by its inclusion of "basic" types that are not objects, it fails to meet our fourth quality. It fails also to meet quality five by implementing basic arithmetic as built-in operators, rather than messages to objects.

C++ is considered to be a multi-paradigm language, of which one paradigm it supports is Object-Orientation. Thus, C++ is not (nor does it contend to be) a pure Object-Oriented language.

Java, while it does not support pure implementation inheritance, provides two separate inheritance mechanisms. The extends keyword is used for a combination of implementation and subtype inheritance while the implements keyword is used for pure subtype (interface) inheritance.

Implementing OAuth validation in a Web API

 I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...