2,040 Posted Topics

Member Avatar for godaged

>insisting that the rating supplied by the user be valid This part is somewhat not sure for me (the language). Does it mean your program has to also validate the validity of the user input, or the user will always enter a valid input???

Member Avatar for godaged
0
198
Member Avatar for mukororokudo

>1.take input It means your program should prompt users for an input. The input means a user type in whatever value you expected using keyboard. >2.calculate average After you obtain all needed values (all grades/scores of a student), you calculate using mathematic equation to get the result. In this case, …

Member Avatar for Taywin
0
209
Member Avatar for esparkinfo

The variable *i* in your first script is out of scope. As a result, the function attached to the onclick does not correctly access to the variable value. The second one is a closure and is properly use. You need to read more on variable scope and closure...

Member Avatar for Taywin
0
228
Member Avatar for hiyatran
Member Avatar for goldentuna

You may try to replace symbols... Not sure but please try //After line 41 in handleResponse(), add this... strResponse = strResponse.replace(/</g, "&lt;").replace(/>/g, "&gt;");

Member Avatar for Taywin
0
399
Member Avatar for greenbluekidz

There are a lot of ways to do what you are explaining. It depends on how you design & layout... Some may use JQuery, but I prefer primitive JavaScript. :P Below is a simple example... <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> div.hideContent { display: none; visibility: hidden; …

Member Avatar for greenbluekidz
1
1K
Member Avatar for programmer12

Hmm... Have you implemented an ajax call yet? I mean just one ajax call to replace certain data on the page. If you could do it even once, then it is easy to implement the auto-call using setTimeout() at the end of the success call portion. An example of ajax …

Member Avatar for programmer12
0
109
Member Avatar for fgregory54

What is line 28??? If you want to use the onchange event, you need to put/attach the event to the *select* tag. To me, it looks like the code line is hanging inside, not one of the property of the *select* tag... //i.e. <select id="blah" name="dbl_blah" onchange="ChangIt('arg1')"> ... </select>

Member Avatar for fgregory54
0
185
Member Avatar for cmsc

Don't think the OP is adding an iframe element to the form, but adding it to the form's parent element. But your suggestion is valid that using getElementById() function to obtain the element from the DOM. Anyway, back to the OP... Do you have a form tag name "form"?

Member Avatar for otengkwaku
0
125
Member Avatar for DanOath

Or... irb(main):001:0> (Array('A'..'Z')|Array('a'..'z')|Array('0'..'9')).each do |letter| irb(main):002:1* puts "#{letter}\t\t#{letter[0]}" irb(main):003:1> end Or... irb(main):001:0> (Array('A'..'Z')|Array('a'..'z')|Array('0'..'9')).each { |letter| puts "#{letter}\t\t#{letter[0]}" }

Member Avatar for Taywin
0
142
Member Avatar for gcclinux
Member Avatar for Taywin
0
265
Member Avatar for applepie-0167
Re: java

Huh? This is JavaScript forum. You should go to [this forum](http://www.daniweb.com/software-development/java/9) instead. To answer your question, it said that you to create 2 String variables. Assign the value "COMPUTER PROGRAMMING" to the first one, and then iterate through a loop using the first variable length in reverse order. Inside the …

Member Avatar for Taywin
-1
112
Member Avatar for OsaidAz

The nested loop is used as others said (to traveral through a 2D array). Outside of the loop should be a variable holding the total number you are going to change inside the array (and should be greater than 0). Also (one way to exit a nested loop), have a …

Member Avatar for OsaidAz
0
146
Member Avatar for bLuEmEzzy

I would say check if the value is a number using isNaN(something) -- is Not a Number. If it is a number, it would return false; otherwise (including null), it will return true.

Member Avatar for bLuEmEzzy
0
154
Member Avatar for Paulxh

If you want it to be done locally (client), Cookies is the way to go. Though, I don't prefer to use it because it is manipulatable by the client unless I don't care for securities. Preferably, server side work is appropriate for most cases.

Member Avatar for otengkwaku
0
264
Member Avatar for utchia

How about update your `System.out.println(title);` to `System.out.print(title+" ");` instead? Also, just insert `System.out.println();` wherever you want to have a new line.

Member Avatar for Taywin
0
236
Member Avatar for Rami Sohail

There are couple mistakes in your code... 1) When you said first 2 rows, in array data type, it means 0 & 1 indices because array uses 0 index (value from 0 up to array_length-1). In your code, line 17 for example, is going through 0, 1, and 2 which …

Member Avatar for Taywin
0
4K
Member Avatar for babi.meloo

You are on the right track. You attempt to check for digit number using indexOf() method which is wrong. In your loop, get rid of indexOf() method but use charAt(i) instead. The returned value of the charAt() method is a char which could directly be compared (using == symbol) with …

Member Avatar for NormR1
0
3K
Member Avatar for theguitarist

>But what if I've included the same "file.js" in many html files? >Will it do the same stuff independently to each of the html files? > >And one more question : >How right is it put all the javascript code in the <script> tags of the html file? >Is it …

Member Avatar for Taywin
0
221
Member Avatar for bettybarnes

The requirement needs to be clarified first. What is the expiry date if the end date is July 31? Would it be September 30? Or would it be October 1?

Member Avatar for Taywin
0
195
Member Avatar for babi.meloo

If you want to keep asking for playing again, you need another loop around it. Either let users get out of the loop by saying 'n' or not equal to 'y' is your choice. You already know how to use while-loop in your case. You could simply add another while-loop …

Member Avatar for Taywin
0
4K
Member Avatar for Chuckleluck

Do you know the value of the current rotation angle of the image when space is being pressed? If you could obtain such value, you can simply compute the point by doing the [point rotation](http://en.wikipedia.org/wiki/Rotation_%28mathematics%29) using the center of the image as the origin point.

Member Avatar for Chuckleluck
0
156
Member Avatar for nsharif

I see no problem with adding unlimited button to a panel and let it extend down the display while you can still scroll down. However, too many buttons may cause you problem, so you may need to redesign the layout of what you are doing. So could you please show …

Member Avatar for nsharif
0
236
Member Avatar for jonsan32

Wouldn't this part ry=Math.floor(Math.random()*myimages.length) if (ry==0) { ry=1 } is equivalent to... ry=Math.ceil(Math.random()*myimages.length) *Edit:* Wait... My bad... The former gives higher propability (twice as high as others) to the first image (1) and not select the last image (6), but the latter gives equal propability to each image including the …

Member Avatar for jonsan32
0
419
Member Avatar for rhowell

Are you attempting to create your own customized binary file? This is the freedom of binary file format because it could be different from one to others. Usually, a binary file contains header information, and it could be anything depending on what format it is and who creates it. Is …

Member Avatar for rhowell
0
164
Member Avatar for praveen_dusari
Member Avatar for Taywin
0
200
Member Avatar for coding101

What do you mean by knowing if it is done? Didn't you also send your packet with the length of the packet itself (using DatagramSocket)? If not, could you post the code portion of server & client?

Member Avatar for JamesCherrill
0
111
Member Avatar for summey

You could try to catch all Exception, but in your case you should try NumberFormatException because it is direct to the exception thrown when a string is not a number is being parsed. PS: If a user enters "+123" as an input, do you consider it as a number or …

Member Avatar for summey
0
1K
Member Avatar for techyworld
Member Avatar for vijaykavin10

>is there any way to allow third party on safari even if privacy setting set to block third party If a user sets to not allow third party cookies on the browser, why should there be a way to work around that? The only way I can think of is …

Member Avatar for Taywin
0
152
Member Avatar for saifali.malik.33

Not going to look at your code. Will answer from the header... To do that, you just need to check whether or not the new element (text field) has been added to the page. If it already exists, don't add a new one. A simple way to check is to …

Member Avatar for stultuske
0
145
Member Avatar for joseph.henriquez

Line 34, you are returning *roll* variable but you didn't have anything to do with the variable inside the method. The method is supposed to build up a String and return it?

Member Avatar for Taywin
0
154
Member Avatar for revertedlogic

You will have a hard time finding all of them. You have both missing and extra curly bracket. The first one is inside your scene2() method. if(choice2.equalsIgnoreCase("FIGHT")) { //User fights if(sword == true || axe == true) { //If the user has a weapon System.out.println("It seems that you have a …

Member Avatar for Taywin
0
248
Member Avatar for dantheman4

\#1 You are correct if and only if the question is not about writing a program. In other words, true && true is the same as (true || false OR false || true) in programming. The question ask which expression is true and that is ambiguous to me. \#2 Two …

Member Avatar for JamesCherrill
-1
159
Member Avatar for crownedzero

If you are using an array already, you could do a sort and get the index in the middle for splitting as well. The algorithm has bigger Big O and a bit more complex but requires less space use in the process.

Member Avatar for Taywin
0
220
Member Avatar for sk8ergirl
Member Avatar for mKorbel
0
793
Member Avatar for Theanonymous

1)I don't know what Stock Span algorithm is. Don't dump the psudo code and ask me to understand it. 2)This is your assignment to implement an algorithm to do it. There is no afford from your side shown here. Please work on it first, not just dump the original question …

Member Avatar for jyotiswaroopr
0
455
Member Avatar for bigredaltoid

If the data shown in your post is what it read in, the region checker should return true because it is valid (there is no duplicated number in the 3x3 sub array in the example)...

Member Avatar for Taywin
0
379
Member Avatar for Darshan5

Just remember, programming & managing are two different skill sets. One is to be able to follow requirements and do it right, and the other is to control and make it work. Some may have only one of the skill sets, and some may be capable of acquiring both skills. …

Member Avatar for geresespina
0
133
Member Avatar for minimee120

There are a couple problems in your code. 1) Line 19, you do NOT need a for loop to check the existence of a substring inside a string. The only occasion you need a loop is when you check each character of a string one by one. 2) Line 21, …

