Results 1 to 20 of 23
- 02-22-2014, 01:13 AM #1
Senior Member
- Join Date
- Feb 2013
- Posts
- 123
- Rep Power
- 0
Please help and don't close this thread
Please open this: [ - shrink your URLs and get paid!] and tell me the reason Java process calculation in this program very long. Please do not close this because all of the advice was implemented by me but I get no good result.
Mod edit: suspicious link removedLast edited by JosAH; 02-22-2014 at 05:06 AM.
- 02-22-2014, 01:25 AM #2
Re: Please help and don't close this thread
all of the advice was implemented by me
There were two different suggestions:
1) profiling
2) computing times that sections of code took to execute and print those times out
The other post on this same topic: http://www.java-forums.org/new-java/...very-long.htmlLast edited by Norm; 02-22-2014 at 01:30 AM.
If you don't understand my response, don't ignore it, ask a question.
- 02-22-2014, 02:05 AM #3
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,226
- Rep Power
- 15
Re: Please help and don't close this thread
No one is going to visit that site. You already dumped your code here --> http://www.java-forums.org/new-java/...y-program.html. Six posts of it. No one is going to spend the time to analyze all of that. You need to learn the fundamentals of programming and design. I suggest you start with The Java™ Tutorials and a good book. Please stop asking for help on this.
Regards,
JimThe JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
- 02-22-2014, 04:05 AM #4
Senior Member
- Join Date
- Feb 2013
- Posts
- 123
- Rep Power
- 0
Re: Please help and don't close this thread
I posted the result in the previous thread for profiling. About the computing time, Java does not do any things after I click the button that is being named "Proses" by me. So? What next? If you don't believe me, download the file or let me dump the code in this thread ok?
Last edited by Tawi; 02-22-2014 at 04:49 AM.
- 02-22-2014, 04:24 AM #5
Re: Please help and don't close this thread
I posted the result in the previous thread for profiling.
Java do not do any things after I click the buttonJava Code:long startTime1 = System.currentTimeMillis(); // save start time System.out.println("Calling method1 at "+startTime1); method1(); // call method1 System.out.println("end method1 duration="+(System.currentTimeMillis()-startTime1)); // report how long it took
The output for each method call should look like this:Calling method1 at 1393035987338
end method1 duration=3328Last edited by Norm; 02-22-2014 at 04:29 AM.
If you don't understand my response, don't ignore it, ask a question.
- 02-22-2014, 04:31 AM #6
Senior Member
- Join Date
- Feb 2013
- Posts
- 123
- Rep Power
- 0
Re: Please help and don't close this thread
Error: Could not find or load main class C:\Documents
Flat profile of 0.62 secs (50 total ticks): main
Interpreted + native Method
8.2% 0 + 4 java.io.WinNTFileSystem.canonicalize0
4.1% 0 + 2 java.io.FileInputStream.open
2.0% 0 + 1 java.lang.Class.forName0
2.0% 1 + 0 sun.launcher.LauncherHelper$ResourceBundleHolder.< clini
t>
2.0% 1 + 0 java.util.zip.ZipFile$ZipFileInputStream.close
2.0% 0 + 1 java.io.WinNTFileSystem.getBooleanAttributes
20.4% 2 + 8 Total interpreted
Thread-local ticks:
2.0% 1 Blocked (of total)
79.6% 39 Class loader
Global summary of 0.62 seconds:
100.0% 50 Received ticks
2.0% 1 Compilation
78.0% 39 Class loader
Done, so? What does this mean? What next?
I already did it but Java did not do any things after I clicked the button, so? What next?
- 02-22-2014, 04:36 AM #7
Re: Please help and don't close this thread
Where is the commandline that started the test? There should be a line that starts like:
java -Xprof ....
That report says the program finished execution in less than one second? Where is the problem then?
Here is an example of what needs to be posted:Java Code:Running: D:\Java\jdk1.7.0_45\bin\java.exe -Xprof -cp . TestCode16 Calling method1 at 1393036652564 end method1 duration=2608 Flat profile of 2.66 secs (106 total ticks): main Interpreted + native Method 0.9% 1 + 0 java.io.File.equals 0.9% 1 + 0 java.nio.DirectLongBufferU.<clinit> 0.9% 1 + 0 TestCode16.method1 2.8% 3 + 0 Total interpreted Compiled + native Method 97.2% 103 + 0 TestCode16.method1 97.2% 103 + 0 Total compiled 0 error(s)
Last edited by Norm; 02-22-2014 at 04:38 AM.
If you don't understand my response, don't ignore it, ask a question.
- 02-22-2014, 04:49 AM #8
Senior Member
- Join Date
- Feb 2013
- Posts
- 123
- Rep Power
- 0
Re: Please help and don't close this thread
Try to download and run the program. After that please write your computer specifications if you can run it. If I need more sophisticated computer to run the program please tell me the minimum requirements to be able to run the program because Java does not do any things in here.
- 02-22-2014, 04:57 AM #9
Re: Please help and don't close this thread
If you are not going to follow any of the advice given to you, what is the use of keeping this thread open?
It's a waste of time to repeat what has already been said on the two other threads.
Try to do one or both of the debugging techniques you have been shown.
A bit of history: http://forums.devshed.com/java-help-...am-944098.htmlLast edited by Norm; 02-22-2014 at 05:18 AM.
If you don't understand my response, don't ignore it, ask a question.
- 02-22-2014, 05:17 AM #10
Senior Member
- Join Date
- Feb 2013
- Posts
- 123
- Rep Power
- 0
Re: Please help and don't close this thread
Flat profile of 0.42 secs (26 total ticks): main
Interpreted + native Method
4.0% 0 + 1 java.util.zip.ZipFile.open
4.0% 1 + 0 java.lang.AbstractStringBuilder.append
4.0% 1 + 0 java.io.BufferedReader.readLine
4.0% 0 + 1 java.io.WinNTFileSystem.getBooleanAttributes
16.0% 2 + 2 Total interpreted
Thread-local ticks:
3.8% 1 Blocked (of total)
84.0% 21 Class loader
Global summary of 0.42 seconds:
100.0% 26 Received ticks
23.1% 6 Compilation
80.8% 21 Class loader
The full one:
Error: Could not find or load main class and
Flat profile of 0.04 secs (3 total ticks): main
Interpreted + native Method
50.0% 0 + 1 java.util.zip.ZipFile.getEntry
50.0% 0 + 1 Total interpreted
Thread-local ticks:
33.3% 1 Blocked (of total)
50.0% 1 Class loader
Global summary of 0.04 seconds:
100.0% 3 Received ticks
33.3% 1 Class loader
I did it. The problem is I do not know your computer specifications. If you can run the program well, please tell me your computer specifications. In other words, what kind of minimum computer specifications shall I use to run the program? The Java reports no error, so?Last edited by Tawi; 02-22-2014 at 05:26 AM.
- 02-22-2014, 05:24 AM #11
Re: Please help and don't close this thread
You need to copy ALL of the contents of the command prompt window and paste it here.
You are wasting time by not following instructions.
What about adding the println()s?If you don't understand my response, don't ignore it, ask a question.
- 02-22-2014, 05:29 AM #12
Senior Member
- Join Date
- Feb 2013
- Posts
- 123
- Rep Power
- 0
Re: Please help and don't close this thread
No content in the command prompt. I revised the code heavily. Where shall I put the println()?
Last edited by Tawi; 02-22-2014 at 05:31 AM.
- 02-22-2014, 09:01 AM #13
Senior Member
- Join Date
- Jan 2011
- Location
- Belgrade, Serbia
- Posts
- 311
- Rep Power
- 11
Re: Please help and don't close this thread
what you use to run this program? some IDE or command prompt (terminal)
- 02-22-2014, 01:50 PM #14
Re: Please help and don't close this thread
Where shall I put the println()?If you don't understand my response, don't ignore it, ask a question.
- 02-23-2014, 02:45 AM #15
Señor Member
- Join Date
- Jan 2014
- Posts
- 184
- Rep Power
- 0
Re: Please help and don't close this thread
I'm so confused by this thread. What do you even want help with?
Typically, if I've got a complicated program:
Java Code:class complicatedProgram { public static void main ( String[] args ) { String s = "hey"; int a1 = 67; int a2 = 89; int total = add(a1, a2); int a3 = convertToInt(s); int finalTotal = add(total, a3); String answer = convertToString(total); } //methods for add, convertToInt, and convertToString here }
So I would do this:
Java Code:class complicatedProgram { public static void main ( String[] args ) { String s = "hey"; int a1 = 67; int a2 = 89; System.out.println("Call 1"); int total = add(a1, a2); System.out.println("Call 2"); int a3 = convertToInt(s); System.out.println("Call 3"); int finalTotal = add(total, a3); System.out.println("Call 4"); String answer = convertToString(total); System.out.println("Call 5"); } //methods for add, convertToInt, and convertToString here }
- 02-23-2014, 02:49 AM #16
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,226
- Rep Power
- 15
Re: Please help and don't close this thread
That's all been covered before with this person. Two of the OP's threads have been closed. And similar posts are at JavaRanch where the advice and frustration from the repliers has been the same.
Regards,
JimThe JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
- 02-23-2014, 03:28 AM #17
Señor Member
- Join Date
- Jan 2014
- Posts
- 184
- Rep Power
- 0
Re: Please help and don't close this thread
Well until the thread is closed, there is nothing to do but post answers.
Some people don't understand English very well. Others simply may need to see an answer a certain way to understand or may not be as quick as you.
It won't hurt to restate what somebody already said.
- 02-23-2014, 05:15 AM #18
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,226
- Rep Power
- 15
Re: Please help and don't close this thread
It has nothing to do with understanding English. It is clear the poster understood what was being asked. The poster continued to refuse to follow the advice. Of course, you may do as you see fit.
Regards,
JimThe JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
- 02-23-2014, 05:20 AM #19
Senior Member
- Join Date
- Feb 2013
- Posts
- 123
- Rep Power
- 0
Re: Please help and don't close this thread
Last edited by Tawi; 02-23-2014 at 06:04 AM.
- 02-23-2014, 06:06 AM #20
Senior Member
- Join Date
- Feb 2013
- Posts
- 123
- Rep Power
- 0
Similar Threads
-
A good place to study Thread, Runnable and other thread composing code.
By heatblazer in forum Forum LobbyReplies: 2Last Post: 12-11-2012, 12:35 PM -
Thread doesn't close
By fioan89 in forum Threads and SynchronizationReplies: 0Last Post: 10-21-2011, 02:07 PM -
How to close this thread? (Socket listener)
By zardos in forum New To JavaReplies: 5Last Post: 03-02-2011, 11:27 PM -
Will the connection.close() and statement.close() ever be called???
By Stephen Douglas in forum New To JavaReplies: 13Last Post: 04-09-2010, 12:15 PM
Bookmarks