2,040 Posted Topics

Member Avatar for dave013

@strongguy12345, You need to be careful not to give away the solution code. This forum is not for getting solution code but to help other understands what their problem and may give hints to the solution. Giving partial code for the solution is fine as well. However, what you did …

Member Avatar for strongguy12345
0
134
Member Avatar for s_r_k

You could do 2 things - hard code or have default variables as constants. I would use hard-coded for now. Which way do you prefer?

Member Avatar for Schol-R-LEA
0
763
Member Avatar for canarian

You mean to run it? I think Linux already has its built-in file permission system (which is much better than Windows). If you want, you could set up a group permission for the file and add any user you allow to use it into the group. Then in your Java, …

Member Avatar for Taywin
0
95
Member Avatar for manjukakkadath

Hmm... I'm wrong. You could change the ID, but it is not a good idea. You could, however, clone the element and reassign a new ID, then remove the old element and add the new element to the same place. Well, if you want, you could actually use document.getElementById(elementID) instead …

Member Avatar for Taywin
0
166
Member Avatar for manjukakkadath

I could do it using eval() function; however it is a really bad design to create it dynamically. You will have a hard time maintenance your script and other things else in the future. Use array to hold on your data instead of create new variable each time...

Member Avatar for Taywin
0
38
Member Avatar for Dmiller071

OK, do you mean the "right hand rule" is that the robot will always turn right if it can turn right? Or it should try to go through the maze by hugging the wall on the right all the time? If it is the first meaning, it will be very …

Member Avatar for Dmiller071
0
1K
Member Avatar for sidra 100

Look at the API again, saw that the way you create ArrayList is not fit your use. [URL="http://download.oracle.com/javase/6/docs/api/"]http://download.oracle.com/javase/6/docs/api/[/URL] OK, the problem with declaring with no type will result in warning when you compile because you do not check for the raw type. Another big problem is that you have NO …

Member Avatar for Taywin
0
170
Member Avatar for nimka

1)Please use "code" tag next time. 2)How do you define "compute the edit distance between these two files"? What does this mean? Could you give an example? 3)How big each file is? Are you sure that an array size of 3000 would be able to hold all cases?

Member Avatar for Taywin
0
140
Member Avatar for strongguy12345

Your logic of condition is not correct. You are checking the different, not the comparison. It should be... [CODE] else if (guess2!=randomNumber && (Math.abs(guess2-randomNumber)<Math.abs(guess1-randomNumber))) { System.out.println("The number was: "+randomNumber + " ." + " Your second guess was closer."); } [/CODE] However, the design of the program is too much …

Member Avatar for strongguy12345
0
252
Member Avatar for Eneswar

Hmm... I don't know why you need "Cookies" to do the show/hide here? You could simply check whether the checkbox value is checked or not to do the show/hide. Also, you need a separate script to add new checkbox elements. Do you know how to use document.createElement(TagName)?

Member Avatar for Eneswar
0
556
Member Avatar for godfather21

Nope. I don't know what actually causes the error in line 18 and 33. I have no idea what the script is trying to call and got an error of index not found...

Member Avatar for Taywin
0
62
Member Avatar for AODfan

1.You need a loop to do the roll. Currently, you only roll it once and done. 2.You do not have the display part for the value you just row. 3.What does your line 16 [icode]Die(sides)[/icode] do? The "sides" variable is unknown in the function. If you want to create a …

Member Avatar for Taywin
0
317
Member Avatar for hemanth.c

If you must use JavaScript to create, then you may use Cookies to keep the variables needed to mark the state of creation. If you read it from the database, you simply reread the data from the database when you render the HTML.

Member Avatar for Taywin
0
216
Member Avatar for Dmiller071

When I saw the topic, it was about copying. But I am not sure that what you mean after I saw your comment about dereferencing array. Do you want the maze value inside Robot class to be automatically changed when the maze value changed after the maze values are copied …

Member Avatar for Dmiller071
0
293
Member Avatar for jhudielpeco

You are on the right track. You just need to reverse how your loop goes. Look at your inner loop. [CODE] for (int c = 1; c <= size; c++) [/CODE] If you reverse it from [B]incremental[/B] loop value to [B]decremental[/B] loop value with the range from (size-1) to 0 …

Member Avatar for WaltP
0
137
Member Avatar for greenq

The problem is from the bug you introduce in line 58 & 59 as well. When you find the smallest node, you add the node to the new list WITHOUT copying but use the object reference (look at your Node class line 8). Then you modify the node you just …

Member Avatar for Taywin
0
2K
Member Avatar for kei01040

