[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

Memory allocation overflow

JT

1/16/2016 5:59:00 PM

What could possibly overflow in this?

To me it seems just weird

j=1;
while(j<=base){
prime=false;
i=j;
i=i+base;
while (i<100){
primeleg=factor_it(i);
if(primeleg==true){break;}
i=i+base;
}
outStr+="Base="+base+" counterval i = "+i+" P primeleg ="+primeleg+"\n";
j++;
}






The full code below------------------------
<script language="Javascript">

function factor_it(i){
prime=true;
sqroot=Math.floor(Math.sqrt(i));
for (j=2;j<sqroot;j++){ k=i/j; prime=!Number.isInteger(k); if (prime) {return prime}}
return prime;
}

function main(){
base=10;
outStr="";

//while (base==10) {

j=1;
while(j<=base){
prime=false;
i=j;
i=i+base;
while (i<100){
primeleg=factor_it(i);
if(primeleg==true){break;}
i=i+base;
}
outStr+="Base="+base+" counterval i = "+i+" P primeleg ="+primeleg+"\n";
j++;
}

//base++;
//}
document.prime.out.value =outStr;
}
</script>
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>

<body onload="main()" bgcolor="gold">
<form name="prime" action="" onsubmit="MAIN(); return false;">
<textarea name="out" cols=80 rows=80></textarea>
</form>
</body>
</html>
32 Answers

Jeff

11/22/2010 9:50:00 AM

0

On Nov 22, 2:38 am, Fattuchus <fattuc...@yahoo.com> wrote:
> On Nov 19, 10:03 pm, "who?" <yourimageunre...@sbcglobal.net> wrote:
>
> > On Nov 19, 8:18 pm, "abby never again" <tryabbync20012...@yahoo.com>
> > wrote:
>
> > > Okay, it's not the Beatles and it's not even good, but here I am.
>
> > >http://www.youtube.com/user/amber0673?f...
>
> > Oh what the hell: This is me on the piano with some old
> > High School friends singing Hey Jude. Yes, I should have
> > said "Hi-Hat" but with the camera's rolling.........
>
> >    http://www.youtube.com/watch?v=h...
>
> That was pretty good Jeff.  I liked it.

Thanks, Fatt. I should have showed the 2 guitarists how to
play the song, but the guy with the bald head appears to
dislike the song. This was the main reason I put the video
up, to show how people reacted when I mentioned the
Beatles, or played one of their songs. It never went over
well. I was expecting it but had no idea who would have
that type of reaction until it was already video taped.

poisoned rose

11/22/2010 8:52:00 PM

0

Fattuchus <fattuchus@yahoo.com> wrote:

> That was pretty good Jeff.

OUCH. Taking into account Fatty's usual spectrum of vanity-music views
ranging from "lovely" to "beautiful" to "wonderful," holding herself to
"pretty good" is roughly equivalent to me saying "should be destroyed
and never seen again by anyone."

Fattuchus

11/22/2010 11:47:00 PM

0

On Nov 22, 3:51 pm, poisoned rose <pro...@poisonedrose.com> wrote:
> Fattuchus <fattuc...@yahoo.com> wrote:
> > That was pretty good Jeff.
>
> OUCH. Taking into account Fatty's usual spectrum of vanity-music views
> ranging from "lovely" to "beautiful" to "wonderful," holding herself to
> "pretty good" is roughly equivalent to me saying "should be destroyed
> and never seen again by anyone."

Well, that was not my intent. If I thought that "it should be
destroyed and never seen again, etc." I would have said so. I enjoyed
it, and I think it is thoughtful of Jeff to share the performance with
us.

poisoned rose

11/23/2010 12:28:00 AM

0

Fattuchus <fattuchus@yahoo.com> wrote:

> > > That was pretty good Jeff.
> >
> > OUCH. Taking into account Fatty's usual spectrum of vanity-music views
> > ranging from "lovely" to "beautiful" to "wonderful," holding herself to
> > "pretty good" is roughly equivalent to me saying "should be destroyed
> > and never seen again by anyone."
>
> Well, that was not my intent. If I thought that "it should be
> destroyed and never seen again, etc." I would have said so. I enjoyed
> it, and I think it is thoughtful of Jeff to share the performance with
> us.

And the costume ball goes on.

RichL

11/23/2010 12:40:00 AM

0

"poisoned rose" <prose9@poisonedrose.com> wrote in message
news:prose9-070A66.16280322112010@62-183-169-81.bb.dnainternet.fi...

> And the costume ball goes on.

And you're wearing the Dracula outfit again??

The Walrus was Danny

11/23/2010 12:40:00 AM

0

> And the costume ball goes on.

I like the costume ball!

Danny

poisoned rose

11/23/2010 12:47:00 AM

0

RichL did not write:

> > And the costume ball goes on.
>
> I don't dispute your point -- indeed, I'm well-aware of Fatty's "strategic
> "flattery" tactics -- but your comment poses a threat to community pride
> so I'll jump in to toss a cheap personal insult. Whew, I feel better now.

.

RichL

11/23/2010 2:40:00 AM

0

poisoned rose did not write

> Hey, anyone want to sing songs 'round the campfire?

Nil

11/23/2010 2:53:00 AM

0

On 22 Nov 2010, "RichL" <rpleavitt@yahoo.com> wrote in
rec.music.beatles:

> poisoned rose did not write
>
>> Hey, anyone want to sing songs 'round the campfire?

That's an astute observation. This guy doesn't seem to understand the
concept of making music just for the joy of it and enjoying it in the
spirit in which it was offered.

RichL

11/23/2010 2:57:00 AM

0

"Nil" <rednoise@REMOVETHIScomcast.net> wrote in message
news:Xns9E38DEAEE3ABAnilch1@130.133.4.11...
> On 22 Nov 2010, "RichL" <rpleavitt@yahoo.com> wrote in
> rec.music.beatles:
>
>> poisoned rose did not write
>>
>>> Hey, anyone want to sing songs 'round the campfire?
>
> That's an astute observation. This guy doesn't seem to understand the
> concept of making music just for the joy of it and enjoying it in the
> spirit in which it was offered.

Yup.