1,678 Posted Topics
Re: I doubt the OP wants to reinstall. And to run malwarebytes he'll probably have to run his machine in safe mode. | |
Re: Java and javascript are not the same languages. | |
Re: If you're just doing number, operation, number, operation, number, etc for example: 5 + 2 * 3 - 1 then you can just use a loop and some function calls. Integer.parseInt() will be useful here and so will the % operator (to decide if the position is odd -- because … | |
Re: Yeah, just specify the entire file path. You can also look into how to use getResource() but it can be difficult. | |
Re: [CODE]((Math.abs(row-empty_row)!= 1) [B]&& (Math.abs(col-empty_col))[/B][/CODE] Why would that work? You are treating the returned value of Math.abs(), which is an integer, as if it can be tested for a truth value. In Java, only boolean types can be tested for truth. So you need to put something like this [CODE]((Math.abs(row-empty_row)!= 1) … | |
Re: I got my Dell custom built and shipped and it took less than 2 weeks .. I guess area may have something to do with it. | |
Re: I don't know if this helps or not but check out Ezzaral's example on post #3 [url]http://www.daniweb.com/forums/thread187103.html[/url] | |
Re: Your regex isn't complicated enough. The first part is correct (although I'd wrap it in parenthesis), but you need a mechanism to read in the text [I]after[/I] the word 'Title:' which can be accomplished by saying (.*) and you also need to make sure the (.*) doesn't read in the … | |
Re: [QUOTE=scripter_tmrage;1194676]so my question is... how can i make it possible to like write 2x^2+3x-1 and then make it possible for me(through the program) to separate all the parts.. sorry didnt write that the language im using is JAVA...thats kind of vital to know ;) [/QUOTE] You're posting in the Java … | |
Re: Go to the directory where HelloWorld.java is located, then use the simpler command. From the command prompt, You can use cd directoryName to change directories on linux and (I think) Windows as well. | |
Re: Haha. I view most of the threads posted in this forum, and I have to admit, I am usually guilty of telling the member 'use code tags' but I rarely hit the report bad post button. I'll do it in the future if it'll make you that happy. :) | |
Re: probably the same as a binary search tree just a guess though, since I've never heard of a decision tree before and it looks like a binary search tree to me | |
Re: [QUOTE=ardav;1190970]and then have the parent(s)/guardians serve the shortfall of an adult-sized sentence?[/QUOTE] If the parent hasn't committed a crime, then they cannot and should not be charged with a crime. | |
Re: Calling a String 'charArray' is pretty confusing to say the least. Anyway, here is an example to clear things up. This puts the first rows of chars into the variable temp. [CODE] char[][] chars = new char[10][10]; //Put some stuff in the 2d array for (int i = 0; i … | |
Re: Thanks guys, you just caused me to open the C++ thread and read 10 pages of Narue and Jwenting schooling Richard West 5 years ago. What a productive night I was supposed to spend writing javascript .... *sigh* | |
Re: The next() method doesn't get an entire line of text, it only gets the next token, which by default, matches whitespace. So if you're reading in English sentences, it will have the effect of reading in a word at a time, not an entire sentence. The nextLine() method can be … | |
Re: Then why don't you do the obvious thing and put print statements in each of those functions, run the example, and see how many things get printed. This hardly looks like rocket science. | |
Re: [CODE] number something = 1234; String s = something + ""; char[] chars = s.toCharArray(); [/CODE] I'm not sure if that will work; you may want to try it though. | |
Re: Use string.split(","); then use a for loop to iterate over the array it returns. Use the Integer.parseInt(string) method to convert each String in the array into an int. | |
Re: What part of the exercise are you having trouble with? | |
Re: [QUOTE=sean12;1194604]I no I need to set up another scanner to read in the users choice but Im not sure how. Please help.[/QUOTE] [CODE] /* An example that's been given hundreds of times */ Scanner keyboard = new Scanner(System.in); System.out.println("Enter one word:"); String input = keyboard.next(); [/CODE] And you should use … | |
Re: How can you expect us to help you when you didn't ask anything? Read your lecture notes. Attempt some answers. Post them here and someone will probably help. I'll usually go out of my way to help someone if they're getting no responses, but if you don't ask a question, … | |
Re: Variable scope. Read about it. The "args" array only exists within the main method, since that is where it was declared (in the method header). If you want to use it from within your ReadFile method, then you had better declare ReadFile as taking a String[] as a parameter. But … | |
Re: It'd be helpful if you showed us the code segment that gave you the compiler error. | |
How can I create a semaphore using the above functions that will allow [I]any[/I] process access to the semaphore? I've been playing around with global variables for hours thinking I was doing it wrong, but now I believe I was misled. I think the problem is that the other processes … | |
Re: Just so you know, the switch statement you have might need 'break' statements after each 'case' statement is over. Otherwise it will execute the code in the other case statements as well. | |
Re: What is the problem? You just start at the last node and work your way back. It is the same code as going forward except you use the 'back' Node instead of the 'next' Node and you stop when back == null and you start at the end instead of … | |
Re: You're trying to call the static method as if it is a constructor. [url]http://leepoint.net/notes-java/flow/methods/50static-methods.html[/url] Read the section on calling static methods. | |
Re: Use code tags and give better information. What do you mean you "hope that's it"? It is relatively easy to pinpoint a problem to a section of code. Did the code before that point execute properly? Did the code after it ever execute at all? | |
Re: [CODE]if (divmod >= 0.0 || divmod < 0.1)[/CODE] One of the above two conditions is always true. You wanted to use the && symbol. [CODE]if (divmod >= 0.0 && divmod < 0.1)[/CODE] | |
Re: Becoming a good programmer isn't about being a genius. Hard work and perseverance are more important than intelligence. A high level of intelligence makes learning easier, but a lower level usually does not make learning impossible. I find it likely that you're being too rough on yourself and your confidence, … ![]() | |
[CODE] wait(mutex); ... body of function ... if (next_count > 0) signal(next); else signal(mutex); [/CODE] I think I understand how semaphores work so I understand the wait(mutex) and signal(mutex) operations but despite a couple hours of reading different materials I don't understand the next_count or the signal(next). From my book: … | |
Re: [CODE]Calendar myCal = Calendar.getInstance(); System.out.println(myCal.getActualMaximum(Calendar.DATE));[/CODE] That works, I just tested it on my machine. And according to the Javadoc, DATE is a synonym for DAY_OF_MONTH so day of month should work as well. Although it won't mess anything up, you shouldn't use your instance variable (calendar) to refer to a … | |
Re: You need to use that random number to index the array. So buttons[randomNumber] | |
Re: You can only refer to array indexes with integers, not ' ' as you have done. To see if an array is completely empty, you need to use a for loop. I believe array elements are automatically initialized to null, so if you want to check if some element of … | |
Re: Print out the value that "f.exists()" returns after you create the file. So do [CODE]System.out.println(f.exists());[/CODE] Also, why are you opening two methods of reading from the file? You created a Scanner and a BufferedReader on the same file. Are you sure that doesn't cause a problem? I wouldn't know because … | |
Re: Many teachers consider it a violation of academic integrity to post your code online, so you should be careful about putting your name on things and about posting exact code if that is the case with your teacher. [CODE]/* *@author Brock Shelton *Date: April 12,2010 *Purpose: Write a lotter class … | |
Re: > I have thought about it, I need to add 2 queues to the packing >>machines because it has to store the food, do I need a queue or is an ArrayList fine? Use Java's Queue class. An ArrayList is not the same thing as a queue; a queue is … | |
Re: [QUOTE=jwenting;1175587]in addition to that, I don't see the urgency.[/QUOTE] It refers to the timeframe in which we ignore his question. | |
Re: Where do you consider one String to end and the next to begin? At a newline character? At a comma? For some other delimiting character or regular expression? For newlines (\n) you can use Scanner and use the nextLine() method, along with a while loop and the hasNextLine() method to … | |
Re: No, teachers should not be paid based on their students' performance. Any accurate measure of performance is impossible to achieve, and teachers cannot force students to learn material, they only present the material. Teachers also cannot be held responsible for factors out of their control such as a wide variation … ![]() | |
Re: [url]http://www.java2s.com/Tutorial/Java/0180__File/CreateBufferedReaderfromFileReader.htm[/url] Try that | |
Re: [QUOTE=WaltP;1146322]What amazes me is each and every company can save you hundreds by switching from one of the others. That basically means you sign up and the insurance company gives you a $300 check! Then you can switch again and get $700 from the new one. It's a really useful … | |
Re: Seems ok to me. Who said it was overkill? (Although I think you should be using the Calendar class instead of Date..) | |
Re: Use System.out.print, '*'s and '\n' | |
My sister has a windows vista machine and I have a windows 7. I want to connect remotely to her machine because she has a viruses, and I helped her track it to 'ave.exe' which is some trojan that edits registry values, starts itself when you start another process, won't … | |
Re: Post code that small in the thread, in code tags. And your code contains no while loops. | |
Re: Use code tags. And you should be able to identify the problem area by debugging. Use print statements to determine the state of your variables at important points in your code. |
The End.