Wednesday, May 19, 2010

A perfect example to understand constructors and destructors

#include
using namespace std;

int c = 0;
int d = 0;

struct X {
    int i;
    X(int j = 0) : i(j) { c++; }
    ~X() { d++; }
};
 
int main(){

cout<
X x1;   
cout<
    {
    X x2;
    cout<
        {
        X x3;
        cout<
        cout<
        }
        cout<
    }
    cout<

return 0;
}

 

Tuesday, May 18, 2010

Goa trip - Day 1

My last trip to Goa as a student should actually pack only two other BITSKK......Gians(leave it! anything can be appended in between) venu and lvk. The shape and shakal of the trip got changed when my colleages at my PS got added as kalavar kings to the pack. All the important changes got pitched only on the eve of the journey, which brought some more smiles on my face. Nver thought I would be part of a trip with one of the seniors members of a company, at such an young age. Always scared of the consequences that may shed gloomy shades of colors on the impression that I had portaied, in them. With fingers crossed and unstable mind and a so called blue print(which consisted of a hand drawn GOA map and list of some pubs) we started our trip.

As usual my journey started of with the waiving hands of my parents, for whom I'm a guy who has all the great qualities of Lord Rama, infact more than what he possess. So, there was always a guilty feeling in my mind, which hunts me forever, infact my lonely companion at all times. Colleages laughed at me for bringing my parents to the bus stop, but they dont know, it's involuntary. First glance at the bus shocked me. It was almost like a SETWIN bus(infact much smaller than that). For the first minute I thought WTF!!IS THIS THE BUS WHICH COSTED ME 960 FOR A JOURNEY OF 12 HRS. But, GOD always has a soft corner on me, here too. We found out that this bus is going to suffocate us only till the out-skirts of the most polluted and amicable city, HYDERABAD.

As soon as we reached Mehdipatnam, we had a glance at the huge MULTI-AXLE VOLVO."Wah!! Kya Gaadi Hai!!" Looking at it I thought the journey is gonna be more fun than all da bus journey's dat I ever did. As soon as we reached ZEDCHERLA, cleaner called us to have dinner, as if it was his hotel. After having two ZaffaNaZaffadas(ZZ), even dal tasted like the glorious "Chicken Pot Pie IX(Dont ask me what dis is)". Then the action started. I closed my eyes, tried to levitate, then to meditate, which finally ended up as a sound sleep for 12 hrs. I never thought Goa is just a eye blink away from Hyderabad.

End Of First Day

GOA trip-Day1

My last trip to Goa as a student should actually pack only two other BITSKK......Gians(leave it! anything can be appended in between) venu and lvk. The shape and shakal of the trip got changed when my colleages at my PS got added as kalavar kings to the pack. All the important changes got pitched only on the eve of the journey, which brought some more smiles on my face. Nver thought I would be part of a trip with one of the seniors members of a company, at such an young age. Always scared of the consequences that may shed gloomy shades of colors on the impression that I had portaied, in them. With fingers crossed and unstable mind and a so called blue print(which consisted of a hand drawn GOA map and list of some pubs) we started our trip.

As usual my journey started of with the waiving hands of my parents, for whom I'm a guy who has all the great qualities of Lord Rama, infact more than what he possess. So, there was always a guilty feeling in my mind, which hunts me forever, infact my lonely companion at all times. Colleages laughed at me for bringing my parents to the bus stop, but they dont know, it's involuntary. First glance at the bus shocked me. It was almost like a SETWIN bus(infact much smaller than that). For the first minute I thought WTF!!IS THIS THE BUS WHICH COSTED ME 960 FOR A JOURNEY OF 12 HRS. But, GOD always has a soft corner on me, here too. We found out that this bus is going to suffocate us only till the out-skirts of the most polluted and amicable city, HYDERABAD.

As soon as we reached Mehdipatnam, we had a glance at the huge MULTI-AXLE VOLVO."Wah!! Kya Gaadi Hai!!" Looking at it I thought the journey is gonna be more fun than all da bus journey's dat I ever did. As soon as we reached ZEDCHERLA, cleaner called us to have dinner, as if it was his hotel. After having two ZaffaNaZaffadas(ZZ), even dal tasted like the glorious "Chicken Pot Pie IX(Dont ask me what dis is)". Then the action started. I closed my eyes, tried to levitate, then to meditate, which finally ended up as a sound sleep for 12 hrs. I never thought Goa is just a eye blink away from Hyderabad.

End Of First Day

Friday, May 7, 2010

