7,116 Posted Topics
Re: If you want people to spend time then you must a) explain exactly what help you need b) show what you have done so far ps I tagged this "Java" for you so the right people will see it. | |
Re: What you pass is the object that you are using as a lock. Only one thread can have the lock at any given time. (Every object has an associated monitor and wait and notify methods; these are the fundamental pieces with which thread synchronisation is implemented.) "this" is the current … | |
Re: In my opinion you can't beat the original Oracle tutorials http://docs.oracle.com/javase/tutorial/reallybigindex.html | |
Re: I'm no REGEX expert, but standard Java does include classes for parsing XML (and therefore HTML) without any "external libraries". That's probabaly the safest way to ensure your parsing isn't going to fail on some obscure but legal example of real data. http://docs.oracle.com/javase/tutorial/jaxp/index.html | |
Re: `matrix` is a 2D array (strictly: an array of arrays) so you need two indexes to get to a single element in `matrix`. I don't know excatly what you tried, but you will need something like `if (matrix[i][j]) ...` where i and j are integers, integer expressions, or anything else … | |
Re: use `removeAll` to remove all the elements in b from(a copy of) a... what ever is left is the answer | |
Re: After a quick look at that code I see three HashMaps. Only one seems to get anything put in it, and only one (not the same) gets printed. Makes no sense to me. | |
Re: The Java equivalent of a memory leak is when you accidentally keep a reference to an object that prevents it being garbage collected. You would need to apply some incredibly sophisticated analysis to the entire program to have any chance of finding such an error statically. For that reason people … | |
Re: You will have to use a loop that takes every word from the first string, and checks to see if that word is in the second string. The check is trivial, but without any spaces you are going to have fun trying to decide what is a "word" in the … | |
Re: OK, I've done that. Please let me have your teacher's contact details so I can email it directly to him, thus saving you the bother of copy/pasting the solution. You will, of course. fail the course, and maybe get chucked out, but that would be quite reasonable given your attitude. … | |
Re: OK, I've written it. If you let me have your teacher's email address I can submit it for you to save you the bother of copy/pasting it yourself. DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if … | |
Re: That just confirms that you need a multi-pronged test strategy involving users, UI testers, DBAs etc. If your architecture is layered well then backend bugs should have been found during unit testing and subsystem testing. Maybe you are leaving too much testing until too late in the process? ![]() | |
Re: What exactly is theproblem... what is happening that shouldn't or what is not happening that should? | |
Re: No, it's not any kind of Java language assumption. `println` is a method in the `PrintStream` class. (System.out is an instance of PrintStream). It's overloaded for all kinds of parameters, one of which is `char[]`, and that version prints the array as a single String. So the behaviour is an … | |
Re: > I also thought of using an array/stack/queue but filling it is O(N) and then running through that again is another O(N) creating an O(N^2) scenario again ? If there are two steps and each is O(n) then the whole thing is also O(n) - ie when you double n … | |
Re: You need to access each node once, so O(n). The size of the stack is O(log n) so you can ignore that when there's a O(n) component | |
Re: When Apple adopt new technologies they usually do it hard and fast. Don't be surprised to see new hardware or software features getting support in Swift first, then before too long, in Swift only. I say switch too. | |
Re: ProcessBuilder was intended as a replacement for Runtime exec, so maybe that will work, but it is a step backwards. | |
Re: I'll second the vote for UML. Especially use cases -> component diagrams -> class diagrams -> sequence diagrams (the last 3 in iterative loops of course). For low level design I'm more a fan of Scrum (I was principle consultaint in Easel when Jeff Sutherland championed it) - it's an … | |
Re: You can talk here as long as you recognise that whatever you say will be visible to everybody. There are many people here who can give you good advice. | |
Re: rproffitt did help you. (S)he gave you excellent advice. `"Think about how you do this in your head now. Now ... translate that directly to code. If the step can't be translated into code ... break that step down into smaller steps". If you can't describe how to do it … | |
Re: To understand this you need to remember: `int[] arrayA = ...` creates a reference variable `arrayA`that holds a pointer to an array `new int[3]` creates an actuial array of 3 elements so ` int[] arrayA = new int[3];` creates an array and creates a pointer to it. line 2 creates … | |
Re: I think you will need separate code for each subject UNLESS you replace the sub1, sub2 etc with a List or array of subjects - which would be code better anyway | |
Re: Hi Yes, people here will help, but not many will bother to download a zip file from an unknown source! Post your code here (use the `code` button above the editor) and people will read it. | |
Re: There's zero information in that code about where the flag is being drawn, so it's hard or impossible to answer your question. Presumably the missing info is in the various shape classes (MyRectangle etc)? It's also as far from Object Oriented as it's possible to be in Java. Instances of … | |
Re: Considering names like Gary Del Barco vs Sarah Michele Geller, or Richard Wayne Van Dyke vs Doris Mary Ann Kappelhoff (a.k.a.Doris Day), I suspect what you are asking is impossible without the use of human-level A.I. (Not to mention Edda Kathleen van Heemstra Hepburn-Ruston, a.k.a. Audrey Hepburn) | |
Re: Maybe just keep with the calculator for a bit? (Small steps for an easy journey) a) Keep doing multiplications until the user signals "stop", eg by entering zero for eiher number (if test, a loop) b) Offer choice of multiply or divide (Strings, if test) b) Offer add/subtract/mult/div (use a … | |
Re: As far as I know you can't - it's alphabetical. And judging by the lack of responses it looks like nobody has any better answer. | |
Re: Line 144, are you sure the result set is not empty? | |
Re: In Java 8 all your problems are solved! It includes a completely new package for handling dates, times, intervals etc based on everything that was wrong with the old classes, and stealing a lot from Joda time You just need the `ChronoUnit.between` method with two `Instant` objects Theres a really … | |
Re: You seem to be calling those methods as if they were class methods for the `Object` class... which they're not. | |
Re: The compiler has to include all those values in your runtime, so any saving is pretty illusionary. Exactly how many bytes/CPU cyles are you saving? As a percentage of the hardware capacity? How many nanoSeconds per run? Don't waste any more time on this kind of "premature optimisation" and concentrate … | |
Re: Nice try Edson, but this thread is a year old, so your answer is too late. You should also update your Java knowledge. `Class.forName()` became osolete with JDBC4, *ten years ago*! | |
Re: Yes. But you must show some effort first - post what you have done so far and explain why you are stuck so someone can give relevent help. | |
Re: You are using a seriously out-of-date source for your info. The whole Class.forName thing was replaced as of Java 1.4 or 1.5 (Yes, that's more than 10 years ago). Forget the obsolete info you have been given and start again with current Java. Here's the up-to-date tutorial: http://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html | |
Re: You have a spurious `.` between `String` and `id` on line 3 | |
Re: Hello Mynamo. DId you read this thread before replying? See the comment on the previous post. You are 8 years too late. | |
Re: I'm not sure I understand what you are asking, but to call the `getName` instance method of the `ClassA` class you will need an instance of `ClassA`, as in `String s = classAObj.getName();` | |
Re: People here will help, but you must be a lot more specific in your question. We do not know about your current skill level in C#, we do not know what you have done before... | |
Re: Well. I'm following it again now... In my opinion, I would rather waste a few miliisecs of CPU than try to debug some highly optimised code that only works most of the time. CPU is cheap cheap cheap, programmers are expensive, bugs are very expensive, so the simplest program is … | |
Re: Yes you can, IF you learn to program and take the time to think through how to do it. If you would like help with either of those please start your own thread. | |
Re: Looks like `draw` is never initialised. | |
Re: Hi THis is almost identical to the problem you had six months ago https://www.daniweb.com/programming/software-development/threads/498758/tell-me-what-is-wrong-with-this and that was almost identical to an even earlier one a year ago https://www.daniweb.com/programming/software-development/threads/489301/payroll But you seem to be learning nothing, and have made no progress. Your persistence is admirable, but I am afraid that you … | |
Re: You simply put the code for one file into a method, taking the file name as a parameter. Then you can call that method as many times as you like, passing a different file name each time. | |
Re: You need to collect all the data for each row as an array of objects - one element per column, then add that array with `model.addRow(myArrayOfValues);` You can use a Vector instead of an array if that works better for you | |
Re: Hi Az, welcome to DaniWeb. This thread has been dead for a year now, so it's not a good idea to hijack it. Please start a new thread for your question, and someone will help. | |
Re: `compareTo` returns an int... v<w returns -1 v==w returns 0 v>w returns +1 so if v is less than w, `compareTo` will return -1, and line 3 will return `true`. Otherwize `compareTo` will return 0 or+1, and line 3 will return `false`. | |
Re: Yes. The clue is in "You'll want to do this using nested loops." Each loop requires its own loop variable, so your n1, n2, n3 will correspond to 3 nested loops. This won't use any arrays. | |
Re: My advice is never do anything you wouldn't want your friends and family (or clients) to know about. Sooner or later they will find out, and in the meantime you are just living a lie. |
The End.