7,116 Posted Topics
Re: If it's so important and urgent then I assume you must have have already started to work on it yourself. Surely you're not waiting for someone else to do it for you (for free). Post what you have done so far. | |
Re: Lots of people can. If you can't it's because you haven't bothered to try. Try to do it. If you get stuck post your code here with an explanation of why you're stuck, and someone will help. | |
Re: Indeed there are cases where a loop can be used instead of recursion, and in those cases the loop will carry less overhead. These are mainly encountered in programming courses when the concept of recursion is first introduced. (I don't know about Python specifically, but a decent compiler will recognise … | |
Re: > have resulted in errors. What errors exactly? Help us to help you. | |
Re: To make room for "encoding" and "error" perhaps? (Personally I'm not familiar with either language.) Not to mention "thermalprint" which appears in every single sub-heading. | |
Re: What do you mean by "the statistical value"? If it's "average, std deviation etc" then you can't alter them except by altering the random numbers. Eg adding .7 to each value will increase the average by .7 Or, are you looking to convert uniformly distributed random numbers into a set … | |
Re: RoboVM was a nice open source project that ended up being owned, then killed, by Microsoft in 2016. In my opinion you would be mad to start a new development on a dead platform. Moving from Java to Swift isn't that hard, and you'll love the way its designers learned … | |
Re: Your title and question are inconsistent! Is it interfaces in inner classes, inner classes in interfaces? Interfaces in inner classes: Yes, sometimes. Because interfaces are by definition static, they can only be declared in a static inner class. Thus: class Testing { static class Inner { interface InnerInterface { } … | |
Re: Driver line 2 is the error. It means you have two lists where you should only have one. You have a list in your library class, you don’t need another one in the driver. You add the item to the list in Library, then print the list in Driver - … | |
Re: You could synchronise drawing and modifying, but that would prevent them running concurrently and immediately halve the performance of the app and make the UI less responsive (not to mention the complexity and overhead of all that synch). So if you just want to loop thru the list while drawing, … | |
Re: Line 66: you have confused greater/less than. | |
Re: Which address do you want? Could be the public address supplied by your ISP Could be the local address supplied by your router Could be 127.0.0.1 as above if you want to refer to the computer you are on | |
Re: The problem with a text file is that any modification to the text is highly visible to the user, so this technique won't work. | |
Re: The simplest code to check for duplicates in a List is probably to add its items to a HashSet (HashSet does not allow duplicates) and check if the size is the same, eg var x = new ArrayList<Integer>(); x.add(1); x.add(2); x.add(2); x.add(3); var y = new HashSet<Integer>(x); System.out.println(x.size() - y.size() … | |
Re: Standard answer: It's a real problem with Scanner's design - so many people fall into this trap. You have some input alternating an int followed by some text, eg 101 John Doe ... and you try to read it with int num = scanner.nextInt(); String name = scanner.nextLine(); ... and … | |
Re: I already told you what causes this probem and how to fix it. You are wasting your time and ours by asking the same question twice. | |
Re: My machines all have an SSD for the system and applications, and a large HD for data. The large HD is partitioned so it has a bootable clone of the SSD and a second partition for data. I re-do the clone every month or so. So given a serious problem … | |
Re: line 77 (etc?) should be paintComponent, not paintComponents | |
Re: 1 At startup you are updating the content of a visible component on a non-swing thread - use invokeLater etc 2 Don't use fixed sizes. That destroys your portability. 3 see other post... paintComponent (no s) | |
Re: // simple example... int[] data = {1,2,3}; // create an array doStuff(data); // pass it to the method ... void doStuff(int[] arg) { // declare method with an array parameter // do stuff with arg[0], arg[1] etc } To call an instance method from main (which is static) you need … | |
Re: Duplicate posting of the same question asked **and answered** on coderanch. Also apparently posted on dreamincode. | |
| |
Re: Good project! Yes, MVC is a good way to go, although it may be overkill for a simple app. The important thing to have a clean separation between model and view. You can use the Observer pattern to link a CarGraphics object to a Car object (just like any Swing … | |
Re: My background is in Smalltalk, so I can't understand the design decision to return None/void from a method/function that has no specific return value. In Smalltalk a method with no explicit return wil always return the receiver object, which enables you to chain calls together like (pseudocode) `person.setName(etc).setAddress(etc).setDOB(etc).print()` Interestingly, Java … | |
Re: Hi Sorry, but that question cannot be understood in english. Can you try to explain it better please? | |
Re: > Isn't &var the address of any variable var, regardless its type? (or am I missing something?) Yes, but you are missing something, namely that the cout << operator for a pointer to a char is overloaded so it works well for char arays (used to hold strings in C). … | |
Re: Your approach to this is somewhat confusing - why not 4 timers each handling the color change for one button? Anyway, the NPE may be related to the button arrays - that's arrays, not array, because you have two of them, one in the Thread_ES2 instance started by JavaFX when … | |
Re: Your question is too vague. What exactly do you need to know? How far have you got, and so where are you getting stuck? | |
Re: I've just understood what this topic is all about! I've been monitoring the Programming forum regularly, but there's nothing Java going on. Then this morning I randomly tried looking at the generic Latest Posts and there, at the top, is a sensible Java question, with the user showing what they … | |
Re: I share your confusion. The player doesn't actually play anything, just says OK and the computer rolls 4 dice and scores the result. My best guess is that some user interaction mqy be used for the "roll again to win" case? In which case letting the cmputer play is the … | |
Re: It all depends on whether you set the custom renderer for a column, a row, or an individual cell. The code above sets it for a column. ie all the cells in that column. Oracle's tutorial explains it all with examples. https://docs.oracle.com/javase/tutorial/uiswing/components/table.html#renderer (about 1/2 way down the page, starting with … | |
Re: Why not simply use the recovery partition to restore the whole machine to its factory state? https://www.dell.com/support/article/fr/fr/frbsdt1/sln151763/how-to-restore-a-windows-7-factory-image-on-your-dell-pc?lang=en | |
OK, so I'm gereatric and have fading eyesight, but light typeface in light grey on white? Serioudsly: constructive requests vfor the topics summary page: 1. Show the name of the OP 2. Bring back the click to go straight to the laest post in a topic 3. Use sensible colours … | |
Re: You have correctly been told twice by different people about moving the `dank` assignment to insode the loop, but you haven't moved it. | |
Re: Is this really answered? If not mark it "unsolved" and someone will help. | |
Re: Yes. It's hard to get excited by this release. Its only significance is that it's a LTS release that finalises and fixes the (minor) goodies that were introduced in 9 and 10. | |
Re: Does logging in to a system that requires no password count as "hacking"? | |
Re: A regular expression defines the rules by which a string can be analysed as conforming or not conforming to those rules. A numeric sample string does not define what the rules should be, it's just one example - eg we know that "123-322-14365" is valid, but what about "12-322-14365" etc … | |
Re: 2: double moneyDeposit = 0; 3: 4: if(moneyDeposit > 2000) // will always be false!!! same problem lines 16-18 | |
Re: Looks like Java > Why did you put the keyword Public there? Whats wrong with declaring a class `public`? > I keep getting this illegal start of expression and can't figure out why. It's because line 16 ends with ` = +);` which makes no sense at all (and isn't … | |
Re: > i type any key from key board e.g 'A', then the jcombobox filters perfectly and shows me the items: America, Austria. ??? When you type a letter the selection in the combo box skips to the first entry that starts with that letter. It doesn't change the contents of … | |
Re: I too believe it was a catastrophic mistake to trash the language-specific forums. Anyone looking at the remaining programming forum will quickly see that we don't do Java, just PHP, SQL, Python, C*. I don't believe tha the complete collapse of Java activity is entirely due to Google's malevolance, or … | |
Re: Read this thread - it contains a complete discussion. If you are still stuck start a new thread of your own, and post what you have done so far. Nobody will help you until you show that you are willing to make some effort. | |
Re: Hi divinity02 You know me. We have worked together many times. But this time I agree with the previous posts. You haven’t given anywhere near enough information that we could possibly use to help you. Please try again with actual code, error message etc. JC | |
Re: Your do/while will loop forever because the body always sets the same value for minValue and therefore the while clause always returns the same value. (A couple of quick print statements would have revealed this immediately.) If its stil not clear, add some prints so you can see what's going … | |
Re: Looks like you populate the content of your Panels, but you never add the panels to the main window. | |
Re: what drop down? <resists temptation to do the locked filing cabinet HHGTTG thing again> | |
Re: > Spend some time on grammer (sic). Sentences should start with a capital letter and end with the usual period, question mark or ! It's pretty obvious that English isn't s_15's first language. I doubt (s)he came here for a language lesson, and grammar shaming isn't what DaniWeb is for. … | |
Re: To run that code you need values for img, url etc. Where do those values come from? Eg: should the user type them in? |
The End.