Multiple inheritence

This was the question asked to me during an interview. What all languages support multiple inheritence?
The answer is:


The definition of the Title is simple and self explanatory. BTW all this info is from: http://en.wikipedia.org/wiki/Multiple_inheritance.


Languages that support multiple inheritance include: Eiffel, C++, Dylan, Python, Perl, Perl 6, Curl, Common Lisp (via CLOS), OCaml, Tcl (via Incremental Tcl)[1], and Object REXX (via the use of mixin classes).

Diamond problem:

 Multiple inheritance allows a class to take on functionality from multiple other classes, such as allowing a class named StudentMusician to inherit from a class named Person, a class named Musician, and a class named Worker. This can be abbreviated StudentMusician : Person, Musician, Worker.

Ambiguities arise in multiple inheritance, as in the example above, if for instance the class Musician inherited from Person and Worker and the class Worker inherited from Person

C++ requires that the programmer state which parent class the feature to use should come from i.e. "Worker::Person.Age". C++ does not support explicit repeated inheritance since there would be no way to qualify which superclass to use (see criticisms). C++ also allows a single instance of the multiple class to be created via the virtual inheritance mechanism (i.e. "Worker::Person" and "Musician::Person" will reference the same object).


Thursday, May 6, 2010

Arrays

Using an int** for an array of arrays is incorrect and produces wrong answers using pointer arithmetic.

for more details:
http://bytes.com/topic/c/insights/772412-arrays-revealed

Tuesday, April 27, 2010

References

int i;
int& r = i;              // r refers to i
r = 1;                    // the value of i becomes 1
int* p = &r;           // p points to i
int& rr = r;           // rr refers to what r refers to, that is, to i
int (&rg)(int) = g;  // rg refers to the function g
rg(i);                    //calls function g
int a[3];
int (&ra)[3] = a;    // ra refers to the array a
ra[1] = i;              // modifies a[1]

Wild Card characters

A wildcard character is a character that may be substituted for any of a defined subset of all possible characters. In computer (software) technology, a wildcard character can be used to substitute for any other character or characters in a string.
For ex:
*.jpg
matches any text which end with .jpg. You can also specify brackets with characters, as in:

*.[ch]pp
matches any text which ends in .cpp or .hpp. Altogether very similar to regular expressions.
The * means match zero or more of anything in wildcards. As we learned, we do this is regular expression with the punctuation mark and the * quantifier. This gives:

.*
Also remember to convert any punctuation marks from wildcards to be backslashified.
The ? means match any character but do match something. This is exactly what the punctuation mark does.

Friday, April 23, 2010

awesum link(Threads concept for dummies)

http://www.codestyle.org/java/faq-Threads.shtml

awesum link(Threads concept for dummies)

http://www.codestyle.org/java/faq-Threads.shtml

Tuesday, April 20, 2010

basic function definitions

int i - declares an integer
int *pi - declares a pointer pi to an integer
int f() - declares a function f with no input parameters and returns an integer
int *fpi(int) - declares a function fpi taking an integer argument and returning a pointer to an
integer
int (*pif)(const char*, const char*) - a pointer pif to a function taking two pointers to const characters
and returning an integer
int (*fpif(int))(int) - a function fpif taking an integer as an argument and returning a pointer to a
function that takes integer arguments and returns an integer

Tuesday, April 13, 2010

Tuesday, April 6, 2010

  1. Usage of pointers and their fundamentals in C?
    Pointers are mainly used for the dynamic allocation of memory. A pointer contains the address of the variable. They are also helpful in passing parameters to subroutines.
     void* sample;Using the above example’s definition and assigning the pointer to void to the address of an integer variable is perfectly correct.sample=&i; where i is an int.Using the above example to define the pointer to void and assign the pointer to void to the address of a float variable as below is also perfectly correct.sample=&f; where f is a floatPointer to void, or a void pointer, is a special type of pointer that has a great facility of pointing to any data type.NULL pointer is a type of pointer of any data type and generally takes a value as zero. This is, however, not mandatory. This denotes that NULL pointer does not point to any valid memory address. It is important to note that a NULL pointer is different from a pointer that is not initialized.
  2. What is the difference between structures and unions in C?Union allocates the memory equal to the maximum memory required by the member of the union but structure allocates the memory equal to the total memory required by the members.
    Structure enables us treat a number of different variables stored at different in memory.
    Since all of them are referring to the same location in memory the modification of one of the elements will affect the value of all of them. We cannot store different values in them independent from each other.
  3. Basic concepts about data structures like trees, linked lists, circular lists, queues, arrays?The principal benefit of a linked list over a conventional array is that the order of the linked items may be different from the order that the data items are stored in memory or on disk. For that reason, linked lists allow insertion and removal of nodes at any point in the list, with a constant number of operations.

