Rob Spoor

+ Follow
since Oct 27, 2005
Rob likes ...
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
Forum Moderator
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads

Recent posts by Rob Spoor

Mandar Khire wrote:

args is empty, so args.length - 1 is -1. You may want to put the copying in an if-else block - if args.length is 0, just use args, otherwise use your copying.
1 day ago
To answer your question directly: no, you can't use Arrays.binarySearch, but you can use Collections.binarySearch. Arrays is only for (duh) arrays, Collections is for Lists etc.
5 days ago
You're welcome.
5 days ago
If you want to replace one character with another, why not use string.replace(delimiterChar, '|')? Or, to replace one string literal with another, use the other replace method. replaceAll is overkill if you don't have a regular expression.
1 week ago

Khuzema Dharwala wrote:

So apparently the unmarshal method doesn't directly return the object, but instead JAXBElement wrapping the object. Cast to JAXBElement<EventMessageType> instead, then retrieve its value.

To get rid of the unchecked cast warning you'll get, you can also use a StreamResource to get a more type-safe way:
1 week ago
Apart from why you would want to combine PHP and Tomcat, the problem appears to a be a missing .dll (Windows) or .so (Linux) file. The UnsatisfiedLinkError indicates that the library with some native implementation can't be found.
1 week ago
Thanks for sharing the solution
1 week ago
Well, they're just maven dependencies, right? So just add them to your pom.xml file.
1 week ago
Not sure. It's the process' output stream, but you read from it using the getInputStream method...
1 week ago
No, /bin and /usr/bin are definitely not the correct place for non-managed programs. You can use /usr/local/bin, but I think /opt is used a lot more these days.

An interesting read:
1 week ago
I think I see the problem. You have a function that has the same name as a local variable. Try renaming one of the two.
1 week ago

brian watkins wrote:        join_member1 = loners (member1,loners)
        join_member2 = loners (member2,loners)

loners is a list, so to access a single element or a slice you need to use [ and ], not ( and ). So what are you trying to do here?
1 week ago
That article needs an update though. If you use ProcessBuilder and redirectErrorStream(true), you only need to read from one stream, and you no longer need to go multi-threaded. I often do the following:
* Redirect the error stream.
* Start the process.
* While there is data from the output stream, read it.
* Call process.waitFor().

At the last step all of the process' output has been read, so I probably could just as well call exitValue().
1 week ago