7,116 Posted Topics
Re: click the box labelled `</>Code` above the editor window to open a frame into which you can post code and retain its formatting. | |
Re: You create the new balance in `newBalance`, but then you ignore that. Either just update `Balance` directly, or copy `newBalance` to `Balance` at the end of the transaction. | |
Re: The "standard" solution is to parse the expression into RPN form using a stack, eg see http://faculty.cs.niu.edu/~hutchins/csci241/eval.htm | |
Re: Did you try debugging by printing the value of retVal at line 10? | |
Re: Looks like its caused by an extra `>` on or near line 22374 | |
Re: Because float values are stored in binary, just 1s and 0s, and the fractional part is made up from the values 1/2, 1/4, 1/8. 1/16, 1/32 etc But there's no way to represent the value 1/3 exactly with any finite number of those fractions. So the last digit will always … | |
Re: What is it about that code that you don't understand? ps: although it's legal Java, it's not very good code - obviously written by a beginner. Don't use it as an example to follow. | |
Re: It's hard to express fully what scum these people are. They prey on worried students and take their money in exchange for which: The student fails to learn whatever the course was teaching The student gets thrown out when the cheating is discovered Honest hard-working students have to compete with … | |
Re: It would take you about one minute to try each of those modifiers in the java compiler to get an absolutely definitive answer. | |
Re: The web has many many tutorials that cover writing simple Android apps, so it's unrealistic to expect anyone here to write another one. Google for tutorials, pick one you like, and try it. If you get stuck then come back here, show what you have done so far, and explain … | |
Re: Interesting... A quick look at the source code for Scanner shows that the File constructor immdiately creates a FileInputStream from the file and proceeds with that, so just passing the stream rather than the file shouldn't make any difference. Problems with non-ascii chars are much more likely to be a … | |
Re: Where I live in rural France it's not unusual to have a deer jump out of the vineyards at the side of the road, or for a wild boar (built like a tank but twice as agressive) to saunter across the road and defy you to try your luck. BUT … | |
Re: People have taken the time and effort to reply to you, and I can't delete your post(s) without deleting theirs, so the topic will remain as-is. Hopefully others will read it and avoid making the same mistake. JC | |
Re: > The constructor should store the fraction in reduced form. So you should perform the reduction in the constructor. Google *Euclidean algorithm* for a good way to compute the GCD | |
Re: If this is in the context of a Senior Java Developer then maybe they are looking for some more genrelaised approach such as define a functional interface Rule that takes an int and returns a String or null define a collection of Rules populate it with the three Rules as … | |
Re: Personally I'm always amazed that any regex more than about a dozen chars ever works. Anyway, maybe you could try this link, which has regex for various languages that they claim to be 99.99% perfect according to RFC5322 ... http://emailregex.com | |
Re: Yes, that's it. It really is that simple. But it's power to simplify structure is vast - it changes what would be a two-way dependency to a one-way dependency. That means you can build your code in layers, each needing zero knowledge of tha layers above it, even when events … | |
Re: An object is a combination of some data and some methods that together represent some kind of entity eg an employee, an invoice, an IP address etc etc. Constructors are special methods that are part of the object's definiton and are responsible for initialising the state of any new object … | |
Re: At line 10 your variable "a" tells you how many asterisks to print. SO you can use a second loop there. Execute the new loop "a" times and print a single asterisk each time. | |
Re: Crossposted https://stats.stackexchange.com/questions/336732/leader-clustering-and-overlapping-clustering-algorithms and at https://stackoverflow.com/questions/49487927/leader-clustering-algorithm-vs-overlapping-clustering-algorithm | |
Re: There's nothing "on the right" Show what you have done so far. | |
Re: You can incorporate a check at instal and/or startup that accesses a licence server that you control. Send a formal letter explaining the problem and offering a discounted price for the second install. if the client is honest they will respond suitably and you can negotiate. If they won’t cooperate … | |
Re: More info needed: Exactly what response did you expect, and exactly what did you get? "some HTML code" is no help. | |
Re: I also did a random maze program (Java) a while back, and was very happy to discover Kruskal's algorithm. It generates random perfect (exactly one solution) mazes very efficiently, and works for mazes with any kind of geometry. Well worth a quick Google. | |
Re: Dani. Thank you so much for starting my day with a really good laugh. You couldn't make it up.. JC :) :) | |
Re: Manoj: don't hijack old topics. Start you own. | |
Re: OK, I have written it. Have you? You can buy my version for only 99USD and pretend its yours if you want. Then you will pass your course and everyone will know how clever you are. Now go back and read [DaniWeb's rules](https://www.daniweb.com/welcome/rules) , especially "Do provide evidence of having … | |
Re: Regardless of any language or syntax problems, your class hierarchy is wrong. Inheritance is a "is-a-kind-of" relationship, as in: Mammal is a kind of Animal Cat is a kind of Mammal so Cat is a subclass of Mammal, Mammal is a subclass of Animal. Is a Course a kind of … | |
Re: `(item_count > 5)` should work in most of the languages you have tagged this topic with, given a suitable variable declaration. What you have posted is roughly equivalent to: "change gear - tags: Ford, Chrysler, Harley Davidson, Tesla" ie meaningless, not a question, conflicting tags, nowhere near enough info... Try … | |
Re: Don't expect us to guess - tell us exactly what problems you are having difficulty with. | |
Re: I speak Java but not Python, so I don't understand all the original code, but looking at the Java in its own right... it looks like you should remove line 6 and write your main as public static void main(String [] args){ Robot1 res = new Robot1(); // need to … | |
Re: err, no, no way, absolutely not "This tutorial only works for Xcode 4.6 or lower." The current version is 9.2 and it uses Objective C rather than Swift, which was OK when that tutorial was written back in 2012, but not in 2018. Why not go straight to the source … | |
Re: It seems there's a problem where Google has been failing to give enough prominence to sites like DaniWeb when people search for IT help, so please tell all your friends about us and give us some good exposure in your social media. We're still here and ready to help. | |
Re: That code will give you a random int in the range 0-10 (inclusive). Is that what you want? | |
Re: I too am confused by this. Shouldn't `word[6:11]` be `" good"`, not `"good"`? | |
Re: Mansoor. It's incomprehensible how you could read the previous posts then add yours on the end. Read them now. Then read the thread that the previous post links to. | |
Re: @Elifas. Did you bother to spend even a few moments reading the "Read this before posting a question" at the top of the page? We do not waste time helping people who are so lazy that all they can do is post their homework task verbatim and wait for someone … | |
Re: You know the rules: we only help people who are showing some effort. Show what you have done so far, explain what's stopping you going further, and someone wil help. | |
Re: Just go through the code and check each pair of open/close parenthese. Either you are missing , or you have an extra, unmatched one. If that's OK then you are missing a whole block of syntax. But next time DO NOT hijack an old topic - start you own new … | |
Re: No need to shout! Let me explain: at DaniWeb we help people who are learning or having a problem. We try to help by teaching them what they need to know to solve their own problem, and others like it in the future. There's no way we will ever just … | |
Re: That's not how Optional should be used. The Optional variable itself should never be set to null. Use `Optional.empty()` to create an Optional that has no value. Ie line 8 should be Optional<Customer> customer2 = Optional.empty(); PS: The way you are using isPresent() is perfectly legal, but [not recommended](http://www.oracle.com/technetwork/articles/java/java8-optional-2175753.html). It … | |
Re: Tears for fears originally, then Adam Lambert in the best performance of any talent show anywhere anytime. But yes, how appropriate for this thread | |
Re: Line 13 you create a File but you never use it Line 14 - what value are you entering for the (first) run time argument? Your regex searches for a `<` followed by any number of any character (including `>`) so it basically matches the whole string following the first … | |
Re: You need to be be specific about what you have done already and exactly what help you need. | |
Re: Then fire up your text editor and start writing! When you get stuck then come back here, show what you have done, and explain what’s stopping you. | |
Re: Your File object does not refer to any actual file (the file name is a zero length string) so it has not got a parent. | |
Re: Break this down into easy steps. Your destination is to have the database query running in a different thread from the Swing thread, because the whole gui will freeze during any processing that you do on its thread. That’s why you can use SwingWorker, for example. But first, just ignore … | |
Re: I can’t see any code that could explain a sprite colliding with itself. Is there maybe a double loop somewhere that calls OnTriggerEnter2D for each pair of sprites? |
The End.