Forum: Java Nov 29th, 2006 |
| Replies: 7 Views: 5,569 All of those do not give the public IP address, except the fourth one (http://forum.java.sun.com/thread.jspa?forumID=31&threadID=639572). However, the way suggested is just what I had thought of and... |
Forum: Java Nov 27th, 2006 |
| Replies: 7 Views: 5,569 Well, I have tried using that, and unless there is something I'm missing, that only gives addresses such as 192.168.1.100 when used with getLocalHost().getHostAddress();. I was looking for the... |
Forum: Java Nov 26th, 2006 |
| Replies: 7 Views: 5,569 Ah, well, that won't really work in Java by itself, but, for those who care, this works (by utilizing a website like the one above):
try {
Socket sock = new Socket("www.edpsciences.org", 80);... |
Forum: Java Nov 26th, 2006 |
| Replies: 7 Views: 5,569 Hello, I was just wondering if it is possible in Java to get the host's IP address, as seen on the Internet, not network or by the computer itself. I mean, getting something like 87.253.145.35... |
Forum: Linux Servers and Apache Oct 25th, 2006 |
| Replies: 2 Views: 2,558 Well, if that is so, then my IP address has been blocked every time it's changed. It hasn't remained the same since this problem began.
Also, a DNS lookup for www.ilikerps.net works, even though... |
Forum: Linux Servers and Apache Oct 24th, 2006 |
| Replies: 2 Views: 2,558 Hello. I have been having trouble with my Apache server (or perhaps something else, like DNS) for a while now. I have tried to find a solution, but my keywords always come up with almost completely... |
Forum: Java May 8th, 2006 |
| Replies: 1 Views: 929 Okay, I am sorry for posting in the first place, but I found a solution. Using FileOutputStream and FileInputStream, the individual bytes are copied and the files are the exact same. |
Forum: Java May 8th, 2006 |
| Replies: 1 Views: 929 Hello, I am trying to write a simple updater program (in Java). A client would connect to the server, which would hand out any files it needs updated. One example would be updating a Java .class... |
Forum: Java Feb 22nd, 2006 |
| Replies: 8 Views: 2,664 Thanks, the package thing did finally get it to work. Well, at first it didn't until I put the files into a folder with the same name as the package. |
Forum: Java Feb 22nd, 2006 |
| Replies: 8 Views: 2,664 I made my classes into a jar file. The folder it now is in is C:\jarme\
and the jar filename is
myjar.jar
I tried something to the effect of:
set cp=C:\jarme\myjar.jar;C:\jarme\
java -cp %cp%... |
Forum: Java Feb 22nd, 2006 |
| Replies: 8 Views: 2,664 Yes, I actually typed <location here>. No, just kidding; I am not quite that dumb. Its just that the folder was in my documents, which has some personal information in the name. |
Forum: Java Feb 21st, 2006 |
| Replies: 8 Views: 2,664 Hmm.... I don't need any jar files for this program, so I just used:
set cp = "<location here>"
java -cp %cp% TEditor
but I got the same error as before. |
Forum: Java Feb 21st, 2006 |
| Replies: 8 Views: 2,664 Hello, I know this question is stupid, but I cannot find an exact answer to it.
I am using Eclipse, and have written some classes to be used as a small database editor for XML. It compiles and runs... |
Forum: C++ Jan 30th, 2006 |
| Replies: 7 Views: 1,634 Sorry, I guess I wasn't thinking when I wrote 'null pointer.'
Is it possible that either the "getline(ifstream, string)" method returns a null character at the end or "string.c_str()" does? Then it... |
Forum: C++ Jan 28th, 2006 |
| Replies: 7 Views: 1,634 K, figured it out. The first line was sending a blank line. This caused the error because there weren't enough characters. So I just told it to ignore the first line, and it is working fine.
But, I... |
Forum: C++ Jan 28th, 2006 |
| Replies: 7 Views: 1,634 Well, the statement
buffer[sr] = '\0'
seems to say that sr is the final character. The buffer is sent 1 line at a time, so there shouldn't be just 1 character in the buffer, because there is no... |
Forum: C++ Jan 28th, 2006 |
| Replies: 7 Views: 1,634 The error still occurs:
sr = recv(acc, buffer, sizeof(buffer)-1, 0);
cout << "sr = " << sr << "\n";
buffer[sr] = '\0';
buffStr = buffer;
outfile << buffStr.substr(9,buffStr.size()-1) << "\n";... |
Forum: C++ Jan 28th, 2006 |
| Replies: 7 Views: 1,634 Hello, I am trying to move data from a client to a server, and save it in a file. However, I am getting a "Runtime Error!" when I use the substr() function, here:
char buffer[256];
int sr =... |
Forum: C Jan 27th, 2006 |
| Replies: 6 Views: 1,690 Yes, I thought I could. I also thought that since that was so obvious, there might have been some exception.... I guess not. And I'd prefer just using c_str() than mutating a string, although I don't... |
Forum: C Jan 27th, 2006 |
| Replies: 6 Views: 1,690 Salem, I need to send the buffer through a socket, and that is what I had already used. I suppose it may not be neccessay.
Ancient Dragon, I had tried simply accessing it that way, but for some... |
Forum: C Jan 26th, 2006 |
| Replies: 6 Views: 1,690 Gah, sorry, just realized a solution;
string temp = ch;
strcpy(sendBuffer, temp.c_str());
Sorry for posting :( |
Forum: C Jan 26th, 2006 |
| Replies: 6 Views: 1,690 Hello, I know this is probably a very elementary answer, but how does one convert a character into a character pointer, for use strcpy()? For instance, I need this:
char sendBuffer[5];
char ch;... |
Forum: C++ Jan 25th, 2006 |
| Replies: 2 Views: 1,457 Gah! Why does that work and why are my problems always so simple and stupid?
No, that was a rhetorical question. Thanks for the help. |
Forum: C++ Jan 25th, 2006 |
| Replies: 2 Views: 1,457 Hello, I am working on a server program that deals with opening files, or at least that is all that is relevant for this post. I am using VC++.
I use multithreading so that it can be multi-client,... |
Forum: C++ Jan 20th, 2006 |
| Replies: 3 Views: 7,187 Hmm.... I tried this:
m_ChatText = "Hello!";
MessageBox(m_ChatText);
m_ChatText += char(13) + char(10);
MessageBox(m_ChatText);
m_ChatText += "How are you?";
... |
Forum: C++ Jan 19th, 2006 |
| Replies: 8 Views: 2,856 Oh! I apolgize for my stupidity. I hadn't known it could be type-casted. I have almost never found type-casting to be useful, because when I need it, there is no type cast conversion avaliable for... |
Forum: C++ Jan 18th, 2006 |
| Replies: 3 Views: 7,187 I have an edit box, with its settings as "multiline", "want return", and "vertical scroll."
All I want to do is to have new lines between each output line. However, I have tried "\n", which did not... |
Forum: C++ Jan 18th, 2006 |
| Replies: 8 Views: 2,856 Thank you, that works :)
However, I need it to be able to use some variables in the class that creates the thread. You mentioned something about using "this", but I don't know if I should put that... |
Forum: C++ Jan 18th, 2006 |
| Replies: 8 Views: 2,856 Er, could someone possible provide a simple example (it would be best if you could do one that might be similar to the setting I described) in which the function CreateThread is used? The one at... |
Forum: C++ Jan 18th, 2006 |
| Replies: 8 Views: 2,856 Ah, that makes sense now; my server had it as a global class. CreateProcess() has so many parameters. Well, better start learning now; maybe I'll get through them by the end of the month. :P |
Forum: C++ Jan 18th, 2006 |
| Replies: 8 Views: 2,856 Hello. I am trying to convert my chat client from a C++ program that runs in DOS into one that runs in a Windows Dialog. I am using Visual C++. However, I am already getting a second error (please... |
Forum: C++ Jan 18th, 2006 |
| Replies: 5 Views: 1,221 No, I meant that before I had been reading a Java book, to learn Java. I can understand the confusion. Reading a Java book and doing a C++ project. Well, it may not be the wisest idea but at least I... |
Forum: C++ Jan 17th, 2006 |
| Replies: 5 Views: 1,221 Hmm... that worked. I thought when I had had that there before, it had said "std is not a namespace". Strange. Thanks!
I suppose that would also work, Dragon. I am reading a Java book, and I guess... |
Forum: C++ Jan 17th, 2006 |
| Replies: 5 Views: 1,221 Hello. I am trying to convert my chat client from a C++ program that runs in DOS into one that runs in a Windows Dialog. I am using Visual C++. However, I am already getting a strange error:... |
Forum: C++ Dec 8th, 2005 |
| Replies: 3 Views: 4,208 Of course. I hadn't seen that in the cplusplus.com reference for cstring. In fact, cplusplus.com has apparently no documentation for substr at all.... Ah well, thanks for the function. |
Forum: C++ Dec 8th, 2005 |
| Replies: 3 Views: 4,208 Hello, I just have a question about how to find a substring when one has only a string and coordinates for where the data will be? For instance, a string "why,hello", and data that is at the... |
Forum: C Dec 7th, 2005 |
| Replies: 9 Views: 2,368 Oh! Nevermind, I fixed my error. Perniciosus, you were correct. I had been so focused upon the "strlen(changingString) + 1" part that I forgot about the strcpy. Now it works. Sorry for the three... |
Forum: C Dec 7th, 2005 |
| Replies: 9 Views: 2,368 Neither of these work.... The latter makes the text very weird (some weird character, a black smiley face, and an 8, rather than the text "hello") and the former has the same result as what... |
Forum: C Dec 7th, 2005 |
| Replies: 9 Views: 2,368 Thanks for that information, perniciosus. I will try that as soon as I can get a compiler handy :P |
Forum: C Dec 7th, 2005 |
| Replies: 9 Views: 2,368 Sorry, the example I gave must have been incorrect; I hadn't tested it. The thing that is wrong with my example is that changingString is an array rather than a character pointer. This is more... |