The Three Laws of Thermodynamics

First Law:

The total amount of matter and energy is conserved. Even though matter might turn to energy and visa-versa the total amount is always conserved.

> Money/Wealth etc. (matter) and Effort (energy) can convert into each other. But the total amount of it remains the same. So someone expends a lot of energy to get little matter so that others can get a lot of matter by expending little energy!

Second Law:

The total amount of entropy (chaos or disorder) in the universe always increases. In other words everything must eventually age and run down. For example burning paper produces smoke which means a net increase in entropy takes place. But we never see smoke re-assembling itself into a piece of paper.

> The world is going to descend into chaos no matter what we do. So why give a damn worrying about it. Why spend energy organising things around us. Why fight chaos?

Third Law:

No refrigerator can reduce temperature to absolute zero (−273.15 °C, the lowest possible temperature).

> Absolute zero means perfection. It means at absolute zero there is no chaos there is no randomness because it is the lowest possible energy state (of zero energy). There is perfection. But we can never reach perfection as we can never reach the lowest energy state. Therefore perfection is not achievable.

How to get updated data using AJAX

A common use of AJAX is to get some data from a database and then display it on a web-page.

Also a common issue with AJAX calls is that it intercepts the request for data and tries to handle it locally. If it can’t only then is the request forwarded to the server. This is done to improve the performance of the web-page.

But this can have a serious side effect where after the first call to the server for data, subsequent requests are handled locally even though the data on the server side may have changed.

This is, most often, caused by a standard request string being used again and again.

For example if you want to fetch data from table ‘employee’ to display a list of employees then your request string (for HTTP GET) might look something like:

awebpage.jsp?table=employee&action=list

After getting the initial list of employees if any changes are made in the database they will not be reflected on the webpage even if you click the refresh button on the browser. The only way you will be able to see the ‘fresh’ data is if you reopen the page in a new browser window.

This is because every time the data listing request is sent using AJAX the XMLHttpRequest is intercepted by the browser, the request string checked and if found the same the request is responded to at the client side itself using cached data. Thus the ‘fresh’ data is never obtained from the server because it never gets the request for ‘data’.

How to solve this?

It is very simple to solve this problem. Just add a parameter with changing values to the string. For example:

awebpage.jsp?table=employee&action=list&rndparameter=10

Here the ‘rndmparameter’ parameter will have a random number assigned to it every time the request is made. This will make the request string different every time. Thus the request will be forwarded to the server and not be handled locally.

The  parameter can have any name and any changing value. It need not even be random value. You could toggle a boolean variable ‘true’ and ‘false’ between subsequent requests.

Work, Love, Skills and Earth

Sigmund Freud, the famous psycho-analyst, proposed that work and love give stability and meaning to our minds. I read an interesting extension to this in Parallel Worlds by Michio Kaku.

Work because it helps give us a ‘sense of responsibility and purpose, a concrete focus on our labours and dreams’ (from Parallel Worlds by Michio Kaku).

Love because it puts us within ‘the fabric of society’ and ‘gives us roots’. Without it we become ‘drifters in our own land, unattached to the concerns of others’ (from Parallel Worlds by Michio Kaku).

Michio Kaku proposes two other things that can give ‘stability and meaning’ to our minds.

Developing our skills for the benefit of society in general. To achieve our maximum potential. Everyone has problems but we all have certain skills which can be developed to overcome those problems.

Improve the world around us, do something for the benefit of mankind in general. Clean up our neighbourhood, help someone in need or just be kind to someone.

The Hands of Man

Today someone shared quite a remarkable thought with me so I thought I would share it with the world!

A new born baby has a clenched fist. The tightly closed fist represents the hunger for life. It represents the desire to grab the most out of this chance to be alive.

But when a person dies their hands always end up in an open and relaxed position. This highlights the fact that we cannot take ANYTHING with us. There comes a time to let go of all the things material.

A Day at the Registrar’s Office

One would think a Registrar’s Office where probably crores worth of property changes hands every day life is pretty dull and weighed down under thick dusty files. But no! Any place where big things happen (like people buying their first house or probably registering their last will) can be anything but dull. In fact it is full of stories!

One would wonder why is the place not clean and how come people who can spend lakhs to buy a property do not have civic sense to use a dustbin. Why don’t the civic authorities have common sense to put dustbins in a place visited by hundred of people a day!

There was a large group of young Army jawans there to register their wills. People who don’t have control over their destiny. I wonder how it must feel to write out your will knowing that it might be used soon.

There were photographs I took, some sad, some funny and some fascinating.  There was life in all its glory. Intersection of different life-flows. All in all it was a very interesting day out at the crossroads of life.

Stone slab announcing the installation of computers at the govt. office!
Stone slab announcing the installation of computers at the govt. office!

Heaps of Garbage..
Heaps of Garbage..

 

Patterns on water..
Patterns on water..

🙂