Some interview questions with answers

  1. Usage of pointers and their fundamentals in C?
    Pointers are mainly used for the dynamic allocation of memory. A pointer contains the address of the variable. They are also helpful in passing parameters to subroutines.
     void* sample;
    Using the above example’s definition and assigning the pointer to void to the address of an integer variable is perfectly correct.
    sample=&i; where i is an int.
    Using the above example to define the pointer to void and assign the pointer to void to the address of a float variable as below is also perfectly correct.
    sample=&f; where f is a float
    Pointer to void, or a void pointer, is a special type of pointer that has a great facility of pointing to any data type.NULL pointer is a type of pointer of any data type and generally takes a value as zero. This is, however, not mandatory. This denotes that NULL pointer does not point to any valid memory address. It is important to note that a NULL pointer is different from a pointer that is not initialized.

  2. What is the difference between structures and unions in C?
    Union allocates the memory equal to the maximum memory required by the member of the union but structure allocates the memory equal to the total memory required by the members.
    Structure enables us treat a number of different variables stored at different in memory.
    Since all of them are referring to the same location in memory the modification of one of the elements will affect the value of all of them. We cannot store different values in them independent from each other.
  3. Basic concepts about data structures like trees, linked lists, circular lists, queues, arrays?
    The principal benefit of a linked list over a conventional array is that the order of the linked items may be different from the order that the data items are stored in memory or on disk. For that reason, linked lists allow insertion and removal of nodes at any point in the list, with a constant number of operations.

Monday, March 29, 2010

Diff between transient and volatile variables

Transient variable:
A transient variable is a variable that may not be serialised.

Trying to put a non-serializable variable in a serialisible class,we can use transient modifier ,so that
the jvm skips the transient variable ,and make that class as serializable class

Volatile variable:
The volatile modifier tells the JVM that a thread accessing the variable must always reconcile its own private copy of
the variable with the master copy in memory. It can be apply only to instance variables.
Serialization:

"In computer science, in the context of data storage and transmission, serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file, a memory buffer, or transmitted across a network connection link to be "resurrected" later in the same or another computer environment.[1] When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward." says Wikipedia.

Java provides such a mechanism, called object serialization. A so-called serialized object is an object represented as a sequence of bytes that includes the object’s data as well as information about the object’s type and the types of data stored in the object. After a serialized object has been written into a file, it can be read from the file and deserialized—that is, the type information and bytes that represent the object and its data can be used to recreate the object in memory.

source: http://www.deitel.com/articles/java_tutorials/20050923/IntroductionToObjectSerialization.html

Wednesday, March 24, 2010

Static Keyword in C++

The static keyword specifies that the variable has static duration (it is allocated when the program begins and deallocated when the program ends) and initializes it to 0 unless another value is specified.But, initialize it with 0 if you want to, to avoid confusion
A variable declared static in a function retains its state between calls to that function.
The keyword static can be used in three major contexts: inside a function, inside a class definition, and in front of a global variable inside a file making up a multifile program.

Inside a Function:

The keyword static prevents re-initialization of the variable.
For example:

#include

using namespace std;
void showstat( int curr ) {
static int nStatic = 0;
nStatic += curr;
cout << "nStatic is " << nStatic << endl; }
int main()
{
for ( int i = 0; i < 5; i++ )
showstat( i );
}

Run this once and again run it without static keyword. You'll understand the difference. Inside a class:

To access the static member, you use the scope operator, ::, when you refer to it through the name of the class.
One cannot initialize the static class member inside of the class.
Static member functions can only operate on static members, as they do not belong to specific instances of a class.

Inside a File:

