Thursday, February 19, 2009

The Power of Positive Thinking


Positive thinking is a mental attitude that admits into the mind thoughts, words and images that are conductive to growth, expansion and success. It is a mental attitude that expects good and favorable results. A positive mind anticipates happiness, joy, health and a successful outcome of every situation and action. Whatever the mind expects, it finds.

Not everyone accepts or believes in positive thinking. Some consider the subject as just nonsense, and others scoff at people who believe and accept it. Among the people who accept it, not many know how to use it effectively to get results. Yet, it seems that many are becoming attracted to this subject, as evidenced by the many books, lectures and courses about it. This is a subject that is gaining popularity.

It is quite common to hear people say: "Think positive!", to someone who feels down and worried. Most people do not take these words seriously, as they do not know what they really mean, or do not consider them as useful and effective. How many people do you know, who stop to think what the power of positive thinking means?

Sunday, August 31, 2008

Seven wonders of the world













Posters Cheap Cigarettes Gardening Magazine Subscription Discount Hotel Bookings Oriental and Persian Rugs



The Hanging Gardens of Babylon The Colossus of Rhodes The Temple of Artemis The Great Pyramids The Maussoleum at Halicarnassus The Great Pharos Lighthouse The Statue of Zeus at Olympia


The ancient Greeks loved to compile lists of the marvellous structures in their world. Though we think of the Seven Wonders of the Ancient World as a single list today, there were actually a number of lists compiled by different Greek writers. Antipater of Sidon, and Philon of Byzantium, drew up two of the most well-known lists. Many of the lists agreed on six of the seven items.

The final place on some lists was awarded to the Walls of the City of Babylon. On others, the Palace of Cyrus, king of Persia took the seventh position. Finally, toward the 6th century A.D., the final item became the Lighthouse at Alexandria. Since the it was Greeks who made the lists it is not unusual that many of the items on them were examples of Greek culture.

The writers might have listed the Great Wall of China if then had known about it, or Stonehenge if they'd seen it, but these places were beyond the limits of their world. It is a surprise to most people to learn that not all the Seven Wonders existed at the same time. Even if you lived in ancient times you would have still needed a time machine to see all seven.

While the Great Pyramids of Egypt was built centuries before the rest and is still around today (it is the only "wonder" still intact) most of the others only survived a few hundred years or less. The Colossus of Rhodes stood only a little more than half a century before an earthquake toppled it.

Difference between gross domestic product and gross national product

Gross domestic product (GDP) is defined as the "value of all final goods and services produced in a country in one year". On the other hand, gross national product (GNP) is defined as the "value of all (final) goods and services produced in a country in one year, plus income earned by its citizens abroad, minus income earned by foreigners in the country". The key difference between the two is that GDP is the total output of a region, eg. America, and GNP is the total output of all nationals of a region, eg. Americans.

To give an example of the difference between GDP and GNP, and also income, using America:

Thursday, August 14, 2008

Water found on Mars, Nasa scientists confirm

By Nisansa Perera


