2,040 Posted Topics

Member Avatar for gikonyo

What is your question related to these JavaScript problems? What effort have you done here besides dumping all problems on the forum? Have you had any answer for these problems? Show us what you have done, and you may ask us to correct or get a feed back on your …

Member Avatar for Taywin
0
73
Member Avatar for eagles39

You will have to make a decision about your cone drawing because you will encounter 2 different types of cone -- odd and even width. If it is an odd width, it is easy to put the tip of your cone in the middle, but how would you deal with …

Member Avatar for Taywin
0
2K
Member Avatar for raider650

Well... It is somewhat straight forward... Though, you can implement this in many ways. You just need to decide and identify which portion of the code is being called many times, and then take that part out and put in a function. Also, the temperature computation part (min, max, average) …

Member Avatar for Taywin
0
99
Member Avatar for Meterior

Because you are using % on its own in every single number, all iterating number is a prime number for you. Try to change j=2;j<=i;j++ to j=2;j<i;j++... Also, you are printing out the number when it is not divisible in your loop which is wrong... What you need is a …

Member Avatar for Meterior
0
94
Member Avatar for manonfire89

You use BankCount in line 385 to disable transaction button if its value is less than 1, but you never increase the value anywhere in your code while its initial value is 0. You need to add your own code to do the transaction (in this case it is subtraction) …

Member Avatar for Taywin
0
218
Member Avatar for djcrab