The use of static indicates that source code in other files that are part of the project cannot access the variable. Only code inside the single file can see the variable. (It's scope -- or visibility -- is limited to the file.)

Tuesday, March 23, 2010

The reference type (not the object type) determines which overloaded method is invoked
Reference type determines which overloaded version (based
on declared argument types) is selected. Happens at compile
time. The actual method that’s invoked is still a virtual method
invocation that happens at runtime, but the compiler will
already know the signature of the method to be invoked. So at
runtime, the argument match will already have been nailed
down, just not the class in which the method lives.

Sunday, February 14, 2010

The State of Hyderabad

381. The advantages of the formation of Vishalandhra are obvious. The desirability of bringing the Krishna and Godavari river basins under unified control, the trade affiliations between Telangana and Andhra and the suitability of Hyderabad as the capital for the entire region are in brief the arguments in favor of the bigger unit.

382. It seems to us, therefore, that there is much to be said for the formation of the larger State and that nothing should be done to impede the realisation of this goal. At the same time, we have to take note of the important fact that, while opinion in Andhra is overwhelmingly in favour of the larger unit, public opinion in Telangana has still to crystallize itself. Important leaders of public opinion in Andhra themselves seem to appreciate that the unification of Telangana with Andhra, though desirable, should be based on a voluntary and willing association of the people and that it is primarily for the people of Telangana to take a decision about their future.

383. We understand that the leaders of the existing Andhra State may be prepared to provide adequate safeguards to protect the interest of Telangana in the event of its integration in Vishalandhra. These safeguards may take the form of a guarantee (presumably on the lines of Sri Baug Pact between Rayalaseema and Coastal Andhra) of opportunities for employment for Telangana in the public services of the new State at least to the extent of one-third, that is to say, roughly in the proportion, and an assurance that particular attention will be paid to the development plans of this area.

384. We have carefully gone into the details of the arrangements which may be made on these lines. It seems to us, however, that neither guarantees on the lines of the Sri Baug Pact nor constitutional devices, such as "Scottish devolution" in the United Kingdom, will provide workable or meet the requirements of Telangana during the period of transition. Anything short of supervision by the Central Government over the measures intended to meet the special needs of Telangana will be found ineffective, and we are not disposed to suggest any such arrangement in regard to Telangana.

385 A further point to be borne in mind is that the State of Andhra was brought into existence only recently and has still not got over the stress of transition. It has for example, still to formulate a policy on land reforms and the problems arising from the partition from the composite State of Madras have, by no means, been. Tackled fully yet. Integration of Telangana with Andhra at this stage is, therefore, likely to create administrative difficulties both for Andhra and Telangana.

386. After taking all these factors into consideration we have come to the conclusions that it will be in the interests of Andhra as well as Telangana, if for the present, the Telangana area is to constitute into a separate State, which may be known as the Hyderabad State with provision for its unification with Andhra after the general elections likely to be held in or about 1961 if by a two thirds majority the legislature of the residency Hyderabad State expresses itself in favor of such unification.

387. The advantage of this arrangement will be that while the objective of the unification of the Andhras will neither be blurred nor impeded during a period of five or six years, the two governments may have stabilized their administrative machinery and, if possible, also reviewed their land revenue systems etc., the object in view being the attainment of uniformity. The intervening period may incidentally provide an opportunity for allaying apprehensions and achieving the consensus of opinion necessary for a real union between the two States.

388 Andhra and Telangana have common interests and we hope these interests will tend to bring the people closer to each other. If, however, our hopes for the development of the environment and conditions congenial to the unification of the two areas do not materialise and if public sentiment in Telangana crystallises itself against the unification of the two states, Telangana will have to continue as a separate unit.

389. The State of Hyderabad (as we would prefer to all this unit), to be constituted for the time being, should consist of the following districts,' namely, Mahabubnagar, Nalgonda, Warangal including Khammam, Karimhagar,Adilabad, Nizamabad, Hyderabad, Medak and Bidar and Munagaala enclave in Nalgonda district belonging to the.Krishna district of the existing Andhra State.

Source: Government of India's "Report of the States Reorganisation Commission, 1955"., http://en.wikisource.org/wiki/India_States_Reorganisation_Commission_Report_Telangana_Andhra

The Case for Telangana

375. The case of Vishalandhra thus rests on arguments which are impressive. The considerations which have been argued in favour of a separate Telangana State are, however, not such as may be lightly brushed aside.

376. The existing Andhra State has faced a financial problem of some magnitude ever since it was crated and in comparison with Telangana the existing Andhra State has a low per capita revenue. Telangana, on ther other hand, is much less likely to be faced with financial embarrassment. The much higher incidence of land revenue in Telangana and an excise revenue of the order of Rs.5 crores per annum principally explain this difference. Whatever the explanation may be, some Telangana leaders seem to fear that the result of unification will be to exchange some settled sources of revenue, out of which development schemes may be financed, for financial uncertainty similar to that which Andhra is now faced. Telangana claims to be progressive and from an administrative point of view, unification, it is contended, is not likely to confer any benefits on this area.

377. When plans for future development are taken into account, Telangana fears that the claims of this area may not receive adequate consideration in Vishalandhra. The Nandikonda and Kushtapuram (Godavari) projects are, for example among the most important which Telangana or the country as a whole has undertaken. Irrigation in the coastal as of these two great rivers is, however, also being planned. Telangana, therefore, does not wish to lose its present independent rights in relation to the utilization of the waters of Krishna and Godavari.

378. One of the principal causes of opposition of Vishalandhra also seems to be the apprehension felt by the educationally backward people of Telangana that they may be swamped and exploited by the more advanced people of the coastal areas. In the Telangana districts outside the city of Hyderabad, education is woefully backward. The result is that a lower qualification than in Andhra is accepted for public services. The real fear of the people of Telangana is that if they join Andhra they will be unequally placed in relation to the people of Andhra and in this partnership the major partner will derive all the advantages immediately, while Telangana itself may be converted into a colony by the enterprising coastal Andhra.

379. Telangana, it has further been urged, can be a stable and viable unit considered by itself. The revenue receipts of this area on current account have been estimated at about Rs. 17 crores, and although the financing of the Krishna and Godavari projects will impose a recurring burden on the new State by way of interest charges, the probable deficit, if any is unlikely to be large. In favorable conditions, the revenue budget may even be balanced or indicate a marginal surplus. This fairly optimistic forecast can be explained or justified by a variety of reasons.

380. One important reason is, of course, that the existing Hyderabad State and Telangana as part of Hyderabad have benefited considerably from the implementation from April, 1952, of the Finance Commissions' recommendations. The increase in central payments from out of the divisible pools of income-tax and Central excise which has been possible under the present arrangements and the reduction in police expenditure for which credit can be taken, as the situation in Telangana improves, more or less offset the loss on account of the abolition of internal customs duties; and if the scope which exists of raising the yield of certain State heads of revenue is fully explored, the financial position of Telangana need not cause anxiety.

STATES REORGANISATION COMMISSION REPORT

The States Reorganization Commission was constituted by the Central Government of India under the States Reorganization Act and consisted of Hon. Fazal Ali, K.M. Panikker, & H.N. Kunzru. The Report submitted by the Committee in 1955 known as SRC Report went among other things into the problems of Telangana and Andhra regions, and the arguments for and against the merger of two regions.

Case for Vishalandhra:

369. The next question which we have to consider is the future of the Telugu speaking areas of the existing State of Hyderabad, with particular reference to the demand for creation of Vishalandhra.

370. It is unnecessary for us to trace the history of the Andhra agitation in any great detail, because the Andhra State is now in existence, having been established on 1st October, 1953. In point of fact, however the arrangements which were made in 1953 have not been regarded by the Andhras in the new State, especially in the Circars, as final and the case for the creation of Vishalandhra has remained substantially un-examined.

371. The advantages of a larger Andhra State including Telangana are that it will bring into existence a State of about 32 millions with a considerable hinterland, with large water and power resources, adequate mineral wealth and valuable raw materials. This will also solve the difficult and vexing problem of finding a permanent capital for Andhra, the twin cities of Hyderabad and Secunderabad are very well suited to be the capital of Vishalandhra.

372 Another advantage of the formation of Vishalandhra will be that the development of the Krishna and Godavari rivers will thereby be brought under unified control. The Krishna and the Godavari projects rank amongst the most ambitious in India. They have been formulated after prolonged period of inactivity, during which, for various technical and administrative reasons, only anicuts in the delta area have been built. Complete unification of either the Krishna or the Godavari valley is not, of course, possible. But if one independent political jurisdiction, namely, that of Telangana, can be eliminated, the formulation and implementation of plans in the eastern areas in these two great river basins will be greatly expedited. Since Telangana, as part of Vishalandhra, will benefit both directly and indirectly from this development, there is a great deal to be said for its amalgamation with the Andhra State.

373. The economic affiliation of Telangana with the existing Andhra State are also not unimportant. Telangana has in years of scarcity a sizable deficit in food supplies. The existing Andhra State, however, has normally a surplus which Telangana may be able to use. The existing State of Andhra has likewise no coal, but will be able to get its supplies from Singareni. Telangana will also be able to save a great deal of expenditure on general administration in case if it is not established as a separate unit.

374. The creation of Vishalandhra is an ideal to which numerous individuals and public bodies, both in Andhra and Telangana, have been passionately attached over a long period of times, and unless there are strong reasons to the contrary, this sentiment is entitled to consideration.

The States Reorganization Commission was constituted by the Central Government of India under the States Reorganization Act and consisted of Hon. Fazal Ali, K.M. Panikker, & H.N. Kunzru. The Report submitted by the Committee in 1955 known as SRC Report went among other things into the problems of Telangana and Andhra regions, and the arguments for and against the merger of two regions.


Case for Vishalandhra

369. The next question which we have to consider is the future of the Telugu speaking areas of the existing State of Hyderabad, with particular reference to the demand for creation of Vishalandhra.

370. It is unnecessary for us to trace the history of the Andhra agitation in any great detail, because the Andhra State is now in existence, having been established on 1st October, 1953. In point of fact, however the arrangements which were made in 1953 have not been regarded by the Andhras in the new State, especially in the Circars, as final and the case for the creation of Vishalandhra has remained substantially un-examined.


States Rng Telangana are that it will bring into existence a State of about 32 millions with a considerable hinterland, with large water and power resources, adequate mineral wealth and valuable raw materials. This will also solve the difficult and vexing problem of finding a permanent capital for Andhra, the twin cities of Hyderabad and Secunderabad are very well suited to be the capital of Vishalandhra.

372 Another advantage of the formation of Vishalandhra will be that the development of the Krishna and Godavari rivers will thereby be brought under unified control. The Krishna and the Godavari projects rank amongst the most ambitious in India. They have been formulated after prolonged period of inactivity, during which, for various technical and administrative reasons, only anicuts in the delta area have been built. Complete unification of either the Krishna or the Godavari valley is not, of course, possible. But if one independent political jurisdiction, namely, that of Telangana, can be eliminated, the formulation and implementation of plans in the eastern areas in these two great river basins will be greatly expedited. Since Telangana, as part of Vishalandhra, will benefit both directly and indirectly from this development, there is a great deal to be said for its amalgamation with the Andhra State.

States Reorganisation Commission Para 369 to 374

373. The economic affiliation of Telangana with the existing Andhra State are also not unimportant. Telangana has in years of scarcity a sizable deficit in food supplies. The existing Andhra State, however, has normally a surplus which Telangana may be able to use. The existing State of Andhra has likewise no coal, but will be able to get its supplies from Singareni. Telangana will also be able to save a great deal of expenditure on general administration in case if it is not established as a separate unit.

374. The creation of Vishalandhra is an ideal to which numerous individuals and public bodies, both in Andhra and Telangana, have been passionately attached over a long period of times, and unless there are strong reasons to the contrary, this sentiment is entitled to consideration.

[edit]The Case for Telangana

375. The case of Vishalandhra thus rests on arguments which are impressive. The considerations which have been argued in favour of a separate Telangana State are, however, not such as may be lightly brushed aside.

376. The existing Andhra State has faced a financial problem of some magnitude ever since it was crated and in comparison with Telangana the existing Andhra State has a low per capita revenue. Telangana, on ther other hand, is much less likely to be faced with financial embarrassment. The much higher incidence of land revenue in Telangana and an excise revenue of the order of Rs.5 crores per annum principally explain this difference. Whatever the explanation may be, some Telangana leaders seem to fear that the result of unification will be to exchange some settled sources of revenue, out of which development schemes may be financed, for financial uncertainty similar to that which Andhra is now faced. Telangana claims to be progressive and from an administrative point of view, unification, it is contended, is not likely to confer any benefits on this area.

States Reorganisation Commission Para 374 to 378

377. When plans for future development are taken into account, Telangana fears that the claims of this area may not receive adequate consideration in Vishalandhra. The Nandikonda and Kushtapuram (Godavari) projects are, for example among the most important which Telangana or the country as a whole has undertaken. Irrigation in the coastal as of these two great rivers is, however, also being planned. Telangana, therefore, does not wish to lose its present independent rights in relation to the utilization of the waters of Krishna and Godavari.

378. One of the principal causes of opposition of Vishalandhra also seems to be the apprehension felt by the educationally backward people of Telangana that they may be swamped and exploited by the more advanced people of the coastal areas. In the Telangana districts outside the city of Hyderabad, education is woefully backward. The result is that a lower qualification than in Andhra is accepted for public services. The real fear of the people of Telangana is that if they join Andhra they will be unequally placed in relation to the people of Andhra and in this partnership the major partner will derive all the advantages immediately, while Telangana itself may be converted into a colony by the enterprising coastal Andhra.

379. Telangana, it has further been urged, can be a stable and viable unit considered by itself. The revenue receipts of this area on current account have been estimated at about Rs. 17 crores, and although the financing of the Krishna and Godavari projects will impose a recurring burden on the new State by way of interest charges, the probable deficit, if any is unlikely to be large. In favorable conditions, the revenue budget may even be balanced or indicate a marginal surplus. This fairly optimistic forecast can be explained or justified by a variety of reasons.

States Reorganisation Commission Para 379 to 383

380. One important reason is, of course, that the existing Hyderabad State and Telangana as part of Hyderabad have benefited considerably from the implementation from April, 1952, of the Finance Commissions' recommendations. The increase in central payments from out of the divisible pools of income-tax and Central excise which has been possible under the present arrangements and the reduction in police expenditure for which credit can be taken, as the situation in Telangana improves, more or less offset the loss on account of the abolition of internal customs duties; and if the scope which exists of raising the yield of certain State heads of revenue is fully explored, the financial position of Telangana need not cause anxiety.

[edit]The State of Hyderabad

381. The advantages of the formation of Vishalandhra are obvious. The desirability of bringing the Krishna and Godavari river basins under unified control, the trade affiliations between Telangana and Andhra and the suitability of Hyderabad as the capital for the entire region are in brief the arguments in favor of the bigger unit.

382. It seems to us, therefore, that there is much to be said for the formation of the larger State and that nothing should be done to impede the realisation of this goal. At the same time, we have to take note of the important fact that, while opinion in Andhra is overwhelmingly in favour of the larger unit, public opinion in Telangana has still to crystallize itself. Important leaders of public opinion in Andhra themselves seem to appreciate that the unification of Telangana with Andhra, though desirable, should be based on a voluntary and willing association of the people and that it is primarily for the people of Telangana to take a decision about their future.

383. We understand that the leaders of the existing Andhra State may be prepared to provide adequate safeguards to protect the interest of Telangana in the event of its integration in Vishalandhra. These safeguards may take the form of a guarantee (presumably on the lines of Sri Baug Pact between Rayalaseema and Coastal Andhra) of opportunities for employment for Telangana in the public services of the new State at least to the extent of one-third, that is to say, roughly in the proportion, and an assurance that particular attention will be paid to the development plans of this area.

States Reorganisation Commission Para 383 to 387

384. We have carefully gone into the details of the arrangements which may be made on these lines. It seems to us, however, that neither guarantees on the lines of the Sri Baug Pact nor constitutional devices, such as "Scottish devolution" in the United Kingdom, will provide workable or meet the requirements of Telangana during the period of transition. Anything short of supervision by the Central Government over the measures intended to meet the special needs of Telangana will be found ineffective, and we are not disposed to suggest any such arrangement in regard to Telangana.

385 A further point to be borne in mind is that the State of Andhra was brought into existence only recently and has still not got over the stress of transition. It has for example, still to formulate a policy on land reforms and the problems arising from the partition from the composite State of Madras have, by no means, been. Tackled fully yet. Integration of Telangana with Andhra at this stage is, therefore, likely to create administrative difficulties both for Andhra and Telangana.

386. After taking all these factors into consideration we have come to the conclusions that it will be in the interests of Andhra as well as Telangana, if for the present, the Telangana area is to constitute into a separate State, which may be known as the Hyderabad State with provision for its unification with Andhra after the general elections likely to be held in or about 1961 if by a two thirds majority the legislature of the residency Hyderabad State expresses itself in favor of such unification.

387. The advantage of this arrangement will be that while the objective of the unification of the Andhras will neither be blurred nor impeded during a period of five or six years, the two governments may have stabilized their administrative machinery and, if possible, also reviewed their land revenue systems etc., the object in view being the attainment of uniformity. The intervening period may incidentally provide an opportunity for allaying apprehensions and achieving the consensus of opinion necessary for a real union between the two States.

388 Andhra and Telangana have common interests and we hope these interests will tend to bring the people closer to each other. If, however, our hopes for the development of the environment and conditions congenial to the unification of the two areas do not materialise and if public sentiment in Telangana crystallises itself against the unification of the two states, Telangana will have to continue as a separate unit.

States Reorganisation Commission Para 388 to 392

389. The State of Hyderabad (as we would prefer to all this unit), to be constituted for the time being, should consist of the following districts,' namely, Mahabubnagar, Nalgonda, Warangal including Khammam, Karimhagar,Adilabad, Nizamabad, Hyderabad, Medak and Bidar and Munagaala enclave in Nalgonda district belonging to the.Krishna district of the existing Andhra State.


Source: Government of India's "Report of the States Reorganisation Commission, 1955".

Thursday, February 11, 2010

Some more C++ tips

  • static_cast converts expression to the type of type-id based solely on the types present in the expression whereas dynamic_cast converts the operand expression to an object of type type-id.

  • Direct dereferencing of void pointer is not permitted. The programmer must change the pointer to void as any other pointer type that points to valid data types such as, int, char, float and then dereference it.

  • Pointer to void, or a void pointer, is a special type of pointer that has a great facility of pointing to any data type.

  • practical use of reinterpret_cast is in a hash function, which maps a value to an index in such a way that two distinct values rarely end up with the same index.

  • The reinterpret_cast operator is the least secure of the C++ typecasting operators.

  • The result of a const_cast expression is an rvalue unless Type is a reference type.

  • A const_cast operator is used to add or remove a const or volatile modifier to or from a type.

Saturday, February 6, 2010

Indian Flag Code

Guys u shud know dis.
The Indian National Flag represents the hopes and aspirations of the people of India. It is the symbol of our national pride. Over the last five decades, several people including members of armed forces have ungrudgingly laid down their lives to keep the tricolour flying in its full glory.

The Indian flag code is a set of laws that govern the usage of the Flag of India. The Bureau of Indian Standards is in charge of the enforcement of the manufacture of the flag according to the guidelines.

The Constituent Assembly realised the importance of the Flag proposed to be adopted for Independent India. The Constituent Assembly, therefore, set up an Ad Hoc Flag Committee, headed by Dr. Rajendra Prasad, to design the flag for free India. Other members of the Committee were Abul Kalam Azad, K.M. Panikar, Sarojini Naidu, C.Rajagopalachari, K.M. Munshi and Dr. B.R. Ambedkar.

Violation of the code may invite severe punishments and penalties. The code was written in 2002 and merged the following acts: provisions of the Emblems and Names (Prevention of Improper Use) Act, 1950 (No.12 of 1950) and the Prevention of Insults to National Honour Act, 1971 (No. 69 of 1971).


Ref: http://en.wikipedia.org/wiki/Flag_Code_of_India


Interesting Facts:

1) Master blaster Sachin Tendulkar was accused of sporting the flag on his cricket helmet.

