How to write jQuery code before loading it?

jQuery and various other JS source files are regular part of website built nowadays. But this is always suggested to load JS files at the end of the document. In that case, how you are going to write JS code that requires jQuery to be loaded?

In one of my Web Development tutorial called 10 tips to speed up your website, I also suggested that you should load your JS files at the end of the document.

5. Put JavaScript at bottom:
This is also good practice in site optimization that you load your JS files just before your footer. This will let the browser draw the page without being blocked by JS files loading.

But the problem is, if you load jQuery at the end of the document and try to write jQuery code before that, you will get errors like $ is not defined. So how to write jQuery code before loading jQuery then!

Broadly discuss the measurements of price elasticity of demand.

Measurement of Price Elasticity of Demand: 

There are 5 different measurements of Price Elasticity of Demand. They are as follows:
  1. Perfectly Inelastic Demand (Elasticity = 0)
  2. Perfectly Elastic Demand (Elasticity = Infinity)
  3. Unit Elasticity of Demand (Elasticity = 1)
  4. Relatively Inelastic Demand (Elasticity < 1)
  5. Relatively Elastic Demand (Elasticity > 1)

These measurements has been discussed here. In the following discussion 5 symbols has been used which are

10 Tips on CSS: The Right Way

We know how important CSS is in case of developing UI in web projects. But most of the time we don’t take it seriously. When we are asked to create PSD to HTML, we simply start writing our HTML and CSS. We do not examine the complete PSD to find out similarly styled elements, similarly styled elements with very view changes such as with border radius and without border radius, floated at left and floated at right etc. Instead of examining the full PSD to find out this kind of design patterns we start writing CSS from TOP to BOTTOM.

I would say, that is a very bad practice.


Find the value of half-life period.

Value of Half-Life Period


From the law of radioactive disintegration, we know,


If,  be the half life period, then at, 



Deduce the law of radioactive disintegration.

The Law of Radioactivity Disintegration:

Let, N be the number of atoms present in the radio element at a given instant t. Then the rate of decrease,


Here, λ is the disintegration constant. It is defined as the ratio of the amount of the substance which disintegrates in a unit time to the amount of substance present.


Describe the general properties of nucleus.

General Properties of Nucleus:


(i) Nuclear Size:

From Rutherford’s work, the mean radius of nucleus is  and the radius of the atom is . Thus the radius of the nucleus is 10,000 times smaller than the radius of the atom.

The empirical formula for the nuclear radius is,


Here, A is the mass number,  is a constant.


From this formula the radius of the Carbon () nucleus is.




Derive the de Broglie wavelength for a charged particle of charge q and accelerated through a potential difference of V volts.

The Required de Broglie Wavelength:

A photon of light of frequency  has the momentum,


But, . Therefore, the momentum of the photon can be expressed in terms of wavelength λ as,


The wavelength of a photon is, therefore, specified by its momentum according to the relation,


Derive the Einstein’s photoelectric equation.

Einstein’s Photoelectric Equation : 

According to Einstein, light of frequency  consists of a shower of photons, is of energy . When a photon of light of frequency  is incident on a metal, a part of the energy acquired by the electron is used to pull out the electron from the surface of the metal and the rest of it is utilized in imparting K.E. to the emitted electron.

What do you mean by electric flux or flux of the electric field?

Electric Flux

For an arbitrary closed surface, the net outward flow or flux is the product of the average outdrawn normal component of the vector and the area of surface. Electric flux is used to express the relation between  and its source. Flux is denoted by 

 = (average normal component)×(surface area)

The unit of electric flux is newton-meter2/coul.

What is flux?

Flux

If  is a vector field, then the flux through any face is defined as the scalar product of the vector area of the face and the vector . That is,

Flux = (component of velocity normal to the face) × (area of the face)
         
The amount of flux per unit area is defined as the divergence of the vector