Thursday, March 31, 2016

I am obsessed with GOD


I am getting unhealthy obsession with GOD. In the quest to find someone whose existence can't be proved, I fear that I might be alienated from the humans, who do exist.

Its like waiting for one phantom love , which you thought is made for you and ignoring the real persons around you.

But humans and GOD go hand in hand. One can't exist without other.

I recently watched SUPERMAN vs BATMAN. And I loved it, because rather than having high dose of ACTION ( like MARVELL MOVIES) , it deals more with emotions of powerful man.

Lex Luthor said something in that movie which makes your think.  " If GOD is all-powerful, he can't be all-good  and if he is all-good, he can't be all-powerful".

Now how we will measure goodness and power, when we will say that a person is almighty ?

Suppose there is GOD and he is all-good, then he will try to be as fair as possible. But is it possible that all humans will be satisfied ? No , because we have are own emotions and we are selfish.

Now say if 1 in millions don't believe GOD to be all powerful or good, then he can't be all good or powerful.

Its like DEMOCRACY ,  he majority doesn't believe you to be GOOD, then you can't WIN even if you are most unselfish , most emphatic heart out there.


Now do we really want GOD to acknowledge himself ? What will happen if he in reality exist and he proved. 

What is much better -  to believe in someone all mighty , but who is just a belief which can be changed.   OR  having a reality who can do whatever he/she likes.

Maybe we will have chaos, if GOD really exist.  Lets take a scenario.

> GOD exist, he comes and says he is GOD.

> HUMANS : Which religion you belong to ?

> GOD : There is nothing called religion, this is made by you to simply mislead one another. From today there will be no religion, no need to worship me also.

> HUMANS : okay.......this is liberating...we don't have to do things in name of religion. But what if we want you to fulfill our wishes  or if we if feel guilty about something and want forgiveness.

And will you stop something bad from happening ??

> GOD : Its not so easy....there are some wishes which can't be granted...for example if you say GOD made me rich...thats not possible ...I can't make everyone rich ,,,..same way if you have divided yourself on basis of countries and want to win against each other.. How can I grant wish of both parties.

About forgiveness and stopping something bad : First of all we need to define what is bad. If we go by my definition of GOOD/BAD and I stopped everything bad to happen , then FORGIVENESS will not come to picture.  And if it does, that means I allowed something BAD to happen  which will raise questions on my AL-MIGHTINESS.

> HUMANS : Why we want you to exist ?

> GOD : Because you need me ...................................there are some things which you can easily do and don't remember me for those things..........but then there are something which you find hard to do...hard to fathom ...as a  respite...as an excuse  you want me

You humans always want to understand everything ..you want to know about past and also the future.
You can never believe that things happen simply without reason. You are creating paradoxes of your own.


What will happen if all of you becomes totally like each other. No one more beautiful than other, every one having same amount of money ?

-----------------------------------------------------FOOT NOTE------------------------------------------------

As a writer, I don't know the answer of last question ?





Wednesday, March 30, 2016

Sockets : Finally they unraveled themselves : Part 1


Socket programming was something, I was always interested in. But Now when i look back in my college years , I realized that nothing was taught which could have been practical. The teaching situation in india is quite bad.

If internet would have not come, we would still be lagging behind a lot.

Also I am very lazy, until and unless there is no external force, my inertia of rest doesn't allow me to work.


But past is past...behold ..the future is bright.............

Rather than having detailed techincal discussion about them, we will see there overview and then see Android Programming.


1) OSI layer :  If anyone has ever taken any networking course, they know about OSI layer. Below is the diagram



Now , in the above diagram SOCKETS fall between Transport and Session Layer. 
Transport Layer has TCP/UDP.\
 Internet Layer has IP. 

To communicate between any two devices, we need IP address. But what is multiple applications on one device are communicating with other device.  In that case we need PORT, which helps in distinguish traffic flow. 

SOCKET are combination of IP address and PORT, (APPLICATION/Presentation/Session) Layer opens SOCKET with Transport Layer and then all data is read/write from this socket. 


