Look up the InetAddress class:
http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html
There should be a method in there that suits your needs.
Look up the InetAddress class:
http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html
There should be a method in there that suits your needs.
You'll have to do something with the dataflavor of the tranferable.
Take a look at this tutorial, it will do a much better job than I'm doing:
I'm not completely sure you can do this, but if you can, an extra class that extends Thread should work:
Have the normal class make the calls to the thread class:
public class b
{
public b()
{
new ThreadClass(socket,2001);
new ThreadClass(socket,2002);
}
}
public class ThreadClass extends Thread
{
public ThreadClass(Socket socket, int port)
{
//do some crap
}
}
You have to set your environment variables:
Considering you have windows:
Goto start--->right click on my computer--->select properties
Goto the advanced tab, and you should see a button at the bottom that says environment variables...click on that.
The only thing you need to worry about is the PATH variable, and the CLASSPATH variable, nothing else.
SKIP THIS STEP AND GO ON TO THE CLASSPATH, IF IT DOESN'T WORK AFTER SETTING THE CLASSPATH, THEN COME BACK AND SET THIS.
The path variable must point to the bin folder in the sun app server, and the bin folder in the jdk directory. Now, those are two different directories, so you seperate them with a semicolon when creating it. Here is what mine looks like:
C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0\bin
Classpath....This points to the tools.jar file in the jdk directory. It's pretty easy to find. Here is what mine looks like:
.;%classpath%.;C\Program Files\Java\jdk1.5.0\lib\tools.jar
Your's will look similar, although you do not need the .;%classpath%.; statement.
Next, you need to know how to access your files at the command line.
To do so, you simply type cd/folderName at the command line. The cd stands for current directory. My folder was named javawork, so to access it, I did this at the command prompt:
cd/javawork // brings me to the right directory
javac Hello.java //compiles my program
java Hello //runs my program
Let me know if …
Since it involves nodes, then you could probably use a binary search tree. If you know how the algorithm works and everything you might not have too many problems, but this program will still be very tuff.
If I had further advice/code snippets/suggestions I would give them to you, but I don't.
In the meantime, here's a few links that might help:
Really cool scrabble:
http://javaboutique.internet.com/scrabblegame/
Similar problem:
http://forum.java.sun.com/thread.jspa?forumID=426&threadID=316951
Is it really possible to tell wether the sun revolves around the earth, or the earth around the sun? I never knew this fact about the earth being portrayed as the center of the universe. Kind of a cool fact.
Since WW1, some nations have split off and some called themselves communist, and some socialist. In some sense, I guess you could say there is no communist nation, which is logical, but socialism is considered to be the stage between capitilism and the communist goal...This is were you find dictators and such. Like I said earlier, there is NO nation that is TOTALY communist, only a percentage.
If you are new to java, netbeans will only hold you back. Try using a less advanced, lessdecorated, and less stiff IDE like JCreator or eclipse, so you have control over the language instead of the IDE. Just my opinion but it is what i was told when i first started programming and i'm sure many experienced programmers agree that the bells and whistles make learning java alot more complex than it needs to be.
I agree, but a new java programmer should start out with the command line and text editor. I feel that is an important learning experience, altough in the beginning it really sucks.
The nations you list might proclaim themselves to be communist but they are in reality socialist nations. Marx, for all his failings, taught of stages in the progression to communism, and he got that bit right ;) It's just communism itself that can't be achieved.
I think
Communist natios are classified, in a sense, as socialogical. What you said about them progressing is correct. None of those nations are fully communist, but are still considered to be communist...At least by most!
I found this site that gives the percentage each of those are toward communist, although I can't say how much is true.
http://www.adherents.com/largecom/com_communist.html
But this is all straying from the topic, you're getting all heated and upset, and I'm not interested in 'proving a point'.
How do you expect someone to reply to another person that commented and said everything you posted is completely wrong? I'm just letting you know were I came from. Don't you want an explanation?
I've read and studied, 'Communist manifesto' and all three volumes of 'Das Kapital'.
I respect anyone that can read half a volume of Das Kapital. Altough someone with such knowledge should question others, rather than telling them what they said is completely wrong.
And the 'crappy little poem' is one of the greatest songs of the greatest of all American folk singers! Woody Guthrie was a true minstrel in every sense of the word, and one of the 'fathers' of contemporary music!
Were is the relevance?
There is no such thing as a communist nation and there never has been. Communism exists only in theory, and the principles upon which it is based pretty much 'mirror' the teachings and philosophy of Christ. The nations referred to as 'communist' are really Socialist nations.
Communism doesn't teach that religion should be cast aside. Onlt politicians who have called themselves Communists have taught that, in much the same way as politicians who call themselves 'Christians' teach hatred, intolerance and greed.
Communist exists only in theory? Are the nations that follow these so called non existent teachings thoery? Last time I checked, China and those other nations were real.
Karl Marx never said the religion was 'the root of evil', he described religion as 'the opiate of the masses'. He was condemning the way religion is used as an excuse to keep people ignorant of their condition in this world!
I said it was something along that line, not exactly. He said that religion should be done away with all together(I know since I have read the book..Have you?)
You said: "He was condemning the way religion is used as an excuse to keep people ignorant of their condition in this world!"
Now, that comment is a thinly disguised expression of intolerance to other peoples beliefs.
Again, I just have to say that I love how you pull out these little dinky poems to TRY to prove your point. You've done nothing of the such.
There is no such thing as a communist nation and there never has been. Communism exists only in theory, and the principles upon which it is based pretty much 'mirror' the teachings and philosophy of Christ. The nations referred to as 'communist' are really Socialist nations.
:cheesy: List of commnist nations:
China
North Korea
Vietnam
Cuba
And you said I was speaking nonsense? Maybe they don't teach you much in that desert wasteland?
Dude, much of that is wrong on so many levels that it boggles the mind!
Do you read much, or do you sit around and think these little crappy poems you dig up give you knowledge for everything? Have you read Carl Marx' "Comunist Manifesto"?
Let's not get into a debate about P2P please. That is NOT the topic raised. I limited it to people's right to make legitimate backup copies.
All I said was what I thought was more harmful to these companys. Sorry if I destroyed your topic.
I believe all good nations have a religous foundation, and I don't care what other people say. The reason the United States is in Jeopardy is because it's morals(set by religion) are under attack. Regardless of wether your a believer or not, religion(specifically christian) creates good morals.
Now, there is some that believe in the communist views. I believe it was in Carl Marx's "The communist manifesto" that he said, religion is the root of all evils in a nation(something along that line). Hitler took that piece of information, got religion out of government, and was left with Germany being the higher power. When there's nothing higher than the country, then you have problems...Just like what arised in Germany. The US constitution is based on there being a higher power than the nation, and this keeps the goverment under control.
About theorys, almost everything is a theory. Take math for instance, does it really exist? I mean, surely someone came up with it.
please do NOT send it. Clearly they want it for homework.
Whilst I do not support piracy, I really believe that people should have the right to make working copies of the fragile CD and DVD discs they spend hard-earned money on. but it seems that our ability to do so is seriously under threat.
The oldest of the DVD copying tools, DVD Decrypter, has now been taken down from the internet. The product's website has been handed over to the )unnamed) company who won the legal battle with threats, and mirror sites are being contacted and instructed to remove it also.
http://www.cdfreaks.com/news/11914
What's next? Other similar tools have also been withdrawn recently, and it's going to take a company with pretty persuasive and expensive legal backup to stop the onslaught.
That's stupid. I didn't know DVD decrypter actually copied the dvds; I thought it just decrypted them for further processing! I do have a copy of it, so I guess I better hang on to it. I guess it's like the DVD X Copy, which could copy a dvd to a SINGLE cd-r, but costed 100$. I think that got taken off the market also. This will probably cause more trouble than keeping the tools out there.
By the way, how could someone prove that it's causing their business harm? I mean, I would think that videos being shared on P2P is more harmfull than DD.
Sorry, Data is actually the transferable.
Here's the signature for the method:
setContents(Transferable contents, ClipboardOwner owner)
Note Java is case sensitive. in every terms.
What about hexidecimal literals? :)
Southern Spain for 2 weeks of R&R.
Sounds kind of fun...What is R&R?
Oh, you got the names almost right except it's Kathy (with a K, not a C).
hehe, I was reciting from memory.:)
What worries me:
- Government taking 72 percent of the economy in taxes (when you consider that customers pay all business taxes in raised purchase prices). This will eventually collapse our economy.
- Too much government meddling in daily lives.
- Liberals turning political correctness and environmentalism into state religions.
- Stress (which is the main cause of obesity, and which is mainly caused by government)
- Overkill security.
- Daylight Saving Time (which causes stress and wastes gasoline)
- Inability to buy computers without multitasking opperating systems.
- Everything in our lives going digital, causing gross incompatibilities with older materials.
- The Microsoft monopoly.
What does not worry me:
- Global warming (they don't even have any hard proof yet)
- The war in Iraq.
- All kinds of warnings that this or that "might" be harmful.
- Terrorists.
- People flying planes over Washington.
- Anything to do with sports.
I couldn't agree more.
Why would you post something like this?
This is the title for this forum:
Geek's Lounge: A random forum for chat about anything. Off-topic hang out for geeks. Have fun and relax in this forum.
Now, my question is, why would you post a stupid question like that?
look on amazon for cathy sierra and bert bates(think i got those names right) java certification book. BEST book I ever bought. It covers a lot of crap you don't get from most books. I've had it for a long time and still haven't got through the whole thing.
Personally, I would'nt use all those classes. You could use one class and it still be just as efficent. Plus, I would use buttons and set the label of the button to either x or o, which will make it much easier to tell wether someone has won or not.
Data is the string. Remember, this was for my text editor. I believe you can put any object in as the data.
Right, sort of like this...Correct?
if (t != null)
{
continue run method;
}
I got the one by bates and sierra...By the way, where have you been wenting?
This is my last post on this forum
Until I post another.
The AI involved will be extremely difficult. I wouldn't even know where to start.
Did you follow the link I posted?
I did this once in my text editor. It was for text, but the code my help out a little:
imported statements for transerfable:
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.Toolkit;
get an instance of the system clipboard
Clipboard clipboard = getToolkit().getSystemClipboard();
Some method required for the interface:
/*
* Empty implementation of the ClipboardOwner interface.
*/
public void lostOwnership( Clipboard aClipboard, Transferable aContents) {
//do nothing
}
set the contents of the clipboard
clipboard.setContents(data, this);
Paste something from the clipboard
int lastPosition = textArea2.getSelectionEnd();
/* get the contents of the clipboard
*/
Transferable clipData = clipboard.getContents(this);
/* try to paste it where the cursor is
*/
String s;
if (clipData != null)
{
try {
s = (String)(clipData.getTransferData(DataFlavor.stringFlavor));
}
catch (Exception e) {
s = e.toString();
}
Note: Don't forget to implement the ClipboardOwner interface
Also, the code should almost be exactly the same except for a few details.
Sorry, I really can't help much. I've never done this so I don't know much about it. I did a search through the java.sun.com forums and came up with this:
Check that out and see if you can find anythig
congrats! that's a big accomplishment. what competition did you take part in (whats the website name).
anyway, the website is: http://www.transcender.com .
It was for FBLA(Future Business Leaders of America).. There were more events but I participated in the java...Here's the link, you'll have to click near the top were it says something about the winners, and then scroll down to see my name.
That would be much easier, but I don't know of any starter programs like that. I'll search around and see what I can find.
It's against forum policy to do peoples homework for them. If you show a little effort we can help.
You can use email spoofing from the command line, although you can easily tell they are fake by looking at the header info. Then most ISP disallow such action.
A minute later, in full view, a killer whale ate them both.
:lol: :lol: :lol: :lol:
I like that one.
I'm going somewhere right now, but I'll get back to you on the questions a little later...Hope you don't mind.
I think the method in pixel grabber is .grabPixels()
I won the state championship for java programming about 2 or 3 months ago. I'll be flying to orlando for the nationals in about 3 weeks, and need to practice. The reason I said cert questions my not help is that the questions there will be more based on arrays, swing, awt, and that kind of stuff. Go ahead and post the site for the cert questions, maybe it will help..
What about these?
public static void setEastBorderColor(Color c)
{
lEast.setBackground(c);
}
public static void setWestBorderColor(Color c)
{
lWest.setBackground(c);
}
public static void setSouthBorderColor(Color c)
{
lSouth.setBackground(c);
}
public static void setCenterBorderColor(Color c)
{
lCenter.setBackground(c);
}
Does anyone have a few good sites that give you some practice java questions? I'm not tallking about java certification questions, just regular old java questions about the language. I need a lot of them, so please post as many sites as you can.
Your trying to reach non-static contents from a static method. You can't do that. Either make your method public, or you'll need to create an instance of what your trying to get. I would just declare it public.
First of all, you should have some of that in a try-catch clause. That could help you out in figuring out the error. Then, since your using sql, make sure the URL passed to the DriverManager is correct, and make sure the parameters for the html page are correct.
Basicly there's three steps:
> 1. convert the two images to an array of integer.
> 2. compare the two arrays.
> 3. then decide if they're a similar or not.
You convert the two images into an array by creating a PixelGrabber, and then getting the pixels. You can also store colors and compare to make it more accurate.
Now, you can try just comparing Image Objects, but I don't know how accurate that would be:
Image one = new Image(...);
Image two = new Image(...);
if(one.equals(two)){
//... true
}
else{
//false
}
I've never really done this, so I don't know how either approach will work out.
Yes, it's very possible.
You'll need to create a BufferedImage out of the graphics. Take a look at this link, it describes it better than I can.
I haven't coded in C#, but I know it's catching on pretty fast. I have done some VB.NET and liked the feel of it.
server_crash, thank you so much for your help.
No problem. Your very hard working, and I don't mind helping out such a person. By the way, how did you do on your finals?