I am not sure if it is the right way to remove a DOM element by assigning a 'null' value to it. Anyway, your delete function may look like this instead... [CODE] function deleteTask() { var selectedTask = 0; var taskSelected = null; while (selectedTask < document.forms[0].tasks.length) { if (document.forms[0].tasks.options[selectedTask].selected …

Member Avatar for Taywin
0
128
Member Avatar for pikkas

What you need to do is one function to compare the value against the other's option list. One thing you did not clarify here is what you are going to do with the selected option a user has selected before the other select option is changed? My sample code below …

Member Avatar for Taywin
0
124
Member Avatar for merse

There is no 'Exact' double. One way I would do is to work with it in integer or long, and divide it later to get double. Even though, there will always be an error because of epsilon value in computation for approximation, the error should not be cumulative as the …

Member Avatar for merse
0
372
Member Avatar for Checkerboz

If you want a quick test on the class you are working on, add a main method in the class (could be at the bottom of your class implementation). A sample main() definition is below. [CODE] public class Bankaccount { // your class variables declaration // any other methods... // …

Member Avatar for Dhruv Gairola
0
167
Member Avatar for haxtor21

Casting is to convert from one datatype/object to another. In this case, you would do Integer.toString(accID). Refer to [URL="http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html"]Integer[/URL] api for more information.

Member Avatar for haxtor21
0
194
Member Avatar for tech9x

Because you use find() with one space, the end of the string does not have it. As a result, it doesn't see your last word. i.e. "are you".find(' ', 0) ==> found 3 --> print "are" "are you".find(' ', 3) ==> not found --> no print So what you need …

Member Avatar for WaltP
0
118
Member Avatar for ivan3510

You can partially achieve this by using onmouseover event. You can change the CSS of image opacity and border style, but you [b]cannot[/b] change the image's background color using CSS (but you can swap image out).

Member Avatar for hielo
0
119
Member Avatar for CPT

Because you use your nod2 in the loop at line 39 and it becomes Null after it gets out of the loop in line 51. You cannot use it again to get inf in line 52. May be what you mean in line 52 is if(nr<nod3->inf) instead?

Member Avatar for Taywin
0
164
Member Avatar for tehreem

If you are looking for a project topic, this forum may not be the place to ask for. What you need to do is to come up with an idea of what you want to do. Then create a project. To create a project, you must plan what you need …

Member Avatar for stokes1900
0
148
Member Avatar for Isimanica

Next time when you post about problem, please include the detail of error which the compiler is complaining... I cannot remember which C++ compiler requires main() to return int. I used to code them both ways... But on a safe side, declare it as int... Anyway, you are attempting to …

Member Avatar for stokes1900
0
97
Member Avatar for spades0001

Condense it to... [CODE] if (((year%4)==0 && (year%100)!=0) || (year%400)==0) { // leap year } else { // not leap year } [/CODE] *** Note *** This works only with modern year (AD). If you are talking about BC, it is not correct.

Member Avatar for Taywin
0
92
Member Avatar for alastair1008

I agree that the constructor of the NewThread is non-sense... Why would you create a thread and then start it right away. In this case, the thread could have executed the loop inside its own class once before it sleeps in the ThreadDemo class loop...

Member Avatar for Taywin
0
138
Member Avatar for AlvinLiu

I don't really see your recursive method there? What you need is a base case for your recursive method. In this case the base case could be the end of string, and the base case return the number found...

Member Avatar for AlvinLiu
0
742
Member Avatar for kidanr

Mike: You may use CSS to control the div size as followed: [CODE] <style type="text/css"> div.scrollable { height: 200px; overflow: auto; } </style> [/CODE] In this case, you don't need to add 'view more' because the div area will automatically add a scroll bar to the viewing area if the …

Member Avatar for kidanr
0
85
Member Avatar for jems5
Member Avatar for jems5
0
81
Member Avatar for akondray

akondray: As jon said, Char object is not the same as String. Also, instead of trying to check the first char, why not check the whole words? You could use equalsIgnoreCase() method instead. You could take a look at [URL="http://download.oracle.com/javase/6/docs/api/java/lang/String.html"]String[/URL] api also. [CODE] String repeat = "y"; while ( repeat.equalsIgnoreCase("y") …

Member Avatar for Taywin
0
160
Member Avatar for pyprog
Member Avatar for Taywin
0
82
Member Avatar for flyingcurry

You are on the right track. What you really need to work on is your base case. The function should also return an integer in order to be recursive, or you won't be able to compare value returned from the deeper level function call. In this case, there should be …

Member Avatar for Taywin
0
180
Member Avatar for homeryansta

When you are saying 'searching for a box', what does it mean? You want to read in an image and produce another image which contains only the box? Sounds like computer vision. Anyway, you may need to do edge detection first, and then search for the box from the edge. …

Member Avatar for Taywin
0
149
Member Avatar for atramposch

For your while loop, you are accepting 5 strings but you never SAVE any but OVERWRITE it again and again. As a result, you will have only the last string left to work with. What you need to do is to move your for-loop inside line_count while loop but below …

Member Avatar for Taywin
0
335
Member Avatar for timb89

Give any sample data to test it? And what output you get when you enter your sample data? Debugging other's code is not easy; besides, I have already forgotten about the algorithm... Need to read about it again...

Member Avatar for Taywin
0
150
Member Avatar for khurramraja

Old thread... By the way, there are 2 functions in the question... Which one is not working?

Member Avatar for khurramraja
0
78
Member Avatar for nikc121

nikc: Are these codes copied & pasted or you just typed in? There are a couple errors in the codes... [CODE] <a href= "JAVASCRIPT<b></b>:toTOp('chaiscaleigh')">2</a> </p><p> <a href= "JAVASCRIPT<b></b>:toTOp('chloe')">3</a> // You have extra string between javascript call syntax. // It must be javascript:toTop('..') // look at toTOp(), it must be toTop() …

Member Avatar for Taywin
0
203
Member Avatar for steelshark

steel: Your purpose is ambiguous to me. Let see a use case here. 1)A user request to upload an image to the server??? 2)An upload file form is displayed 3)The user selects a file and submit 4)The file is uploaded on the server and a thumbnail of the image is …

Member Avatar for Taywin
0
82
Member Avatar for qbmike
Member Avatar for Hey11

Maybe an array with even element number? Sorted? Unsorted? Instead of thinking as an array, just think as a list of numbers. It is the same, but the different is that array has index while a list of numbers is just a list of numbers. :P

Member Avatar for SasseMan
0
99
Member Avatar for mushahidh

Agree with WaltP. Turbo C is very old and may not work with today hardware. Also, I am not sure that I would see any place still using Turbo C code...

Member Avatar for Taywin
0
154
Member Avatar for Chalandria

When you are thinking about loop, you need to think which part of your code will be rerun over and over again. Then, you plug in a loop and move the code inside your new loop. In your case, it looks like these code lines below are executing over and …

Member Avatar for Taywin
0
137
Member Avatar for Razultull

You could use your servlet to display the pagevia your PrintWriter. Just write a string of HTML head and body to it. Try it by writing some html string to the writer first, so you would at least see what would be displayed on the web.

Member Avatar for Razultull
0
154
Member Avatar for Robban

Hmm... Just got it... What you need may be like this... [CODE] public int max(int[] v) { return helpFindMax(v, 0, v.length()-1); } private int helpFindMax(int[] v, int start, int end) { // This is the recursive method. // Do the search here and return the largest integer. } [/CODE]

Member Avatar for JamesCherrill
0
190
Member Avatar for djcrab

On line 84, you are missing a double quote to close off your onchange event.

Member Avatar for djcrab
0
100
Member Avatar for TheebanRaj

This is not C++ problem, but a logic problem. If you see that there are 3 numbers and 3 possible answers, possibility of involving 3 numbers to produce 3 different answers could be 1)each number may need a logical transformation or 2)pair numbers used in logical transformation...

Member Avatar for Taywin
0
63
Member Avatar for soundman107

Then you need to look at your code on those lines. [CODE] public void setdepartmentName(String Department) { departmentName = Department_Name; // line 65 is here // The problem is that Department_Name is expected to be a variable, // but your function has only Department argument passed in; // as a …

Member Avatar for Taywin
0
100
Member Avatar for mduncan8

I think what you need to do is to take the onload into a variable and run it right away, and then run your function. A sample way to do it is below. [CODE] if (window.addEventListener) { // anything but IE if (window.load) { window.__load = window.load window.__load() // run …

Member Avatar for Airshow
0
214
Member Avatar for Intrade

Too much code for me to look at right now... Going to bed soon... So I will answer only your first question. Your regular expression is incorrect. the {#} is not supposed to be used the way you do. If you want to match 3 of w's, just spell it …

Member Avatar for Taywin
0
249
Member Avatar for jordankaushik

If you have a set of permutations, you could iterate through each of the word and use the word to search in your dictionary. (Use whatever search algorithm you want here, but I would suggest a binary search would be the best because it is sorted -- dictionary.) If you …

Member Avatar for jordankaushik
0
107
Member Avatar for minimi

Which Node class are you using? I am sorry, but I saw only Node interface on [URL="http://download.oracle.com/javase/6/docs/api/"]java 6 api doc[/URL]. I may be out dated... :(

Member Avatar for Taywin
0
112
Member Avatar for Newskin01

I guess you should start from how to read in data from a text file. You could look at [URL="http://www.roseindia.net/java/beginners/java-read-file-line-by-line.shtml"]this example[/URL]. Then what you need to do is to parse the data (all lines after rightSeat line) in those 3 parallel arrays as stated by Ezzaral. While reading the data …

Member Avatar for Taywin
0
803
Member Avatar for dreamslct

You can't just simply set font and color directly to JOptionPane. You need to create objects that can do that in a panel, and then set display. Refer to [URL="http://download.oracle.com/javase/6/docs/api/"]java 6 api[/URL] and look for class api. There are many examples on the Internet. You could search for one easily.

Member Avatar for Taywin
0
200
Member Avatar for sunnyday2010

sunnyday: If the message is not displayed, you may not correctly implement your ajax for the display part. If you do the reload, you will need to solve other subsequence issues; besides, users may have problems working on the page -- the page is automatically refreshed. How do you implement …

Member Avatar for Taywin
0
144
Member Avatar for aro_kai

In your code, you rely on 'read()' method to throw Exception because you do not completely understand the class methods. I believe that the method handles a null File object by returning null. ("If no registered ImageReader claims to be able to read the resulting stream, null is returned. ") …

Member Avatar for aro_kai
0
153
Member Avatar for ivan3510

You are looking for is a functionality in WYSIWYG editor. You may search for window.getSelection() for FF or others, and document.selection.createRange() for IE.

Member Avatar for ivan3510
0
133
Member Avatar for ivan3510

Actually, you could do either way (from fobos posts) depending on how you approach the text. If the text value inside textarea contains known string format and length that cannot be changed, you could use substring method. If you want to search for the substring, you could use regular expression …

Member Avatar for ivan3510
0
82
Member Avatar for Pushpasheela
Re: Java

OK, I'm kind of confused about the purpose of your code... Let see your code... [CODE] public Vector createData() { Vector result = new Vector(); Vector rec = new Vector(); // the line below, where does 'ename' variable come from? Object[] value = new Object[] {"Employee Name",ename.getSelectedItem().toString()}; // rec => …

Member Avatar for Taywin
0
132
Member Avatar for aishittero

Next time, post your error message. Don't just plain asking for help and dump your code on us... Not nice... OK, your code is fine. I could get it compiled and run without a problem (using javac command).

Member Avatar for Taywin
0
84

The End.