Childhood Of Hope!

When we think about our childhood we remember the walk in the park with your mother or father, the school friends, going to school with friends in the school bus and most of all the freedom we had to do or to be creative, follow our passion, our desire to do what we love. This actually brings be to agree with the claim made by the author that the childhood was infact the happiest time of a person’s life.

When we grow up we tend to forget of hide our inner child in fear or may be for some other reason, but we all have a hidden desire, that, atleast once we all want to relive our childhood. We remember the games we played with our friends, doing all crazy things with them, like climbing trees, playing games, dressing up like clowns, etc. We had so many friends that we had each maintained a slam book, which is a book which contains the name, address, telephone number and some other fun information’s of the person like his hobbies, his favorite games and finally why he liked you. We used to build spaceships out of cardboard, build houses out of plastic bags, build aeroplanes and ships out of paper, our creativity was not limited to the computer and the words, paint or software application we built, but it was immense. Having no limit or boundary. I do agree with the authors claim that can be inferred by the statement that the we are now is not as happy as it was when we were young. The reason are we are now more interested in our personal lives, unlike our childhood, where we were all equal, no barriers were dividing us, now we have social, economical and even religious backgrounds which are there to divide us and further we are even divided in form of cast, creed, social status and community.

When we were young we had just one thing in our mind, how do we do something creative today. Unlike present, where our creativity is limited to the problem we are facing in the current day or situation of life. When we were children we had our parents by our side to support us when we fall, show us path, get whatever we want, even if it means having an unlimited supply of chocolates. Everyday I used to wait for my parents to return home, just to have the chocolates that they used to bring with them each evening. We used to feel loved. The happiest part of childhood was going out with parents on the other hand the sad part of growing old is that to getting to know the reality that our parents are not as young as they were when you were a child. But that is part of life. Everyone has to grow and be old.

To conclude, childhood was infact truly the happiest part of a person’s life. Knowing that people are on your side to support you and pick you up when you fall, is a special feeling, which we tend to understand when we grow old and it seems its also true that we all grow old and leave our childhood behind, settled deep inside our heart, that child who wants to come out and enjoy and be creative again. Hence it is 100% true. Personally I would really like to relive my childhood again.

Inspired by Leaders!

The world has produces many leaders from the past, from the time civilizations have begun. We hear stories of them through our religious scripts, stories and history books themselves. We have had heroes from ancient mythology such as Hercules in the Greece and Lord Krishna in India. They all have shown courage to stand up against all odds and rise to the fame. But they were Gods, we as mortals have different kinds of heroes, heroes who have come up in time of need and saved us from torture and evil from the bad. We talk about the mortal heroes, the heroes who have shown their leadership skills to bring out a civilization from a dark age. In the remaining paragraphs I will talk about the leaders who helped India get her independence, and a poet who’s poetry gave India the national anthem and the name its known by today.

Mahatma Gandhi, the name is enough to spark fire in hearts of the people who have read Indian history books. He was the leader who brought India its independence through the most not expected way. He followed the non violent approach to freedom, at the time when India was in turmoil, lack of governance in the British colonized country, lead to many citizens to rise up to take arms in their hands and bring about blood and chaos in the country, that was the time when Mahatma Gandhi came to India, and showed people that biggest and the strongest of a person can be brought down by simple and non violent means. This shaped the foundation of independent India we know today.

Some leaders change the world by being gentle and down to earth, behavior and there are others who are there to fight for their peoples rights. Subhash Chandra Bose, engraved in every Indians heart is a slogan which is still the war cry of Indian soldiers. “Give me your blood and I will give you freedom”. He was the person who had created the roar for Indian independence in the most strategic way possible. He stood against the British Army, with his Indian National Army. The army consisted of soldiers who were captured by the armies of Japan and Germany after the defeat. He is still remembered in India as a leader who was the most influential persons. For him, even the common man from India rose up to take guns in their hands to fight against the British army.

On one hand by have a leader who takes guns in his hands to fight for independence, on the other hand we have a person who proved the popular phrase, “Pen is mightier than the Sword”, it was a Bengali man, wearing his dhoti and kurta, the man we know as Rabindra Nath Tagore. He was the person who gave us the Indian national anthem. He wrote Geetanjali, the Rabindra Sangeet – a collection of popular Bengali folk songs still heard in the roads of the city of Kolkata. He wrote many poetry’s in pre-independence era against the British. He also had rejected the title of “Sir” – a knighthood status given by the Queen of England to people who perform exceptionally well in their field. He truly fought the sword with his pen.

To conclude, many leaders have rose and then fallen from the time of civilization, but only a few of them have made their mark for the mother land they were born in. I only listed a few who truly inspired me, and I think are important for the history of India my motherland. Each have given their hearts their souls and their lives for the country, and they are the true world leaders.

Fetching webpage content

How to fetch contents from website?

Have you ever thought of fetching the contents of some website without actually opening the site or going to the sites source code. A simple webpage downloader.

This tutorial will show you a simple code using which you can download the contents of the site by just passing the url of the site.

First create a project in your preferred IDE. For this project I am using Netbeans 8 IDE. Name it PageDownloader.

Next we need to import some packages in our project.

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

Create a public class and add a main() mathod which throws MalformedURLException which will handle wrong or malformed urls, next add IOExceptions.

public class pageDownloader{    
  public static void main(String[] args) throws MalformedURLException, IOException {

Create an URL class object which is part of the java.net package.

  URL url = new URL("http://blog.nileshchakraborty.com/about");

Use HttpURLConnection class which will handle the HTTP requests made by the project. Add request property which defines the User-Agent and browser object.

  HttpURLConnection con = (HttpURLConnection) url.openConnection();
  con.addRequestProperty("User-Agent", "Mozilla/4.76");
  InputStream is =con.getInputStream();

Create an InputStream class object which will read the content of the page line by line. Finally the content is read line by line and the content is printed out into the console

    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    String line = null;
    // read each line and write to System.out
    while ((line = br.readLine()) != null) {
        System.out.println(line);
    }

Full Source Here:

  package pagedownloader;

  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.MalformedURLException;
  import java.net.URL;
  /**
   *
   * @author Nilesh
   */
  public class PageDownloader {

      /**
       * @param args the command line arguments
       * @throws java.net.MalformedURLException
 */
public static void main(String[] args) throws MalformedURLException, IOException {
    // TODO code application logic here
    URL url = new URL("http://blog.nileshchakraborty.com/about");

    // Get the input stream through URL Connection
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.addRequestProperty("User-Agent", "Mozilla/4.76");
    InputStream is =con.getInputStream();
  // Once you have the Input Stream, it's just plain old Java IO stuff.
    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    String line = null;
    // read each line and write to System.out
    while ((line = br.readLine()) != null) {
        System.out.println(line);
    }
  }
}

 

Hello World!!

I have written many blogs earlier but this blog has many thing to say about me and my work and at some point a glimpse of my life as well.

I will be sharing the highlights of my life, travel and java, mostly java and travel. I would like your support to keep this up and running. I will also be sharing my works and projects here so watch out for the same, it may actually surprise you.