You've already defined the "i" in [code]int i = kbReader.nextInt( );[/code] So you cannot declare it again in for loop as [code]for(int i = 100; i <= 999; i++)[/code]

Member Avatar for Taywin
0
7K
Member Avatar for dark_sider_1

OK, you are implementing a Big int using array list... You may encounter the most difficult part of this assignment in implementation when you hit division. :P Anyway, back to adding and multiplying. First you need the addition to work in order to go on multiplication. To add, you simply …

Member Avatar for Taywin
0
217
Member Avatar for DaniwebOS

Instead of [CODE]if(isPalindrome = false)[/CODE] Change it to [CODE]if(isPalindrome == false)[/CODE] because "=" means you assign the value to the variable while "==" means comparing the value with the variable. However You could do [CODE]if(!isPalindrome)[/CODE] because it is a boolean and you could use it right away as "true" or …

Member Avatar for Taywin
0
165
Member Avatar for plasticfood
Member Avatar for plasticfood
0
177
Member Avatar for TigerTeck

What first, second, third, variable for? You are NOT returning "third" but first+second even though you assigned value to "third" in your checking? You need to modify some in your codes... 1)Change all "third" variable name to "second" in line 43 to 50. 2)Move your code line 52 to 60 …

Member Avatar for TigerTeck
0
331
Member Avatar for chiiqui

Unfortunately, there are so many and could depend on different situation & topic. You may not just keep only one algorithm and discard all others because there could be a situation when one of the others is better than the one you keep. This question is too broad...

Member Avatar for JeffGrigg
0
235
Member Avatar for Stjerne

As JeffGrigg said, how would you relate the deliver() of a Person class with the BikeRack class (3rd code portion)? The rack will never be full? I also do not see anything wrong with other deliver part. I am not sure how you do the rental part? That may be …

Member Avatar for Stjerne
0
831
Member Avatar for hayden11
Member Avatar for Cross213

And what are your errors? I would rather see the code posted here instead of download your files...

Member Avatar for Cross213
0
98
Member Avatar for mike2828

The OP posted one earlier with the same code. Anyway, I think I got what the OP wants. He/she wants to add the part that the program asks user to enter a color value. Then apply the color to the applet background... The code is on the right track, but …

Member Avatar for PkayC
0
182
Member Avatar for jinglylime

Hmm... ObjectElement.setText(""); where the ObjectElement is the text field??? Of course, that means you are using actionPerformed() to listen to the click event of the button.

Member Avatar for jinglylime
0
73
Member Avatar for gyno

[QUOTE]And the right way to call a 'setTimeout()' is: 'setTimeout( funcName, millis )'. Note that 'funcName' is not followed by parens and is not enclosed in quotes.[/QUOTE] It is OK to call setTimeout function with quote -- setTimeout("func()", time) and should not get an error. You could also pass the …

Member Avatar for jmichae3
0
124
Member Avatar for lbgladson

[CODE]Assert.assertEquals("523.5987755982989", sphere.getVolume(5));[/CODE] Equal means equal, but double/float value is an estimate. As a result, the different value could occurs at the level of epsilon. What you need to do is to give a margin of error for computation. If it is double, give it a 1x10^-10 or so.

Member Avatar for JeffGrigg
0
188
Member Avatar for aanders5

Hmm... Are you sure that the quote is in the way you are showing? The reason is that it would be an error on HTML because there can't be double quote inside double quote that way???

Member Avatar for aanders5
0
340
Member Avatar for Hikari123

Are you sure that you need to find for each number from 1 to 1000??? I know that any starting number will eventually reach "1" at the end of computation. Anyway, line 17 should be "else" instead of "if" alone.

Member Avatar for Hikari123
0
843
Member Avatar for DaniwebOS

In your 2nd code, you did it correctly to use a loop, but there are a couple things you need to do with it. 1)You are hard-coded and expect that user will always enter a 5 digit number. As a result, whenever a user enters any string length less than …

Member Avatar for hfx642
0
167
Member Avatar for lorettah

Please do not hijack old post... Also, how did you use your command line to run it? How did you compile your code?

Member Avatar for Taywin
0
96
Member Avatar for dougalmaguire

Please use "code" tag next time... Here is my pure JavaScript version. [CODE] <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Scroller example - jsFiddle demo</title> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script> <link rel="stylesheet" type="text/css" href="/css/result-light.css"> <style type='text/css'> body { width: 960px; } #mainbar { width: 660px; float: left; } #sidebar { width: …

Member Avatar for dougalmaguire
0
114
Member Avatar for woodmaj

OK, I do not have the total idea of how to do it because I have questions about your assignment. Do you have to handle parenthesis as well? Or the user must modify the way of entering the input? [CODE] //i.e. // notice it is not -- (not P -> …

