2,040 Posted Topics

Member Avatar for youlichika

OK, if I understand you correctly, you want these divs to be placed in a random order, right? OK, I am going to show you only how to use the random and simply write it out directly to the document. However, there are other advanced and better way to deal …

Member Avatar for youlichika
0
193
Member Avatar for merse

I think he/she wants to use the syntax as if it is public. @merse, no, I don't believe you can do that...

Member Avatar for mike_2000_17
0
142
Member Avatar for networkZombie

You should not need any while loop anymore for pennies because there is no 0.1 pennies coin! Change line 86~89 to pennies = change; and see how it works...

Member Avatar for networkZombie
0
207
Member Avatar for baldwindc

Do you have an extra empty line in the file? Or the file just ends right after "fourth 4"? You may try both to see what happen.

Member Avatar for baldwindc
0
1K
Member Avatar for slavacrilov

[QUOTE]when i is equal to zero you are doing i-1 which i'm assuming is causing the error because fullname[-1] is out of range [/QUOTE] I don't think it is a case here because the -1 will drop out of the loop. Though, the issue is where 'i' is being use …

Member Avatar for slavacrilov
0
109
Member Avatar for banana1073

If you are going to do this in recursive way, it sounds like a way to do with scheme (functional language) using CDR. :P Anyway, the idea to do this is... 1)Keep traverse through the list until you hit the last node 2)Return the last node back to the caller …

Member Avatar for jon.kiparsky
0
204
Member Avatar for erum

I'm not sure if this is the case... One possibility, I have a feeling that the new div created has style as 'position:absolute' which allows div to be overlapping and ignores your line break tag. Another possibility (which I have not tested but just think) is that your outer scope …

Member Avatar for Taywin
0
270
Member Avatar for joshisumitnet

Sumit: IE has problem with dynamic setting 'visibility' style property. What you may do is to use CSS instead. [CODE] <style type="text/css"> .showDisplay { display: table; } .hideDisplay { display: none; visibility: hidden; } </style> // javascript part ... var m=1; function DisplayAddComment() { if(m==1) { document.getElementById("dvAddComments").className = "showDisplay" m=0; …

Member Avatar for Taywin
0
1K
Member Avatar for Anuradha Mandal

From what I scan through the code, there are problems as followed: 1) Line 38, you increment 'top' before you do anything else which would cause trouble in assigning value to your array. If you don't see it, look at line 44, you will never assign value to a[0] but …

Member Avatar for Taywin
0
95
Member Avatar for powerteens001

Another simple built-in function is match(). It is similar to indexOf() but it returns a boolean instead. If it found the pattern (string or regexp), it will return true; otherwise, it will return false. [CODE] if("hasNoUnderscore".match(/_/)) { alert("Yes") } // use regexp to match else { alert("No") } if("hasNoUnderscore".match("_")) { …

Member Avatar for Taywin
0
225
Member Avatar for georgy9002
Member Avatar for mtbs1826
0
172
Member Avatar for rajbdilip

Too vague requirement... The easiest way is to use a popup. Try to do it with alert() function first to see if the function is called correctly.

Member Avatar for rajbdilip
0
107
Member Avatar for Beornhelm

Is that the full error trace you got? I would like to see the whole error tract list. The line mention in your error does not match with the code you posted. It is very difficult to pinpoint where the bug is. By the way, is your Enumeration a class …

Member Avatar for Taywin
0
409
Member Avatar for cmccaig

You could try depth first search (DFS) and store every file/folder found in a queue. If the element which is popped from the queue is a directory, go inside the directory and push all files/directories listed inside the directory into the queue. If it is a file, check whether or …

Member Avatar for Taywin
0
964
Member Avatar for jFincan

If you want to do parsing manually from text, read it in line-by-line and try to find an index of the matching open and close tag. Of course, this would assume that all tags are done correctly (no invalid nested tags or no open-with-no-close tags).

Member Avatar for Taywin
0
103
Member Avatar for r3s3v0ir
Member Avatar for burcin erek

You created ps as a pointer, and you are attempt to use pointer of pointer to assign a value... I can't remember the exact syntax for this assignment... I am sure that someone else knows the exact syntax.

Member Avatar for burcin erek
0
179
Member Avatar for jvibez
Member Avatar for MoreBloodWine