Member Avatar for NormR1
0
2K
Member Avatar for ToneZ

How did you enter when the question shows up? Do you understand what nextInt() mean? When you use nextInt(), the input is expected to be an integer (i.e. 234, 123), not a decimal number (i.e. 25.45, 100.0). If your input is not followed the integer format, you will get an …

Member Avatar for Taywin
0
318
Member Avatar for rrr12345

Develop something in AI field? It is really heavy in algorithm, maths, and statistics. The future of this field is quite well.

Member Avatar for Taywin
0
283
Member Avatar for minimee120

>Having some trouble And what is your trouble with it??? By the way, you should keep everything inside one *try* and have multiple *catch* instead. Something similar to below (adjusted from your original code). import java.util.*; // import scanner import java.io.*; public class Homeworkhelp3 { public static void main(String[] arg){ …

Member Avatar for Taywin
0
140
Member Avatar for subrata_ushasi

If you want to create your own autocomplete from scratch using javascript (and using backend), look for *observefield* and *Ajax* to do the work. The ajax part will return proper (sorted) data to create a selection list. I did the same thing at work.

Member Avatar for JorgeM
0
173
Member Avatar for Pervex

>I want to have option multiple select to remove the data from list box Please clarify this sentence. Do you mean you want the select box to become multiple selection, and then remove all of those selected options? Or else???

Member Avatar for Taywin
0
224
Member Avatar for robert.rook.501
Member Avatar for Taywin
0
309
Member Avatar for ali11

>symbol : class ArrayList >location: class DynamicArrayOfInts >ArrayList list3 = new ArrayList(); Right there. You need to import ArrayList to your program. At the top of the program where you have `import java....;` lines in your DynamicArrayOfInts class, add one more line as `import java.util.ArrayList;` to the import...

Member Avatar for Taywin
0
245
Member Avatar for RAPTOR88

>cents = (int) (((change - dollars)\*100) + 0.5); How about change this line to... cents = (int) ((change*100.0) - (dollars*100)); and see what happen?

Member Avatar for WaltP
0
350
Member Avatar for ratanji
Member Avatar for Taywin
0
152
Member Avatar for nitin1

>means lowest substring should be at the top most point. So how to do that ? string can be of large length. How to do this thing ? can you please give hint or link ? So you want to know how to sort String in the way to use …

Member Avatar for mrnutty
0
161

The End.