Tuesday, October 21, 2008

Dispose VS Finalize

1. Finalize() is the C# equivalent of destructor ~Object() syntax in C#. In VB.Net you implement the Finalize() by overriding it. But, in C# the compiler translates the destructor to a Finalize() method. 

2. Finalize() can NOT be overridden or called in C#. 

3. Since, Finalize() is called by the Garbage Collector, it is non-deterministic. 

4. Dispose() has to be implemented in classes implementing IDispose interface. 

5. Its the right place for freeing-up unmanaged resources like file, handles, and connections etc. 

6. Dispose() method is called explicitly in the code itself. 

7. Dispose() method is automatically called (for objects which implement IDispose), when used in a "using" statement.


Thanks,
Nitin Sharma

Gunas

The Gunas

According to the Sankhya philosophy, Prakriti is composed of three Gunas or forces, called Sattva (purity, light, harmony), Rajas (passion, activity, motion) and Tamas (inertia, darkness, inertness, inactivity).

 

Guna means a cord. The Gunas bind the soul with a triple bond. These Gunas are not the Nyaya-Vaiseshika Gunas. They are the actual substances or ingredients, of which Prakriti is constituted. They make up the whole world evolved out of Prakriti. They are not conjoined in equal quantities, but in varying proportions, one or the other being in excess. Just as Sat-Chit-Ananda is the Vedantic trinity, so also the Gunas are the Sankhyan trinity.

 

Interaction Between the Gunas Leads to Evolution

The three Gunas are never separate. They support one another. They intermingle with one another. They are intimately related as the flame, the oil and the wick of a lamp. They form the very substance of Prakriti. All objects are composed of the three Gunas. The Gunas act on one another. Then there is evolution or manifestation. Destruction is only non-manifestation.

 

The Gunas are the objects. Purusha is the witness-subject. Prakriti evolves under the influence of Purusha. Mahat or the Great (Intellect), the Cause of the whole world, is the first product of the evolution of Prakriti. Ahankara arises after Buddhi. Agency belongs to Ahankara. It is the principle that creates individuality. Mind is born of Ahankara. It carries out the orders of the will through the organs of action (Karma Indriyas). It reflects and doubts (Sankalpa-Vikalpa). It synthesises the sense-data into percepts. The mind takes part in both perception and action. There is no separate Prana Tattva in the Sankhya system. The Vedanta system has a separate Prana Tattva. In the Sankhya system, mind, with the organs, produces the five vital airs. Prana is a modification of the senses. It does not subsist in their absence.

 

Characteristics of the Three Gunas

Sattva is equilibrium. When Sattva prevails, there is peace or tranquillity. Rajas is activity which is expressed as Raga-Dvesha, likes or dislikes, love or hatred, attraction or repulsion. Tamas is that binding force with a tendency to lethargy, sloth and foolish actions. It causes delusion or non-discrimination.

 

When Sattva is predominant, it overpowers Rajas and Tamas. When Rajas is dominant, it overpowers Sattva and Tamas. When Tamas is predominant, it overpowers Rajas and Sattva.

 

How Man Is Affected by the Three Gunas

There are three Gunas in every man. Sometimes, Sattva prevails in him. Then he is calm and tranquil. He reflects and meditates. At other times, Rajas prevails in him and he does various sorts of worldly activities. He is passionate and active. Sometimes, Tamas prevails. He becomes lazy, dull, inactive and careless. Tamas generates delusion.

 

Again, one of these Gunas is generally predominant in different men. A Sattvic man is virtuous. He leads a pure and pious life. A Rajasic man is passionate and active. A Tamasic man is dull and inactive.

 

Sattva makes a man divine and noble, Rajas makes him thoroughly human and selfish, and Tamas makes him bestial and ignorant. There is much Sattva in a sage or saint and there is much Rajas in a soldier, politician and businessman.


Thanks,

Nitin Sharma