Member Avatar for JamesCherrill
0
537
Member Avatar for GK2011

GK2011, please do not hijack old post. This post is 2 years old! Please create a new thread if you are going to ask a question. You may add a link back to old posts if you want to in order to relate your subject to the post. Anyway, do …

Member Avatar for GK2011
0
127
Member Avatar for pikalife

Depends on how you define your class variable. If you define it as "private" then you must provide a method to access the variable. [CODE] class ClassA { private double a; ... // must provide the access methods public double getA() { return a; } // need this and look …

Member Avatar for stevanity
0
132
Member Avatar for HelenLF

Yes, you could attempt to detect a browser; however, the best way is to redesign and apply Cascade Style Sheet (CSS) to your web page. All major browsers normally follow the CSS rules. Even though there could be some differences (i.e. older IE browser versions and maybe the current version …

Member Avatar for phoenix_2000
0
106
Member Avatar for nospryexpert

Can you test it with a simple Java Script call using [CODE]window.open('sitemap.php','SiteMap','width=640,height=480')[/CODE] to see whether or not IE pop up a new window correctly. If so, then it is the script inside MM_openBrWindow() function that may not be compatible with IE.

Member Avatar for phoenix_2000
0
167
Member Avatar for maria536
Member Avatar for maria536
0
1K
Member Avatar for ITHope

Do you want to display the whole complete Venn diagram? If so, you would need Graphics or Graphic2D to draw the diagram for you. If you want it to be dynamic, you need to redraw (paint) the panel over again once you get a value and computed.

Member Avatar for ITHope
0
539
Member Avatar for knjava2011

Your code is an incomplete code. 1)You have a class "TestClassNumber" with no constructor, but you attempt to create the class instance with a constructor passing in a string? [CODE] public class TestClassNumber { public static void main(String[] args) { ... TestClassNumber sr = new TestClassNumber (series); // HERE? ... …

Member Avatar for Taywin
0
337
Member Avatar for Labdabeta

If I remember correctly, atan() takes radiant value, not degree. The atan2() takes the diff of y and diff of x (y2-y1, x2-x1).

Member Avatar for Labdabeta
0
413
Member Avatar for anand01

OK, here is some info from oracle website for overload. [URL="http://download.oracle.com/javase/tutorial/java/javaOO/methods.html"]http://download.oracle.com/javase/tutorial/java/javaOO/methods.html[/URL] [QUOTE]Overloading Methods The Java programming language supports overloading methods, and Java can distinguish between methods with different method signatures. This means that methods within a class can have the same name if they have different parameter lists (there are …

Member Avatar for anand01
0
190
Member Avatar for gahhon

One more thing... Line 16 in your collection class... [CODE]for(char option = 'Y'; option == 'Y';){[/CODE] What's this for???

Member Avatar for gahhon
0
351
Member Avatar for mike2828

[QUOTE]please tell me what the problem .[/QUOTE] I thought you would tell me what the problem you are experiencing instead of ask me to look through all of your code and try to figure out what it is??? OK, look at this link [URL="http://www.javacoffeebreak.com/faq/faq0052.html"]http://www.javacoffeebreak.com/faq/faq0052.html[/URL]... It may be what you are …

Member Avatar for Ezzaral
0
218
Member Avatar for Amr87

Well, I am a Ruby on Rails (RoR) developer and I do Ruby & Perl scripts as well to assist the background work that Rails cannot do. I also did PHP about 5~6 years ago for about a year. If you are going to compare Ruby and PHP, you should …

Member Avatar for Amr87
0
375
Member Avatar for stangn99

Yes. [CODE] <html> <head> <script type="text/javascript"> function checkSel2(sel1Obj, sel2Id) { var sel2Obj = document.getElementById(sel2Id) if (sel1Obj && sel2Obj) { // loosely check for existence if (sel2Obj.selectedIndex<=sel1Obj.selectedIndex && sel1Obj.value<16) { // not at the last option sel2Obj.selectedIndex = sel1Obj.selectedIndex+1 } else if (sel1Obj.value==16) { // last option in select sel2Obj.selectedIndex = …

Member Avatar for stangn99
0
122
Member Avatar for s_r_k

You are using variables without initializing them. You need to initial the value of avg_temp_hi and avg_temp_lo to 0 before you use them in the loops...

Member Avatar for s_r_k
0
156
Member Avatar for cgen

[QUOTE]What I understand is that the algorithm should traverse through the whole tree and return all entries with the same key. [/QUOTE] Not sure that is a correct assumption. It does not traverse through the whole tree but only the branch of the tree it should go. OK, what is …

Member Avatar for cgen
0
423

The End.