Do you mean you want to cooperate 'input' tag with a function call? You can use onclick() event. [CODE] //i.e. in javascript <script type="text/javascript"> function clickItAlready(arg1Str, arg2Num) { alert(arg1Str+":"+arg2Num) } </script> // in HTML <input type="image" src="/stellardonations/paypaldonate.gif" border="0" name="submit" onclick="clickItAlready('my string argument', 777)"> [/CODE]

Member Avatar for MoreBloodWine
0
146
Member Avatar for PeterWaij

Your function 'chk()' takes 2 argument, but when you first call it you passed in only 1 argument -- chk(divs). As a result, the second argument is always null and cause the 'else' statement to be true all the time. Maybe you can try... [CODE] function chk(radioElement) { if (radioElement) …

Member Avatar for PeterWaij
0
138
Member Avatar for philipB

You are reading file in line-by-line. As a result, your name is read correctly (as a string), but the numbers are read as a string as well ("75,85,95,100,44"). What you need to do is to parse the string and break it into numbers. That's all you need to do. If …

Member Avatar for Taywin
0
107
Member Avatar for marieannevi

I am not a mootool user.... I don't know what the library requires... Why would you try to strip the library? It is a risk that you may break it. Also, it is not an easy task to strip a library if you do not understand script... The original file …

Member Avatar for marieannevi
0
80
Member Avatar for Sunshineserene

Your error occurs in line 29 where you attempt to access mydouble[a][b] but you have never initialize mydouble array? This is one of the part that Java spoils those who learn how to program it. The problem is that Java initiates a value to primitive, so some new people assume …

Member Avatar for Sunshineserene
0
2K
Member Avatar for spades0001

If you want only even number while going through, you could do it like... - Check whether the incoming number is an even number -- If it is not an even number starting number (snum) is equal to number+1 -- otherwise, starting number (snum) is equal to number - Iterate …

Member Avatar for apines
0
146
Member Avatar for shakssage

The problem is not the loop, the problem is the regex... I am not sure how to go about it.

Member Avatar for jonsca
0
165
Member Avatar for biggie_011

Do you have to deal with an even number as well? Or there is no such a case?

Member Avatar for apines
0
125
Member Avatar for nettee

nettee: You could use JavaScript to manipulate color, but it would be quite messy. [CODE] // !modified from ryoonnet code above <html> <head> <title>My Table Page</title> <script language="text/javascript"> <!-- function changeColors(colorSet) { switch (colorSet) { case 1: document.body.style.backgroundColor="seagreen"; document.getElementById('firsttable').style.backgroundColor="darkseagreen"; document.getElementById('secondtable').style.backgroundColor="palegreen"; document.getElementById('firsttable').style.border="3"; break case 2: document.body.style.backgroundColor="khaki"; document.getElementById('firsttable').style.backgroundColor="beige"; document.getElementById('secondtable').style.backgroundColor="burlywood"; document.getElementById('firsttable').style.border="3"; break default: …

Member Avatar for nettee
0
86
Member Avatar for CLina

I understand that it is difficult to understand recursive when you learn about it the first time. (I did have difficulty understanding it as well when I first learned about it.) One way to be more clear about it is to follow its iteration and write it down in a …

Member Avatar for CLina
0
5K
Member Avatar for sadsdw

I'm sorry, what is the algorithm to create the matrix? And could you show me your coding part if any?

Member Avatar for Fbody
0
119
Member Avatar for whodoes21

Basically, if you are dealing with error handling which is not from your own program but a user input, do it right after a user enters a value. Each time an input is from a user, check it right away to see whether or not it is correct data type …

Member Avatar for whodoes21
0
208
Member Avatar for aftong

Look at line 9, if your segments value is greater than 1, you will have the same copy of variable inside your 'segment_form'.innerHTML. You are appending the same string up to the number of segments value! Is that what you want??? What is the real purpose of segments value?

Member Avatar for aftong
0
77
Member Avatar for morancr

It does do the job, but your logic is flaw. [CODE] // example if(e >= 0) { Exchange = (exports + e); } else { Exchange = (exports - e); } [/CODE] Look at your code above. Let say Exchange is 0. Now when e is 10, the result for …

Member Avatar for morancr
0
164
Member Avatar for mcdonalds

What's the purpose of getInputContext()? Do you know what is returned? I read its [URL="http://download.oracle.com/javase/6/docs/api/java/awt/Component.html#getInputContext()"]api[/URL] and not sure why you did it that way?

Member Avatar for Taywin
0
95
Member Avatar for hq1
Member Avatar for Taywin
0
123
Member Avatar for insanely_sane

1)What does your 'node' class look like? 2)Because you use both 'head' and 'tail' while you don't completely understand linked list, you make a big mistake when you create a linked list. 3)You are not supposed to create a linked list inside its class! Do the creation outside the class. …