So now we know what is socket and how transfer can be done. Lets see what are API available in Android/Java library to open,close,read,write from a SOCKET. 

Also most of data transfer happening on internet or most of the Android apps we see are based on Server-Client architecture. 

A client will periodic check with Server if some new data is available from him, and will post if any data needs to be posted by Client to Server. 

So if you visualize , Client should know Server IP address, but if Server do not know Client IP address , it will be fine, as onus is on Client and not server. 


So the life - cycle of SOCKET is like below 




1) You create a socket on SERVER using a PORT ID.  ( Note depending on language and platform you are working on , you might also have to BIND the socket to Server IP address)

2) Then SERVER is constantly listening to any NEW CONNECTION coming. 

3) At CLIENT side, we also create socket. NOTE : the use of client side socket is to communicate with SERVER, hence the IP address and PORT no which we provides here is of SERVER.

4) Then CLIENT tries to connect to SERVER. 

5) SEVER once gets CLIENT request, accepts it.

6) Now we have communication link open and data can be transferred between SERVER and CLIENT.

7) Finally we close the connection. 

Now a bit of  Operating System .  If you see SERVER functions design wise, SERVER has to listen to new CLIENT request and also needs to communicate with existing CLIENT, hence we have to need two different THREADS, since both of these functions need to work in parallel. 



Now in Android, we use 

1)  ServerSocket serverSocket  = new ServerSocket(port_no);

    // This is to create Server side socket 

2 and 5) Socket socket_c = serverSocket.accept();

    // This is use to accept client connection, now using socket_c we can communicate with Client, NOTE : we don't use serverSocket to communicate with client, that is only used to listen and accept client connections. Once client connection is accepted, further communication is done using the client socket created at server side for each client.


3 and 4)  socket = new Socket(Server IP address, Server Port);

   // This is used to create socket at client side. This only will also try to connect to server, no other function needs to be called explicitly.



6 ) InputStream inputStream = socket.getInputStream(); 

     // This is used to read data coming to socket, irrespective of socket at server or client side.

    OutputStream outputStream = socket.getOutputStream(); 
    PrintStream printStream = new PrintStream(outputStream);
    printStream.print("data to be send in string format");

    // Below commands are needed to write data into socket.


Viola,  we are almost there. 

So in next post we will see Android App code , as it will also involve thread. 



Saturday, March 26, 2016

Life : Why we fear to take full control of it



Well ..as it happens most of time...after spending 1-2 weeks as normal human being..I get overwhelmed by the emotions which i see around myself...and to get over this hangover , I have to isolate myself and think about the most puzzling thing which have been at the centerstage since adam and eve.


What is life ...Who we are ...What is happiness ..and how to live life..

Everything which we consider right or wrong ..is simply what we were feed from the start. What is all that is lie... Animals kill each other ..they are infidel...they are not virtuous..yet they also live

I have seen humans rule changes as per time and place...lot of things which were considered INCORRECT by the society , has changed. And there is no guarantee that it will not change in future.

So how in this world, should i live his life. Should I do whatever it pleases him, without consideration of anyone else. If i am happy doing something, will it matter what other thinks of me.

All the big industrialist / money-makers have not earn money by 100% morally. Because you can't. When results do not depend entirely on you, to get best results you have to think just about yourself.

Same way I am listening to lot of breakups happening in bollywood now a days, What is this ?
Suddenly after spending 3-4 years , people are realizing that they are not compatible.

Can you really spend your life with only one person ? How can you be sure that he/she loves you as much as we do.  We can simply believe , there is absolutely nothing else on whose basis we can make a conclusion.  If you believe other person to be faithful, it doesn't matter what you see or hear. You can always make  yourself to believe in any lies. Same way if you don't want to believe ..nothing can be done .

So you see, its in our control how we live our life....but even then we tend to give away the control to others ...parents, bosses, loved ones.


I say when we have to live in a world concocted by lies , its better to live in our own lies.
Lets do what we want to do ...if nothing else...mayb atleast we will know in the end if GOD exist or its is biggest myth of all times.