Water has been uncovered for the first time on Mars, raising hopes that the Red Planet may be capable of sustaining life.

  • The Phoenix Mars lander mission
  • Nasa: Exploring the arctic plain of Mars
  • Telegraph science homepage
  • Nasa scientists have revealed that the Phoenix Mars Lander has sent back the first definitive proof that there is water ice hidden beneath the surface of the alien rust-coloured planet.


    The trench informally called 'Dodo-Goldilocks'
    The trench on Mars

    After twenty days of scratching its way through the Martian top soil, the spacecraft uncovered a bright white layer just two inches below the surface.

    Four days after the white layer was first exposed to sunlight, photographs taken by the lander's on board camera showed the white surface had disappeared.

    This proves, the scientists say, that the white layer was not salt as had been previously thought possible because it was melting.

    "It is with great pride and a lot of joy that I announce that we have found proof that this hard bright material is really water ice and not some other substance," said Peter Smith, from the University of Arizona, who is the principal investigator on the Phoenix mission.

    "We have found the proof that we've been seeking."

    Chemical analysis of soil containing the white layer are still to be completed, but there is no doubt in the minds of Nasa scientists that they will further confirm the presence of water.

    The photographic evidence comes on top of observations made in 2002 by Nasa's Odyssey orbiter which suggested there was a strong chance that the polar regions of the planet contained significant quantities of water ice within 20 inches of the surface.

    Scientists will now begin asking whether the frozen water could have been liquid at some point in the planet's history, which would have created an environment in which life could have evolved.

    Channels and gullies seen on the Martian surface suggest the planet enjoyed a wetter past, but it is thought much of the water evaporated - while at the poles it was trapped beneath the surface in the form of ice.

    They will use the Phoenix's array of instruments and its 8ft robotic arm to study minerals and search for organic material in the soil.

    Experts believe that if life once exist on Mars, it could still survive today in isolated pockets beneath the soil. Bacteria on Earth have been found to be capable of thriving in even the most hostile of environments around volcanoes and in nuclear reactors.

    The presence of water ice on Mars will also make future missions to send humans to the planet easier.

    Nasa has plans to send astronauts to the planet after it has returned humans to the Moon in 2020, and hopes eventually to establish a permanent base on the Red Planet, but one of the major challenges is transporting the water needed for humans to survive.

    Water is heavy and expensive to carry into space, so officials hope astronauts will instead be able to harvest ice from beneath the planet's soil and then to purify it for drinking water. It would mean that the planet could sustain life in the future, even if it never has before.

    The Phoenix spacecraft landed on the Martian surface on May 25 for its three-month mission.

    Since touching down near the planet's north pole it has been analysing the atmosphere and the soil, taking pictures of the surface and digging a number of trenches.

    The chunks of bright white ice were exposed on June 15 but by June 19 they had begun to vaporise.

    "This tells us we've got water ice within reach of the arm, which means we can continue this investigation with the tools we brought with us," said Mark Lemmon of Texas A&M University.

    He added that the disappearing ice could not have been carbon-dioxide ice as at the temperatures on the surface, the material would have evaporated within hours rather than days.

    The fact it had evaporated at all disproved early theories that the layer was salt.

    Phoenix has hit a hard surface in another trench which is also believed to be an icy layer, and will also be tested.

    Professor John Zarnecki, director of the centre for Earth, planetary, space and astronomical research at Open University who is involved in a European mission to search for life on Mars due to launch in 2013, said the discovery was hugely exciting.

    He said: "All the evidence is piling up that there was at one point lots of water on Mars and there is still a lot locked up as ice.

    "There could very well be little niches just below the surface where the ice has melted to produce damp patches that would allow bacteria to hang on and grow in colonies.

    "We know from research here on Earth that life is far tougher than we previously thought – if it can thrive in hostile environment like nuclear reactors and acid rivers, then it could also be hanging on in pockets on Mars."

    Thursday, July 3, 2008

    Uploading Files with JSP

    By Nisansa Perera

    I was fed up with some of the resources available on the net to do this.

    This is how I got this done.

    1. Enable your html to upload files



    Please specify a file, or a set of files:








    2. Use commons file upload

    Then follow Apache commons file upload article to handle the file within your jsp. This is the code snippet to do that, extracted from commons file upload user guide.


    // Check that we have a file upload request
    boolean isMultipart = ServletFileUpload.isMultipartContent(request);

    // Create a factory for disk-based file items
    DiskFileItemFactory factory = new DiskFileItemFactory();

    // Set factory constraints
    factory.setSizeThreshold(yourMaxMemorySize);
    factory.setRepository(yourTempDirectory);

    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);

    // Set overall request size constraint
    upload.setSizeMax(yourMaxRequestSize);

    // Parse the request
    List /* FileItem */ items = upload.parseRequest(request);
    // Process the uploaded items
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
    FileItem item = (FileItem) iter.next();

    if (!item.isFormField()) {

    // Process a file upload
    if (writeToFile) {
    File uploadedFile = new File(...);
    item.write(uploadedFile);
    } else {
    InputStream uploadedStream = item.getInputStream();
    ...
    uploadedStream.close();
    }
    }
    }

    For more information on commons file upload, use the their user guide.
    References
    • http://www.cs.tut.fi/~jkorpela/forms/file.html
    • http://commons.apache.org/fileupload/using.html

    Wednesday, June 25, 2008

    The Future of Teragrid

    By Nisansa Perera

    Teragrid is a computing cyber infrastructure for scientific research at US, and it is the world's largest distributed cyber infrastructure for open scientific research. It has about 750 teraflops computation capability and 30 petabytes storage (roughly equivalent to 100000 desktops, considering quard core 2GHz, with 200 GB disks) distributed across number of partner sites (Including Indiana University's Bigred Cluster) connected by a 10G network.
    Currently lot of planning going on about future of TaraGrid and details can be found in http://teragridfuture.org. A one thing that interests me was series of position papers that discusses future possibilities, and suggestions. May be this is a nice usecase for new ideas like cloud computing (What ever it is !!) and virtualization.

    To add a side comment, a friend brought a new laptop (New Mac), and as we find out while doing a Gram performance on TeraGrid, the laptop is almost as twice as powerful as some TaraGrid headnodes (I am talking about a node, not the whole cluster). So much for powerful computers, and we can see the Moore's law really in action here. Actually these super computers have about 3-4 year lifetime, and by that time new machines comes with twice computing power and almost half-power consumption, their power need soon make them obsolete.