This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

Frank Hanner

+ Follow
since Jan 11, 2013
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
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Frank Hanner

Jorge Vazquez wrote:I've been doing some exercises from codingbat, and I haven't figure out a way to solve this particular problem; may be someone could point me how to approach this. Thanks

Do you see a pattern at all?

It's divided into n sections. Inside each section is n numbers (n*n). Each section is essentially counting down. With each section progression the number of zeros decreases by 1 and the appropriate number for the count down is inserted. If that get you thinking about it the right way, I'll show you some example code that might help.
6 years ago

Richard Tookey wrote:

Frank Hanner wrote:When I invoke the .bat and an error occurs somewhere within the .bat script, my Java program hangs even though the .bat process is finish

This is most likely the classic deadlock caused by not handling the process 'stderr' stream. You should study the 4 sections of and implement ALL the recommendations. Failure to do so will likely to result in you pulling your hair out by the roots.

That's what I was beginning to realize, too.

Why does this happen? It doesn't really make any sense to me. It makes me a little bitter towards Java.
6 years ago

Henry Wong wrote:

Perhaps it would be a good idea to worry about the error? What is the Exception / Error that is returned? When you get the output / error stream, what are the values that you get back? Etc.


Isn't that catch statement only executed if the Process has a problem creating? If I put an output statement in the catch clause, nothing ever gets outputted; thus, there isn't an issue with the actual creation of the Process. I'll put in code that retrieves the output/error stream and report back.

6 years ago
Hey guys,

I'm developing a GUI, and when a certain button is pushed, a .bat file is invoked that performs several commands that manipulate a directory (copy, move, etc). When I invoke the .bat and an error occurs somewhere within the .bat script, my Java program hangs even though the .bat process is finish. But when I invoke the .bat file and no errors occur from within the script, all is dandy and my Java program carries on. Nothing in the my Java program relies on the manipulation done from the .bat script, so I don't see why it hangs.

Here is my code

Sure I could do away with the .bat file and do it all primarily in Java, but I'm interested in why this occurs for my own sanity.

6 years ago