Member Avatar for Taywin
0
3K
Member Avatar for bigwhiteegg

Yes and no. It depends on where you declare the 'list' (not 'List') variable. If the variable is visible in the scope, you can call it in the function; otherwise, you will get an error when you compile your code. You should read about variable scope. [CODE] ///////////////// // 1st …

Member Avatar for Taywin
0
158
Member Avatar for Chalandria

Line 43, you assign value to cel = 0, and then you use it in line 44, you display the text accepted by the user and the cel (0). What you need to do is to accept the text from the user, convert it to whatever value you are supposed …

Member Avatar for Chalandria
0
165
Member Avatar for soccer13

OK, is each string line format always that way? I mean grade which may or may not followed by a sign(+/-), and then a number? If so, what you need is to read in as a line string. Then use split() to split the string using white space as delimiter …

Member Avatar for apines
0
8K
Member Avatar for djcrab

Line 15-17 and 19-21, you can just do... [CODE] var sideAsqrd = A*A; var sideBsqrd = B*B; var sideCsqrd = C*C; var AB = A + B;//side A + B to check if a triangle can be formed var AC = A + C;//side A + C var BC = …

Member Avatar for djcrab
1
4K
Member Avatar for spades0001

You need to swap sum+=ctr; line with ctr++;. Because you increase the counter before you add it, you are adding 2+3+...+11 instead of 1+2+...+10.

Member Avatar for apines
0
204
Member Avatar for nipponsahore

And if it is wrong, what do you do? Your code does nothing but set visibility to false after one answers. Not sure why...

Member Avatar for nipponsahore
0
181
Member Avatar for AlvinLiu

Be careful! In your toString() for Reservation class, you did not initialize 'name' but use it in the method. Also, why do you need to return data after readFile()? Somehow, your data length is greater than 1. As a result, it goes into the loop when you call Sort() and …

Member Avatar for Taywin
0
157
Member Avatar for wobuaini

When time complexity is that way, it is usually related to recursive function (easier to explain). I do not have 5^n example but I have 2^n which is similar (constant^n). Check the fibonaci function time complexity. It has base case: n = 1 assume: T(n-1) = O(2n-1), therefore T(n) = …

Member Avatar for Taywin
0
77
Member Avatar for plasticfood

Looks like your 'fine' is a class's variable. When do you call returnTotalFine()? Have you called it before you call getTicket() in your first post, so the fine is computed before it is being compared?

Member Avatar for Taywin
0
136
Member Avatar for atticusMom

Ach, please use the [ code ] tag to post your code portion. It is very difficult to read a long code without the tag. :( Anyway, you want to get the newest and oldest message of a user by specifying a user name? The way you add messages is …

Member Avatar for Taywin
0
121
Member Avatar for sairakhalid

I don't know what you are trying to do in your code? First, do you completely understand the problem before you attempt to implement it? Second, do you understand how a linked list is created & maintained? Last, your variable names are not meaningful; as a result, it is very …

Member Avatar for Taywin
0
164
Member Avatar for cbsinc

Line 59 to 62, you ask to get user input, but where do you store them? Also, you don't have pepperoni and cheese initialized but use them in your total cost calculation?

Member Avatar for Taywin
0
116
Member Avatar for Shijo Jose

This is too long code and is not inside a code tag... Anyway, it seems that people are having problem with read/write file in Borland. Not sure if this [URL="http://www.yevol.com/bcb/Lesson08.htm"]link[/URL] would help...

Member Avatar for Taywin
0
201
Member Avatar for lykathea

Why do you allow user to pass a number for popping or peeking? When you pop, you always pop the one on the top (or at the bottom in your implementation), and the same is with peek. The only think you need to check when you do pop/peek is the …

Member Avatar for lykathea
0
117
Member Avatar for mangopearapples

Well, the only way to do is on Mac box even though it is Java... Not sure if you can do it on your window or linux box.

Member Avatar for mangopearapples
0
128

The End.