7,116 Posted Topics
Re: I don't have time for a full reply now (I'll try later) but the short version is: Start with the API definitions for the distinct layers. Eg if its just MVC then define the model's API. In multi-layer systems I would still start ith the API for the layer below … | |
Re: Have you tried it? | |
Re: Quickest solution is to have the list in the Employee superclass as a static member with suitable public accessors. The constructor for Employee can simply add `this` to the list. The purist answer is that Employees need an Employer (Company or whatever) and that's where the list belongs. It's the … | |
Re: If the deck is shuffled then it makes no difference which card you remove, so why not just remove the last one? (May make no difference in Python, but for languages with simple arrays it's lot easier.) | |
Re: Obviously a mis-click for the adjacent self-driving topic. I tried to move it, but couldn't find that option. | |
Re: See [this](https://lmgtfy.com/?q=What+is+JDBC%3F+What+are+different+types+of+JDBC+drivers+%3F&s=g) | |
Re: yes, affected Presumably you will have downloaded that library and incorporated it into your deliverable, so nothing that happens on GitHub will affect it. It it were removed I'd be more worried about (a) confirming that its licence allows you to continue to do what you are doing and (b) … | |
Re: What are the constraints, eg 5 chars in a horizontal or vertical line? and diagonal? and any zig-zag snaking sequence? | |
Re: Exactly what trouble are you having? What help do you need? You say you have the code. Did you write it or is it just something random that you found on the web? If you have good code, then the pseudo code is just an explanation of that code in … | |
Re: You have a complete path for the file, but you discard everything apart from the file name. So it will look for that file in the default directory. In all probablility the default directory is not the same as the one in the original path, so the it's looking in … | |
Re: Have you tried it in another machine or external box in case the SSD is faulty? | |
Re: I can't see any obvious errors in that code, but to go any further we would need to understand the sequence of events that make up your test case. | |
Re: It's a well-known problem with Scanner's design - so many people fall into this trap. your `nextInt` reads the menu number, leaving its newline character in the input buffer. The `nextLine` reads that and returns a zero-length String. See below for more discussion. You have some input with an int … | |
Re: What'ss the problem? You sort the collection based on the names, and you get your collection sorted in name order. What did you expect? ps: Your two "override" comments are wrong - those methods override nothing (which is why you haven't been able to annotate them) | |
Re: Why the parseInts? Don't you just want to insert the character that represents 1,2,3 etc? And why the === (identity test) rather than a simple == (equals)? | |
Re: All http sites in the world? Do you have any idea how many terabytes (zettabytes?) that is? | |
Re: Before you do anything else fix your empty catch blocks by printing the complete details of any exception. | |
Re: This is a continuation of your previous post, so you should not create a new topic. Just add to your existing topic. Anyway: Printing "not found" inside the loop will print out for every element that does not match. You need to go through the loop looking for matches. If … | |
Re: JDom2 for Java can do that kind of thing... easy to use but still has the Java trademark verbosity. Example: http://www.studytrails.com/java/xml/jdom2/java-xml-jdom2-example-usage/ | |
Re: You need a loop in which you compare the search string with each entry in the array until you find a match, or exit the loop having not found any match ps. That's an array. An ArrayList is a completely different thing. | |
Re: I hope you have the permission of the copyright owner to publish their work in its entirity withoit any pretence of fair use, comment etc. Or are your homework assignment descriptions in the public doamin? You didn't ask any questions or tell us what you want us to do with … | |
Re: Line 92 You just print the last item. Think about how to use the loop variable ` a` Also Line 77 If you want to test for two Strings containing the same sequence of characters then use the `equals` method. `==` tests if they are exacty same object. | |
Re: It looks like a mathematical solution is v. hard, so maybe in a C.S. context it's asking for a numerical solution (approximation) using some kind of iterative approach? ps: It looks like there are two positive real solutions, approx 0.0035 and 25.7 | |
Re: Here's some pseudo-code to point you in the right direction do get two random numbers 1-6 sum them together while( the sum is not 7 or 11) | |
Re: Can you post the complete exact error message please? | |
Re: > A lack of tolerance, not just in the religious sense, is at the heart of most of the problems in the world today ... I value true neutrality While I agree with that sentiment, I don't agree that we should tolerate everything just because someone believes in it. Racisim, … | |
Re: > what you get out of your membership? I'm now retired with 50 years of programming experience about to follow me into the grave. What I get from DaniWeb is a way to pass on some of that experience and learning to a new generation. It's a way of repaying … | |
Re: It's not a problem, and you don't have to solve it. Just do what you have been told. You have been given a very clear set of step-by-step instructions. Just follow them, one step at a time, exaclty like it says. If you get stuck come back here and show … | |
Re: Don't just say "getting errors:, tell us the complete error messages or worng behaviours. Anyway, one thing is that you have two different Scanners both using System.in, which is guaranteed to cause problems. Just open one Scanner at startup and use that for everything | |
Re: Thiis code is 8 years old, and was pretty obsolete even then. Java has moved on a lot, eg AWT (as used in this code) was superceeded by Swing in the LAST CENTURY! That's one very good reason not to use it. The other very good reason is, of course, … | |
Re: The qiestion isn't very clear, but it sounds like you need to update the window's contents after the window has alteady been displayed? If so you need to separate the code that creates the window from the code that populates the fields with actual data. Then you can re-call the … | |
Re: It looks like whatever is in` rt.data` at line 14 is not a valid string representation of an integer. But since you don't show that data there's nothing more anyone can say. You could print` rt.data` just before calling `parseInt` to see what values you are processing | |
Re: Are you missing a comma after ID_DOMAB NUMBER(10) ? | |
Re: Think about how you would do this with a pen and paper... You're going to have to start at each point in the grid and search in up to 8 directions to look for words. Expect a lot of nested loops! | |
Re: Hello. We can help you learn how to do this, but we won’t do it for you. What have you got so far? | |
Re: You have 2 Scanners both based on System.in At the end of the accept method you close one of them Closing a Scanner also closes the underlying stream (see API doc), which is System.in The you try to read from the other Scanner, but its underlying stream has been closed … | |
Re: It looks like you stopped reading the instructions about half way down. That's always a fatal mistake. Go back to where it says "Specifications" and do what it says there. Then write a `main` method that just does the user I/O and creates/uses an instance of the Reservation class. The … | |
Re: What's your objective here? If you just want to get something working quickly then a bit of copy/paste from the web may help Or... you may be copying something that's poor quality, or not really what you needed, in which case you are in for a whole heap of pain … | |
Re: There's nothing wrong in the code you posted, so the problem lies somewhere else. Without the whole code and the actual input there's nothing more we can do. But in general the NoSuchElementException is thrown when the input stream has been closed, so cannot supply any more input for scanning. … | |
Re: What ordinary folk voting for "regaining control of the country" ignored is that they don't control anything, the government does. And the current UK government is hell-bent on privatising or outsourcing everything in sight. It also favours corporations over individuals, and mutinationals over small businesses, every time. (Not to mention … | |
Re: I canonly see one call to searchCustomersByName, and that passes null as the parameter. I can't see any code to print it. | |
Re: So just start one writer and one reader thread instead of the 3 readers in that code. Set the priority of the threads to give the priority you want. What's weird about this code is that it creates theads, but just executes their run methods in the current thead. Try … | |
Re: No. Not Blu-ray for dvds, and not iso for a DVD player. There are apps for that, eg see https://www.howtogeek.com/howto/3061/burn-any-video-file-type-to-play-on-a-dvd-player/ Using a ChromeCast or similar is much easier and faster. | |
Re: Presumably you have a loop in which the quesions are asked and answered? If so just maintain a counter of how many questions and exit the loop after 20,eg (pseudocode) for (int count = 0; count <20; count++) { // do one question } endgame but maybe you have retry … | |
Re: It's just the limited intelligence of the compiler. You and I can see that you always return a boolean, but the compiler sees that you may exit the for loop without returning a boolean. Just add a (dummy) `return false;` at the end and the cpmpiler will be happy. | |
Re: It can be done using loops like that, but you have to do something like: while some input remains... find the most frequent character (like in your code) add the right number of that character to the output remove all instances of that character from the input A much simpler … | |
Re: > what need or requirement exists that DaniWeb is well placed to satisfy I see DW as a resource primarily for learners. Unlike S.O. we are beginner friendly, and will spend time discussing options and providing guidance. This is surely a huge need that we have met well in the … | |
Re: Line 107 getArea is a method in the RoomDimension class, but you try to call it using an instance of RoomFlooring (and vice-versa for the material costs) ps Line 102 your main method is declared as an instance method but it should be static pps Java conventions are to use … | |
Re: Don't worry, it's not really your fault. You are roughly the one millionth person to be trapped by this stupidity in the design of the Scanner clsss. Here's the explanation (it uses ints, but doubles work the same way). You have some input with an int followed by some text, … | |
Re: Hints: The `String` class has a method to convert into an array of chars The `Arrays` class has a method to sort arrays of chars The `String` class has a constructor that takes an array of chars to create a new String. |
The End.