2,040 Posted Topics

Member Avatar for aladar04
Member Avatar for nahidhawk

Your code is very odd. Your first one use 'name' but your second one use 'id'. If you want to get it dynamically, you could use the same 'name' input tag. I am not sure whether you want it or not, so I just reuse your own code. Below is …

Member Avatar for Taywin
0
1K
Member Avatar for azegurb

You may add a global variable to keep the ID of your setTimeout. Then, use that variable to clearTimeout() when onmouseover, but setTimeout() again when onmouseout. [code] //example var t t = setTimeout("slide()", 2500); //in function when onmouseover function mover() { clearTimeout(t) // not sure if you need window.clearTimeout() } …

Member Avatar for azegurb
0
194
Member Avatar for PomonaGrange

This isn't as easy as you think. The reason is that what the input you are expecting? Is there any prevention from illegal input? How about backspace? Do you enter by copy & paste or each key stroke? Anyway, the code below handles only invalid char but not backspace, and …

Member Avatar for fxm
0
3K
Member Avatar for scaryhelmet

Please use code tag (look at the [ code ] in front of your code and [ /code ] at the end (no white space inside, but I put them in just to by pass it). Anyway, for your first part, you do NOT need to do it as complicated …

Member Avatar for macgurl70
0
821
Member Avatar for vilasdhobale

ActiveX is only on IE browser. JavaScript, normally and supposedly, does not have authority to access local drive due to security issue. ActiveX allows JavaScript to access, but the client has to manually accept the action as well. What browser did you test it with? FF? Opera? Not IE?

Member Avatar for Taywin
0
80
Member Avatar for aditya027

Your array is size 10. You are passing in the 'last' number as 10 while your sort seems to look for size 11 (0~10). Remember that array index is 0-index, not 1-index. You need to pass in a number less than size by 1 or do your loop up to …

Member Avatar for NormR1
0
75
Member Avatar for Guest51

You just overload your new toString() method, not override. The toString() method does NOT take any argument. That's why you get the default value of toString(), the method you did not override. Also, any variable used inside toString() should comes from your own class variables. I see that you have …

Member Avatar for JamesCherrill
0
207
Member Avatar for arete

Your way of finding prime has potential to be slow. Your loop size could be at most the size of square root of the number you are finding. For example, you are checking whether 123 is a prime. Your loop size should go up to 11 and return true. If …

Member Avatar for Taywin
0
153
Member Avatar for RaniThomas

If the main() method is there but no code inside, you should be able to run the class fine, but it will produce nothing. Usually, if I have main() method in a class object, I would implement quick tests for the class's functionality to see whether or not the class …

Member Avatar for Taywin
0
158
Member Avatar for jkaye

How do you call Javascript in your HTML? Your validation will let empty string (contains only white spaces) pass because you are checking on var=='' but not var==' '. You should trim all strings you are checking before you do the validation, or you intend to let empty string to …

Member Avatar for Taywin
0
2K
Member Avatar for empror9

[QUOTE]last question , can anybody show me the diffrernt in calling by value or refrence in my code?[/QUOTE] If I remember correctly (for C++), you need to add '&' in front of variable type in the function prototype in order to change from calling by value to calling by reference. …

Member Avatar for empror9
0
133
Member Avatar for HAIDER69

[QUOTE]But i have a question... now what i am currently trying to do is to transmit difference of radar_picture_array and radar_picture_array_old_transmitted which will be filled/mapped with values,strings once first radar_picture_array will be transmitted completely,also at reciever side radar_picture_array_recieved will be added to radar_picture_array_recieved_old to recover the original array that was …

Member Avatar for HAIDER69
0
3K
Member Avatar for lf.gene

Depends on how you add it. If you add it as innerHTML and compose function calls with text, you could do that. If you add it with element creation, you could do it too but would be a little bit different way of adding function call to the page. It …

Member Avatar for lf.gene
0
181
Member Avatar for empror9

The varible *= x means variable = variable * x. It is a short version. Also, 1 multiples with a number is equal to the number, so the loop could start from 2 without changing the result. For question #2, drawing a flowchart means you do it by hand, not …

Member Avatar for Agilemind
0
349
Member Avatar for student.09

[QUOTE]We have been hired to write a program to determine the number of cases required to store boxes of cookies. A case of cookies can store 10 boxes of cookies. The user of the program will enter the number of cookies that have been purchased. The program should print out …

Member Avatar for NP-complete
0
117
Member Avatar for vbx_wx

Doubly linked list should never point to a NULL. The sort method above needs a little modification. [CODE] struct node { node* next; node* prev; Person p; }; void sort(node* head) { node* n1; node* n2; for(n1 = head; n1->next != head; n1 = n1->next) { for( n2 = n1->next; …

Member Avatar for dusktreader
0
3K
Member Avatar for jt86442

[QUOTE]Please help me the code.[/QUOTE] Please do your own code, not come here to ask for code. The forum is to help you fix your code, not to do your own homework... By the way, the 'read only' means 'disable' or really means 'read only'. There are two different things. …

Member Avatar for jt86442
0
82
Member Avatar for jemimaloh

You do not understand how the algorithm go or you do not understand how to apply Java to it??? If you do not understand the algorithm, you could look at [URL="http://en.wikipedia.org/wiki/Geometric_hashing"]wikipedia[/URL]. If you do not know how to apply Java to the algorithm, that may need a little more work …

Member Avatar for jemimaloh
0
116
Member Avatar for cfcid

[CODE] int n; int i, j, sum; int[] a; Scanner sc = new Scanner(System.in); // create a scanner object for reading in n = sc.nextInt(); // accept only integer from user input sum = 0; // initialize sum of value a = new int[n]; // create integer Array size of …

Member Avatar for prisonpassioner
0
94
Member Avatar for zaphytaffy

Sounds like you are implementing a text-based game... Anyway, a suggestion is that you should use HashMap instead of 2 arrays. The reason is that HashMap will map your attribute name with a value (in this case is an integer). Using 2 arrays could create a mess later on because …

Member Avatar for zaphytaffy
0
280
Member Avatar for emcyroyale

If a function is void, the only way you can display the result is to write to console immediately right after the calculation. In this case, while you are displaying each row, at the last column, which is the letter grade, call the function (may pass in total score depending …

Member Avatar for Taywin
0
113
Member Avatar for dalip_007

Ajax maybe? Or just a simple javascript rewriting at certain area for certain length of time? Can't tell you exactly because you do not provide a link to a sample page you are talking about...

Member Avatar for dalip_007
0
79
Member Avatar for idblack

If you do not want to have another array, sort the array first, and then do it as followed: [CODE] aArray <- a sorted array head <- 0 tail <- array.size() - 1 while head < tail swap aArray[head] with aArray[tail] increment head by 1 decrement tail by 1 [/CODE] …

Member Avatar for Taywin
0
169
Member Avatar for ttboy04

Not sure if you really want your methods to be static. I do not know how you call these methods. Maybe, taking 'static' keyword from method may be another way to make it work. By the way, I have no clue with anagramTable variable. Though, as stephen84s said, there may …

Member Avatar for Taywin
0
161
Member Avatar for sofia24
Member Avatar for Taywin
0
421
Member Avatar for Towlie

I think line 42 should change from [CODE]myButton.onclick = addRadio;[/CODE] to [code]myButton.onclick = addRadio(questionNum);[/code] And then, you should change your function addRadio to take a question number argument. The reason is that your questionNum variable is a global. After you add a button, the variable value is increased. As a …

Member Avatar for Taywin
0
247
Member Avatar for yap_1991

Here is a simple way but not very efficient due to space required. [CODE] String[] words = lineString.split("\s+"); // use white space at least 1 between words int wordSize = words.size(); String firstWord="", lastWord=""; if (wordSize>0) { firstWord = words[0]; } if (wordSize>1) { lastWord = words[wordSize-1]; } [/CODE]

Member Avatar for masijade
0
609
Member Avatar for whiteyoh

You could use setTimeout() or setTimeinterval() in order to keep calling your Ajax script function (showHint()). You could change the bottom of your page from [CODE] <script type="text/javascript"> showHint("") </script> [/CODE] to somewhat like (not the best coding, but just to give you an idea) [CODE] <script type="text/javascript"> function keepCalling() …

Member Avatar for whiteyoh
0
124
Member Avatar for madzam

Please read or find code convention to follow because your code is very difficult to follow here. Also, please explain what your code is doing when you ask for help. Even better, give an example of input and expected output. [CODE] Base_Cost = 250 + 0; Area = Length * …

Member Avatar for nbaztec
0
115
Member Avatar for asad_80

Just change code in actionPerformed() method from [code]jButton[i].setIcon(...)[/code] to [code]jButton[z-1].setIcon(...)[/code] The reason is that you are using 'i' as index and now 'i' value is the length of JButton objects. You picked the value from the button, but not use it in your call. Also, it has to be z-1 …

Member Avatar for NormR1
0
146
Member Avatar for darksmokepunch

Indeed, it is unclear... Also, you are asking for brain storm here... I am not sure if this would be the right forum for you even though it is going to be C++. What I mean is that this forum is for answering question about C++, but not about designing …

Member Avatar for darksmokepunch
0
127
Member Avatar for darelet

From the look at the code, I believe you are working on computer vision project doing edge detection or such. Anyway, I would take a closer look at how you implement populateMatrix() which is called before your first error you found. The reason is that these functions could have changed …

Member Avatar for mitrmkar
0
383
Member Avatar for shadiadiph

What do you want to match? You could just add a comma in it. Though, I'm not sure if the regexp you are using really covers all cases you want. [code] var regname=/^[A-Za-z,\.\-'\s]*$/ [/code] Not sure what you are trying to match for... You use * which means you also …

Member Avatar for shadiadiph
0
257
Member Avatar for gurpreet_ka

Not sure... Have you tried [code] window.open('."+tempFileName+"','myWindow').print() [/code] instead of assign window.open to printWindow, and then call print()?

Member Avatar for Taywin
0
108
Member Avatar for djenoe

I have updated some of your code, but it is not perfect. There are too many things that need improvement or reorganize your thought. I can see that you are new to the language. I am not sure that you are learning it the right way... You need more reading! …

Member Avatar for javaAddict
0
137
Member Avatar for respondto

If your code gets very long each line, you may need to reconsider how you code it or how your variable name should be. Yes, there may be a way to speed up or optimize your code by putting it in one line, you are trading off with its readability. …

Member Avatar for NathanOliver
0
2K
Member Avatar for deez2183

Next time, please wrap your code around with the code tag. It would be easier to read. [CODE] #include <iostream> using std::cout; using std::cin; using std::endl; int count; int score; int getScore(); // function prototype void printGrade( int score ); // function prototype int main() { for ( count = …

Member Avatar for deez2183
0
469
Member Avatar for kiranpvsr

You may need Graphics and Graphics2D classes. Then, you may want awt and/or some swing classes depending on your style of coding. Use google and search for sample code for graphic 2d.

Member Avatar for Taywin
0
73
Member Avatar for shadiadiph

I agree with fxm. Anyway, there are many ways to do this. One way to do this is to write and delete message from your main HTML. Assuming that you have a div "loading" element inside your main HTML. At the top of your Ajax call function, you could put... …

Member Avatar for shadiadiph
0
130
Member Avatar for Kanoisa

In my opinion, I don't think it is different for anyone who works on large project. The only different is how you prepare for a project. In pure computer science, there is no class that teach you how to create or develop a large project, but you learn about how …

Member Avatar for Bench
0
144
Member Avatar for CSherman

Also, you are incrementing counter inside the loop! Take the line that increment counter out of for-loop. The for-loop automatically increase the variable counter used for the loop. You are not supposed to increment it yourself unless you want to do certain skipping. Yet, you should use while loop instead …

Member Avatar for Taywin
0
129
Member Avatar for Dorayaki

Does the select() method supports multiple selection? Anyway, you are not searching through the whole string but stop at the first occurrence found. [CODE] int start = jTextArea1.getText().indexOf(search); if (search != null) { jTextArea1.select(start, start + search.length()); jTextArea1.requestFocus(); } [/CODE] Should try this... [CODE] int start = jTextArea1.getText().indexOf(search); while (start>-1) …

Member Avatar for Taywin
0
99
Member Avatar for feodal

You are trying to write an automated script that can access other servers that are not your own. Not sure if this is possible with JavaScript or Ajax unless your server open a hole in order to get access to other servers that way. If I have to do this, …

Member Avatar for aladar04
0
70
Member Avatar for Tom Desuza

Sorry, I am not going to register on the site... But one suggestion that you may need to look for is to escape string before you pass into any function. Normally, the string contains special characters, especially single or double quote, that JavaScript may not end correctly. To me more …

Member Avatar for Taywin
0
996
Member Avatar for xdeja

You could add as while (stones is >= (the number of stones left in the pile divided by 2) and the number of stones left in the pile is > 0) This case, you should not need the break in the loop.

Member Avatar for Taywin
0
4K
Member Avatar for Inny

What browser are you using? Have you tested on all IE, FF, Opera, etc? When you said 'has stopped working properly', does that mean it has been working before? Or it has never been working at all?

Member Avatar for Inny
0
483
Member Avatar for sfuo

Have you tried to create font directly from CreateFont() instead of using CreateFontIndirect()? Also, why this [code]hFont = CreateFontIndirect( &logfont );[/code] becomes [code]font.name = name;[/code]

Member Avatar for sfuo
0
336
Member Avatar for djenoe
Member Avatar for Victor C.

Your code here doesn't work the way you want because your count is 5 after it gets out of the loop. As a result, the Random[5] is out of bound. [CODE] if (source == cButton) Random = new int[5]; int count = 0; double average = 0; int Max = …

Member Avatar for NormR1
0
195

The End.