ES Holidays

DE Holidays

BR Holidays

Thursday, December 30, 2010

I want to read a image from webpage using socket..., plzz help me!!!...,?

here is the code.....,


/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package socket_application;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;

/**
*
* @author suresh
*/
public class Connect_API {

public static Socket s = null;
public static String bHost=null;
public static int port=0;
public static String bData=null;

public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the host name");
bHost = br.readLine();
System.out.println("Enter Port number");
String port1 = br.readLine();
port = Integer.parseInt(port1);
System.out.println("Enter Data");
bData = br.readLine();
connection((String)bHost, port);
setData(s, (String)bData,bHost);
getData(s);
close(s);
}

private static Socket connection(String bHost, Integer port) throws UnknownHostException, IOException {
StringBuffer str=new StringBuffer();
str.append(bHost);
s = new Socket(str.toString(), port);
if(s.isConnected())
{
System.out.println("Connected!!");
}
return s;
}

private static int getData(Socket s) {
// private void getData() {
int ret = 0;
byte[] buffer=null;
try {
//String text = "";
int bytes_read = 0;
InputStream from_server = s.getInputStream();
buffer = new byte[700000];
System.out.println("********************…
while ((bytes_read = from_server.read(buffer)) != -1) {
System.out.write(buffer, 0, bytes_read);
}
System.out.println("********************…
} catch (IOException e) {
System.out.println("" + e.getMessage());
ret = -1;
}
return ret;
}


private static void setData(Socket s, String bData,String bHost) {
try {
PrintWriter to_server = new PrintWriter((s.getOutputStream()), true);
String data=bData;
//blogs/big-optometry-blog/eiffel-tower-…
//http://blogimages.flashedcoder.com/images/mywallpaperz.com/101506100102.jpg
//www.opticianonline.net
StringBuffer str1=new StringBuffer();
data="GET /"+data+" HTTP/1.0\nConnection: close\nHost: "+bHost+"\n\n";
str1.append(data);

//to_server.print(str1.toString());
to_server.write(str1.toString());
to_server.flush();
//System.out.println(""+bData);
System.out.println("inside setdata method");
} catch (IOException e) {
System.out.println("" + e.getMessage());
}
}

private static void close(Socket s) throws IOException {
s.close();
System.out.println("Connection closed!!!");
}
}



my output is :
--------------------------------------…

Enter the host name
www.opticianonline.net
Enter Port number
80
Enter Data
blogs/big-optometry-blog/eiffel-tower-…
Connected!!
inside setdata method
*************************************
HTTP/1.1 200 OK
Date: Wed, 17 Mar 2010 07:39:46 GMT
Server: Apache/2.2.3 (Red Hat) mod_fastcgi/2.4.6 PHP/5.1.6 mod_perl/2.0.4 Perl/v5.8.8
Last-Modified: Thu, 20 Nov 2008 15:55:39 GMT
ETag: "274e45-16af2-f5c6d4c0"
Accept-Ranges: bytes
Content-Length: 92914
Connection: close
Content-Type: image/jpeg

����



how do i get the binary data of that image here so that i can make into a picture by copying that..,







Answer :
Assuming you are running your program from the command line, you can't display the image there because your command line interface (shell prompt) can't display images.

Just read the content as you would when you are reading a string, then save the content to a file. When you open the file with a program that can display images (web browser, ms paint, photoshop, etc), it should then come up as the image there.

Do you Believe in Fate?

My parents broke up before they married. During their 3 year break they didn't speak but reunited when they ran into each other atop the eiffel tower in Paris.... They say that it was fate that brought them together. What do you think? It can't be a coincidence it's too big.






Answer :
I used to believe in fate. I prayed for things, and they never came. Now I hate my life, I just want to find the right girl. That's asking for too much apparently.






Answer :
I believe everything happens for a reason and things can be extremely coincidental, but not sure I believe in fate. Although in your parents case it sounds like it.






Answer :
yes I believe in fate. Things may not work out in the moment but if its meant to be it will find its way.






Answer :
I absolutely believe in fate! That's an amazing story about how they reunited, and talk about romantic! I'm also a believer in karma and destiny and all of that sort of stuff.






Answer :
Fate? Karma? Destiny?

Who knows.

When people are happy about something, it's fate. When it's by pride, it's destiny. When it's bad, it's called Karma coming back to pay it's dues. When it's something out of control, it's wrong. When it's something you have waited for, it's right.

Was it meant to be, or not meant to be? That question is answered only in the end. You'll have to wait till the end to find out.

It's all up to the one calling it fate, destiny or otherwise.

Perhaps there is something out there in the realm of fortune. The only thing that lasts, is the one who lives through it.

Good for your parents. They had something wonderful happen. Don't ever forget that. Let it give you hope and inspiration for your own life, and what someday you will finally decide to believe. It's all up to you. It's your thoughts that matter.






Answer :
I was just talking about this at work today!!!! Read the news and this guy that was on vacation was on the beach headphones on and a glider type plane had to make an emergency landing on the same beach and struck him from behind killing him! I swear it was his time to die it was him picked out by higher powers!! ,What were the chances that this poor man was in the exact area,,,exact time,,etc...he was not even from that state! So many weird things happen to people and it cannot be a coincidence!!!!






Answer :
Not like that. I do think things happen for a reason, though. Sometimes it just takes a long time to see how it all fits together.






Answer :
I believe in fate, but I also beleive you have to act when the oppurunity knocks.......such as trying to get back with an ex etc......

It may be fate but you can also through a blip in that if you do something you are not suppose to or it may slow down that fateful meeting etc....

Is fashion a good reason to visit France?

I'm doing a project for school on the countries, and I have to have three good reasons to visit each country. I have the Eiffel Tower and food as my two other reasons, but I still need a third. Would fashion be a decent reason? Now, you should understand how the project works. My teacher wants us to pick the main tourist attractions, the ones the vast majority of tourists go to. If the tourists were split into three groups, these would be the attractions you would find all of them at, save for a few other people. Would fashion be a main attraction? And don't say that my teacher wouldn't want me to put fashion because it sounds like I care more about fashion that France. We're talking about the general population here. Everyone. I don't want an opinion either. I want facts only. I don't care if you would like to go to France to go shopping and all that, would the general population do that? Thank you, I hope you deserve it.






Answer :
I think many people outside of France are very curious to see French culture and people when they visit. Museums like the Louvre(the Mona Lisa is famously housed there), Montparnasse Cemetery, Arc de Triumph, hearing the language, seeing how people live there, conversing with locals, etc.

Shopping or fashion might entice many travelers but it would be very expensive and is limited to fashion enthusiasts.






Answer :
Around fashion week many people come for fashion. And shopping in Paris is really great. I am sure some people go to Paris just to go shopping, most people probably come for culture. But people who care about fashion also come to shop.






Answer :
OK. I understand what you are asking. You have to differentiate between France and Paris.

Many people from abroad are content just to go to Paris, at least for their first visit, because it is the capital and it is choc-a -bloc with historical and cultural sites. So even French people who live in the provinces will go there to get to see their own capital, and pick the same things as the majority of foreign tourists who come from all over the world. Paris itself is the world's most visited place.

Strictly, speaking food and fashion are not the objectives of most ordinary people who go to Paris though it may be a secondary interest. Those that go for fashion as a reason are usually in the fashion business and they want to see the new collections, but they are a minority. The majority of tourists really go to Paris for is the sights. I have escorted many groups and the most usual places they put on top of their agenda are the following, in no particular order:
The Eiffel Tower
The Louvre
Notre-Dame de Paris
The Sainte-Chapelle
Palais de Versailles
Cimetière du Père Lachaise
Musée d' Orsay
The catacombs
Pompidou centre
The Arc de Triomphe and the Champs-Elysées
All this is because they have heard of them as "must sees".
Many opt for a cruise of some sort on the Seine or a tourist bus that drives round Paris so that they can see the most important buildings from the exterior.

They are quite happy to eat a sandwich or a salad at lunch time, and to go to a restaurant that is within their budget in the evening, but the food is only a secondary consideration.

Women who have heard about Parisian style go shopping for clothes, but only in moderation because prices are very high , and often they combine this with sight seeing. Few people will travel exclusively to Paris to buy clothes unless they are extremely rich, or they are fashion buyers for famed outlets abroad.

Restaurants in Paris range from brilliant and extremely expensive to ordinary bistros where the local population goes at lunch time and where standard but not gourmet dishes are served. Many Americans and English people often are not all that keen on elaborate cuisine and flock to the Mc Donald's for instance. Foreigners are curious about the food but do not make it the specific purpose of their visit, unless they are gourmets or foodies, and, again, have money to spend.

When it comes to the rest of France people go for the global experience: a specific region where there are different attractions, depending on their personal interests: medieval towns, cathedrals, castles, prehistoric sites, dolmens, menhirs, caves, abbeys, etc.. or a mixture of these things. They do look at shops but do not go specially for fashion there and are more interested by local made things: artifacts, hand made goods, perfume, etc.. or they may buy the local food specialities like cheese, biscuits, foie gras, etc..
Some regions specialise in specific dishes which are served more than others in that particular region, like bouillabaisse in Provence, buckwheat Crèpes in Brittany, choucroute in Alsace, beef stew in Burgundy etc.. but people would not go to that region just for the food.

What you must also realise is that many people visit France and only go to a specific region, like the Americans would go to the Grand Canyon or a national park and are not particularly drawn by food or fashion.

Many tourists go there just for a specific purpose like a sport: skiing , mountaineering, sailing , paragliding, walking, etc...Some go for a pilgrimage to a shrine, or walk the length of France to go to Compostella in Spain as a challenge, or simply travel to spend time on a beach and "have a good time" (which you think is the reason why a boy got a poor grade for talking about , but which is the truth). Many Americans for instance are not in the least interested by Paris or the main cities in other areas, and simply go to the French Riviera ( Nice , Cannes etc...) because they are fashionable sea side resorts, and many celebrities patronise the area, have their yacht there and go there to meet people of their kind and be seen...Others go to the Atlantic beaches because of the miles of sand and the surfing.
What I am trying to say is that there are hundreds of reasons why people choose France as a holiday destination and for Northern Europeans it may even only be the temperature or the climate!
However if what you want is concentration and the options chosen by the majority of tourists then go for the main sites in Paris that are heaving with visitors all year round.

PS. After laboriously writing all this, I had a second thought and looked on the net.
If what you want is exact statictics, here you go:
http://www.francethisway.com/places/top-…

Since several amusement parks figure in the top visited attractions, this makes my point about what are the reasons behind people's motivations.






Answer :
Well, we know who will wear the pants in your family. haha a fashion joke! And the truth. You seem to know the answer to your own question and it is your homework so go with your heart.

Thursday, December 23, 2010

HERE'S A RIDDLE IF U CAN SOLVE?

question:caN a KaNgaroo JUMP higher Than The Eiffel Tower????

anSwer- yeSS..

coz THE Eiffel Tower CAn'T juMP...

caN AnyBody tELL hoW?






Answer :
UHHHHHHHHH.............................. ITS A BUILDING AND BUILDINGS CANT JUMP AND KANGAROOS ARE ANIMALS SO THE KANGAROOS CAN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!…






Answer :
this is one of the popular "trick questions", meaning that the question puts the person asked on a different trail than the trail that leads to the answer, formally speaking. :p
the question that the person asked is intended to interpret is whether a kangaroo can jump OVER the Eiffel Tower. the real question, on the other hand, is whether the kangaroo can jump higher THAN the Eiffel Tower. So for example: the kangaroo jumps 2 meters high. can the Eiffel Tower beat the kangaroo???

taadaa! i love the joke!!






Answer :
Ha ha. This would have been an amusing post if you hadn't ruined it with all those annoying, improper, hard to read capital letters.






Answer :
You have yet to learn how to spell I am a spelling Nazi....Now the capitals were unnecessary and in case you have not noticed there is a spell checker!

Thursday, December 16, 2010

Prices of Paris attractions?

I want to prepare a budget for visiting Paris, but most of the web sites don't have much price info.
I need info for the following:

Cathedral of Notre Dame
The Eiffel Tower (top)
Arc de Triomphe
Versailles
Louvre
Fragonard Perfume Museum
Basilica de Sacre Coeur






Answer :
Actually, all of the websites have the prices on them, and in English too. The only exceptions are the two churches.

Notre Dame - no fee, unless you want a guided tour, then it's 6 € - http://notre-dame-de-paris.monuments-nat…

Eiffel Tower - 3rd deck - 13.00 € for an adult - It is on the website at http://www.tour-eiffel.fr/teiffel/uk/pra… - can book tickets online in advance

Arc de Triomphe - 9 € for an adult - On the website at http://arc-de-triomphe.monuments-nationa…

Versailles - 18 € for standard admission, but there are different things to choose from. Take a look at the different options on the website at http://en.chateauversailles.fr/prepare-m… - can book tickets online in advance

Louvre - 9.5 € is the standard rate, but check the website for all the options - http://www.louvre.fr/llv/pratique/tarifs…

Fragonard Perfume Museum - website says "free guided tour" - http://www.fragonard.com/parfums_grasse/…

Basilica de Sacre Coeur - "Free admission to basilica; dome and crypt €5" - details at http://www.sacred-destinations.com/franc…

Thursday, December 9, 2010

Anybody just need out?

I do. And by 'out' I mean away. I'm sitting here on the couch in my living room, a place I've been so many times, all alone. Such a familiar place, and it depresses me to think that in all the places I could be right now, it's here. In this same place.

I was bored, so I went on facebook, and looked through some of my sibling's pictures of their recent adventure in the Dominican. It wasn't the first time I saw them. It makes me angry to look at them, but it also gives me a sense of excitement. Pictures of them all in crystal clear blue waters, pictures of them 4-wheeling through some of the most beautiful places I've ever seen. Pictures of them at their resort getting dresses up going out for dinner. I want to do that someday. But, in my eyes, that's nothing!

I want to see the wonders of the world, I want to walk the most deserted places in all the Earth, I want to visit such landmarks like the Taj Mahal, the Eiffel Tower, Rio de Jeneiro, Sydney Opera House, the Grand Canyon. I want to go bunjee jumping in New Zealand, see a baobob tree in Madagascar, look at Mt. Everest, walk through Times Square, ride a gondola through Venice, step foot on the deserts in Jordan. EVERYTHING. I'm only thirteen and still have a lot of life to live. But I'm hoping that I can do some of these things in this life because I feel like my life wouldn't be complete if I didn't travel. It is my passion and I know that for a fact.

All my life, since I knew that these things existed, I've wanted to experience them so badly, I can hardly describe it. I flew on an airplane for the first time a couple years ago, and honestly, it's one of my favorite things ever. I can't wait to go on a plane again. Just looking down at the Earth and trying to imagine how big it really is. Just seeing planes land and take off excite me.

There's a television show on OLN called Departures. My brother discovered it and got me hooked on it. It's about two Canadian guys who decide to drop everything, and just travel the world. I don't know how they did it, where the got the money or anything, but they did. They took a year and just traveled. I wish it was that simple.

If I was capable (and allowed of course), I would jump on a plane right now and go...anywhere. I wouldn't think twice, because I've wanted to travel for all my life. And it's frustrating because the only thing holding me back from that, is something as simple as a piece of paper. Money.

I've always dreamed of growing up, getting married, having kids, being successful in a job. I have no idea what that job is yet, and I have lots of time to figure it out, but I need to travel. I don't understand how anyone could not enjoy it.

I mean, I love my life now, I love my family, friends, my home, my community, my country! But I think sometime in my life I'm going to need to say goodbye to these things for a little while. It'll be hard, but it'll be worth it.

I don't even know what I'm trying to say. This isn't even a question, I'm just going on about my future, my passion, my dreams. All i know is, I just got bitten. I got bitten by the travel bug.






Answer :
Sounds fine.
Until you can start doing this for real, you could collect foreign postcards, currencies, souvenirs.
I think there are postcard-exchange clubs you can join where you promise to mail one to somebody in a foreign country if they mail you one. That should give you some inspirational wallpaper.
Maybe there is some Young Travelers club you could join?

Sites like couchsurfing.com are good for finding hosts to stay with.

Why not also write/email OLN Departures hosts and ask them for suggestions?

If you feel you want to do this for a living, not just wanderlust, you might start thinking of careers like travel journalist, snowboard instructor, wine sommelier, tour guide, resort rep, wandering bouzouki player...
Maybe you could get some small travel article published in some local newspaper.
Did you know that travel guides like Let's Go Guide hire lots of student researchers and fact-checkers every year - the pay sucks but you get to do what you enjoy.

IT Holidays

USA Holidays

JP Holidays

UK Holidays