1,678 Posted Topics
Re: [QUOTE=eggmatters;1022180] Is there a method I can invoke that will tell me who the caller was?[/QUOTE] You basically already did. Object source = event.getSource() returns the Object that caused the event to be fired. So you could just use '==' to determine which Object it was at that point, if … | |
Re: This is not a snippet. It is a request for help. And when you are asking for help, it is probably not a good idea to post a snippet. And read the rules stickied at the top of the forum, nobody is going to write your code for you, we're … | |
Re: [QUOTE=ki72;1023261] [B]you [/B]will have to write a program that reads a 4-digit positive integer from the user and prints out the following information on the screen: [/QUOTE] Re-read your project assignment. Pay particular attention to the part that I bolded. | |
Re: It *should*. Although I have personally occasionally had slight GUI issues when trying to run the same jar on Mac & Windows. But yes, the idea is that it will do so. If I were you, I'd test it on multiple platforms to be sure. | |
Re: You'll have to post the binarySearch method, since it is returning the -7 and all the other values (at least it seems that way). Also, thank you for posting in code tags. It is much appreciated. | |
Re: You can't put Strings into an integer array. Create a String array instead. | |
| |
Re: Well if the number of elements in the array is odd, it is logically the number directly in the center. Otherwise, it is the two numbers in the center added together and divided by two. | |
Re: It's because the compiler doesn't think that your method is [I]guaranteed[/I] to return either true or false. I.e., it thinks that it's possible to reach the end of your method without returning anything at all. If you're [I]positive[/I] that your method will always return either true or false (based on … | |
Re: Post the segment of your code where you get your warning and any other relevant portion of your code. In code tags. | |
Re: If you're done like you say, then post all of your code including the main so that I can run it. I'll see if I can fix it which I probably can, but generics are a little rusty in my mind right now and I see nothing right away. | |
Re: You can use a package that includes all of your essential classes and just import that package into any class where you want to use those classes. So basically, if you wanted to import the popular File class, you would use import java.io.File; but if you wanted to import the … | |
Re: I'll give you some hints and leave the rest of the work (such as using the definition of theta to come up with the values that prove it's big theta) up to you. But these are just my thoughts, no guarantee that it's correct so listen at your own risk. … | |
Re: Just some thoughts. . 1) because with the 1/2 condition, if you downsize the array, it will be much more likely that you will then have to subsequently resize the array later (due to having more elements than can fit in the new array you created in contractStack). 2) You … | |
Re: [url]http://en.wikipedia.org/wiki/1_%2B_2_%2B_3_%2B_4_%2B_%C2%B7_%C2%B7_%C2%B7[/url] | |
Re: [QUOTE=nola_Coder;1018197] What if there are say three left parentheses on the stack, but then a right bracket appears? How would the program know that the bracket doesn't match, since there are only parentheses on the stack? [/QUOTE] edit: If a closed bracket is encountered when a '(' is on the … | |
Re: [In general you would go through one of many software development processes, depending on what company or organization you work for.] For your project, however, you could have simply had a meeting with your team and determined the essential aspects of your project. Then, once you had the essential "functions" … | |
Re: Figure out the maximum number of exchanges that can take place in the MAX_HEAPIFY routine. Figure out the max number of times it can be recursively called (Ex: lgn), then multiply those two numbers and you have your answer. | |
Re: paste us the error message. the line that the error occurred on would be good information to know. | |
Re: [QUOTE=acm09;1018808]Design an application that accepts reader data and produces a count of readers by age groups as follows: under 20, 20-29, 30-39, 40-49, 50 and older." [/QUOTE] Essentially these are your requirements and the rest of the paragraph didn't matter whatsoever. I don't really see how we can help without … | |
Re: I typed 72 wpm three times in a row, but made 3 mistakes each time. I also type with two fingers. And who said home row meant anything !?!!?! edit: got up to 81 wpm with 3 mistakes | |
Re: You don't need to repaint() for setting buttons enabled or disabled. [CODE=Java] if(owned >= 0) { Sell.setEnabled (true); } if(owned <= 0) { Sell.setEnabled (false); } [/CODE] You need to consider the case when owned is equal to 0. If owned = 0, then both of your if statements are … | |
Re: [QUOTE=gibson.nathan;1015688]now i am trying to get my wind speeds, out them into categorys, and calculate the average category. [/QUOTE] So it seems like you have your steps figured out. It looks like you got your wind speeds, put them into their categories. . but did not calculate the average. The … | |
Re: The only problem I really have with Vista is the annoying, consistent 'do you really want to do X activity' messages and the fact that it hogs my RAM (which isn't a problem on my 4GB computer I now have). All I use is ad-aware and I have never had … | |
Re: [QUOTE=rgpii;1012493]Data Structures and Algorithm Analysis by Mark Allen Weiss[/QUOTE] Agreed, that book is crap. I used his Java book w/ the same title in my data structs class. | |
Re: Hints: for (the number of lines you are given to print){ -print a newline. for (the number of asteriks per line){ -print one asterik. Do not print a newline. } You can do printing using System.out.println and System.out.print. The former will print a newline (same as hitting enter basically) and … | |
Re: Seriously - if you can't figure out how to use code tags then read the stickies at the top of the forum that explain in detail how to do so. Or you could just quote one of the other members in here (such as Jocamps) who used code tags in … | |
Re: Well, for starters you could mark previous threads solved if you no longer have questions/are satisfied with the help you got. Some of these threads look like they are solved; if they are, then mark them as solved. [url]http://www.daniweb.com/forums/thread230080.html[/url] [url]http://www.daniweb.com/forums/thread229863.html[/url] [url]http://www.daniweb.com/forums/thread229842.html[/url] [url]http://www.daniweb.com/forums/thread229265.html[/url] As for your question, it looks like you … | |
Re: > And the thing I don't really get is here in TCPEchoClient.c: while (totalBytesRcvd < echoStringLen) { /* Receive up to the buffer size (minus 1 to leave space for a null terminator) bytes from the sender */ if ((bytesRcvd = recv(sock, echoBuffer, RCVBUFSIZE - 1, 0)) <= 0) DieWithError("recv() … | |
Re: [CODE=Java]if(copy[0]==null) System.out.println("DEBUGGING IS IMPORTANT");[/CODE] Put that in your readFile method before the while loop. | |
Re: Haha. Pretty amusing that two people from the exact same class ended up here, assuming that is really the case. Apologize for freeposting/upping this thread but that is really funny. | |
Re: [url]http://en.wikipedia.org/wiki/MIPS_architecture[/url] | |
Re: > can someone remind me how to loop a character please. I'm begging you all. > > my output must be this: *********************************************** * * * * * * * * *********************************************** > i know how to set the color attribute for a character, my problem is I for got … | |
Re: Not that the OP is interested, but in case anyone is, finding the minimum and then finding the maximum takes (n-1) comparisons each for a total of 2n-1 comparisons. The same can be done in about 3n/2 comparisons by doing both at once using pair comparisons. [URL="http://www.google.com/url?sa=t&source=web&ct=res&cd=3&ved=0CBgQFjAC&url=http%3A%2F%2Fwww.cs.vassar.edu%2F_media%2Fcourses%2Fcs241-200901%2Forderstats.ppt%3Fid%3Dcourses%253Acs241-200901%253Alecturenotes%26cache%3Dcache&ei=SnbXSp3IA8yo8AaSztznCA&usg=AFQjCNFTe8wAmNXcFVCGtPJdmxYSJYlQmA"]pair comparisons[/URL] | |
Re: You need to post your other classes. [CODE=Java]firstLevel.add(mainpanel, BorderLayout.CENTER); firstLevel.add(listpanel, BorderLayout.CENTER);[/CODE] Looks to me like you're just adding one thing right on top of another. How do you expect to see both? And there is no sign of CardLayout ever being used in your code. If you want to use … | |
Re: Yeah, I'm hacking in right now. Give me a few minutes and your IP will be unblocked. | |
Re: Learning daniweb's posting guidelines is useful to your major? What about reading comprehension? | |
Re: [QUOTE=ithelp;1013942]What is the prize for doing your homework?[/QUOTE] I'll give you low rep :) | |
Re: checkButton.setSelected(false); should work. In any case there are javadocs for all these things. Type the class name into google, click the javadoc, and read about the methods. | |
Re: You can get rid of this: print grade and change your module to this: gradePercent(grade){ if gradePercent < 60 then print “Fail” else print”Pass” } If you do those two things, you will have fulfilled your requirements. So what's the problem? | |
Re: edit - sorry, posted this at the same time as James [CODE=Java]int N1, N2, product, PoNoN1, PoNoN2; PoNoN1=N1+"(POSITIVE)";[/CODE] You can't store Strings into integers. So declare PoNoN2 as a String, not as an integer. Otherwise use a completely different variable. You have many similar mistakes in your code. [CODE=Java]String PoNoN1; … | |
Re: We can't help you without seeing the code. Just post it in code tags. And try to ask some specific questions or tell us exactly what you are trying to accomplish and why it is difficult for you. | |
Re: The main reason to use pass by reference is to be able to access the original object so that it will still be modified when you leave the function. Right? (Not the best wording, but hopefully what I mean is clear). I see other statements in here that don't make … | |
Re: The point is, the existeValor method takes three arguments, but you were only passing in one argument. That will only result in a compiler error - the two are treated as completely different methods. So yes - you are on the right track. | |
Re: I'm not trying to be rude, but Narue already had a pretty good explanation of at least one of your questions in a similar thread that was created in this forum recently (it should still be on the first page). (The question): "I think big-o describes the upper bounds of … | |
Re: You click the code button. Doing so produces the two tags that are enclosed in [][]. Before the first ']', put =Java. So it will say [code=Java]. Put your code inbetween so [code=Java]YOUR CODE HERE[othertag] | |
Re: I agree with you, addict. I found an interesting note on wikipedia as well: "Another notable difference is that static member classes cannot implement an interface, unless that interface is simply a marker. So if the class has to realize a contract expressed by an interface, it really has to … | |
Re: The new Item approach you listed will definitely put an item into inventory, assuming that inventory is an array of Items. However, whether or not the item will be what you want it to be depends on what parameters you are passing in. Could you post the Item class and … | |
Re: I personally like the system. I also think it was well designed as far as the interface. The only thing I don't like is that it is going to discourage people from disagreeing (see: this thread) because they will be down voted just for having a different opinion, (which in … |
The End.