Feb 28, 2009

Global Variable in C# | Application Cache Vs Static Variable

Some times we need to use some variable globaly so that it may be available to application wide. For having a global variable we can use static variables as well application cache.

Example :

Application["gVar1"]="Global variable One stored here";
and this can be get anywhere in application by using string var1 = (string)Application["Var1"];

The same thing can be by using static variable also.

public static string GVar1;

These variables need to be initialized first time into Global.asax.cs application_start() method and keep alive until a IIS reset or worker process recycle not occurs.

Application_Start()
{
Application["gVar1"]="Global variable One stored here";
Gvar2= "Global Variable Two is here";
}
For using the Gvar2 we need to simply write the className.Gvar2 // Here Global.Gvar2 will do the work for us.


So the question arise as both are doing the same work which we prefer to use.
I must say It depends!!

Why I said so? Because there are reasons behind this.
In the above scenario I must say I MUST use static variable. (Please make static property rather than directly using static variable)
So what factors you must count for choosing static -
1. Application holds variable as Object.
2. While getting the value we need to caste into the objects which it stores. Of course casting need some value.

So when we need to use some primitive variables and they are not going to changes very frequent (locking issue in case of frequent changes) we should use static variable.
Application need to be used when we need to Hold some objects application wide.
(Note Its my own experience please do not take it as hard and fast rule).

Thanks

Feb 22, 2009

UP CPMT2009

Uttar Pradesh Combined Pre Medical Test is an examination conducted by University of Lucknow on behalf of the Government of Uttar Pradesh. The examination is conducted for admission to various medical courses in Government and recognized, approved Medical, Dental, Homeopathic, Ayurvedic and Unani Colleges of Uttar Pradesh.

Important dates of UPCPMT

1. Feb to first week of March 2009 – availability of application forms.
2. 2nd week of March 2009 – deadline for submission of completed application forms.
3. Mid of May 2009 – date of examination.

Eligibility criteria for UPCPMT

  • The candidate must be a citizen of India and must have domicile of Uttar Pradesh.
  • The candidate must have cleared class 12th examination with PCB and English as one of the main subjects.

Courses offered for UPCPMT

1. MBBS
2. BDS
3. BHMS
4. BAMS
5. BUMS

Examination pattern and syllabus:

1. The examination will be conducted in two parts.
2. The first paper will contain questions from Zoology and Botany and the timings will be from 10:00 AM-12:00 Noon
3. The second paper will have questions from Chemistry and Physics and the timings will be from 2:0O PM-4:00 PM.


For more information keep watching this page....


Feb 8, 2009

AMU Admission Notice 2009 - 2010

Aligarh Muslim University (AMU) announces the admissions Notice for Academic session 2009-2010. First time AMU Entrance Test will be held on five centres across India (Only for BTech and MBBS/BDS), Rest of the Test courses will be held on Aligarh except Class XI/Diploma Engineering which will be held in Lucknow also along with Aligarh. For more information visit :http//amu.ac.in

Admissions related more information/Application Form can be downloaded at http://amucontrollerexams.com

Examination Notice:

Oct 28, 2008

Physics - Cyclotron



Purpose: Cyclotron is a device used to accelerate heavy charge particles e.g.protons,deuerons etc.

Principle: It is based on the p
rinciple that a changed particle can be accelerated to very hagh energies by making it pass through a moderate electric field a number of times and applying a strong magnetic field at same time.

Construction: -


1-Strong electromagnet(N&S).

2-Two dees D1&D2 (D shaped hollow semi circular copper chambers called dees).

3-Source of high voltage coupled with adjustable high frequency oscillator.

4-Source of charged ions at the centre of the dees.g. deuterium for protons,helium for a-particles,bombarded with high energy electrons.
The hole assembly is housed in a vaccum chamber which is evacuated to a pressure of about 10-6 mm Hg,to avoid collision of charged particlels with medium gas particles which would result in loss of energy.

Oct 26, 2008

Physics-Moving coil galvanometer



It is an instrument to detect and measure the strength of small electric current.

Principle:--When a current carrying coil is placed in magnetic field,it is experience a torque.

Construction:-It is consists of a coil bound on a non-magnetic field.The coil is suspended between two poles of a permanent magnet which are concave in shape.the coil is suspended by a phosphur bronze strip and this strip is connected to the terminal T1 of the galvanometer and other end of the coil is connected to hair spring which is connected to terminal T2 .A peace of the soft iron is the placed within the frame of the coil.A concave mirror is attached to the suspension to note the deflection of the coil using length and scale arrangement.

Physics - Fleming Left Hand Rule


Fleming Left Hand Rule describes that if took the first three fingers of your hand so that Center Finger point to Current, First Finger point to the direction of Field then Thumb will point the Force.

A simple rule to remember this

Center Finger --> Current Direction
First Finger --> Magnetic Field Direction
Thumb(Most Powerful in hand) --> Force

Oct 17, 2008

Haj Flight Schedule 2008 from Lucknow

Haj flight Schedule for 2008 from Lucknow is from 30Oct to 16 Nov.(From Lucknow to Medinah) and from 14Dec to 30Dec(From Jeddah to Lucknow).

For details for your Flight Information visit to http://hajcommittee.com/index.php?value=flt_inquiry


SQL - Difference between CAST,CONVERT and PARSE

TODO---