2) The flag cannot be worn under the waist or on undergarments.

3) In a representation to the Ministry in June 2009, Jindal had sought permission to fly mammoth-sized national flag on monumental flagpoles during night.


Plz go thru the following link for more clarity about our own flag:

http://pib.nic.in/feature/feyr2002/fapr2002/f030420021.html

Friday, February 5, 2010

c++ useful tips

1) pointer to null is a pointer where it points nowhere but pointer to void is a pointer where it points to something which is undefined.

2) Compile time error is an error when the code is unable to be compiled where as run time error is is an error when the prescribed input is not give like dived by zero.

3) cannot convert ‘int*’ to ‘char*’ in initialization but can convert int to char.

4)pointer to a virtual base class function cannot be converted into a derived class member.

5)A segmentation fault occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (for example, attempting to write to a read-only location, or to overwrite part of the operating system).

6)In computer security and programming, a buffer overflow, or buffer overrun, is an anomaly where a process stores data in a buffer outside the memory the programmer set aside for it. The extra data overwrites adjacent memory, which may contain other data, including program variables and program flow control data.

7)"this" is always a const pointer; it cannot be reassigned.

8)Constructors and destructors cannot be declared as const or volatile. They can, however, be invoked on const or volatile objects.

8) In C++, a structure is the same as a class except that its members are public by default.

9) should not use typedef in either constructor or destructor declaration

10) The differences between a static member function and non-static member functions are as follows.

* A static member function can access only static member data, static member functions and data and functions outside the class. A non-static member function can access all of the above including the static data member.
* A static member function can be called, even when a class is not instantiated, a non-static member function can be called only after instantiating the class as an object.
* A static member function cannot be declared virtual, whereas a non-static member functions can be declared as virtual
* A static member function cannot have access to the 'this' pointer of the class.

11) A function call is lvalue only if the result type is a reference.

12) The difference between a non-virtual c++ member function and a virtual member function is, the non-virtual member functions are resolved at compile time.

13)C++ provides three different types of polymorphism.

* Virtual functions
* Function name overloading
* Operator overloading

14) dynamic_cast can be used only with pointers and references to objects. Its purpose is to ensure that the result of the type conversion is a valid complete object of the requested class.base-to-derived conversions are not allowed with dynamic_cast unless the base class is polymorphic.

15) main() is never recursive though some compilers say it is so.