Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27740 > unrolled thread
| Started by | jonas.thornvall@gmail.com |
|---|---|
| First post | 2015-05-18 13:34 -0700 |
| Last post | 2015-05-18 17:35 -0700 |
| Articles | 13 — 4 participants |
Back to article view | Back to comp.lang.javascript
Find loop where iteration *lock up* jonas.thornvall@gmail.com - 2015-05-18 13:34 -0700
Re: Find loop where iteration *lock up* jonas.thornvall@gmail.com - 2015-05-18 14:00 -0700
Re: Find loop where iteration *lock up* Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-18 22:25 +0100
Re: Find loop where iteration *lock up* jonas.thornvall@gmail.com - 2015-05-18 14:58 -0700
Re: Find loop where iteration *lock up* "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-05-18 14:53 -0700
Re: Find loop where iteration *lock up* jonas.thornvall@gmail.com - 2015-05-18 15:18 -0700
Re: Find loop where iteration *lock up* jonas.thornvall@gmail.com - 2015-05-18 15:40 -0700
Re: Find loop where iteration *lock up* jonas.thornvall@gmail.com - 2015-05-18 15:42 -0700
Re: Find loop where iteration *lock up* Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-05-19 01:20 +0100
Re: Find loop where iteration *lock up* "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-05-19 02:54 +0200
Re: Find loop where iteration *lock up* "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-05-18 17:36 -0700
Re: Find loop where iteration *lock up* "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-05-18 17:33 -0700
Re: Find loop where iteration *lock up* "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-05-18 17:35 -0700
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2015-05-18 13:34 -0700 |
| Subject | Find loop where iteration *lock up* |
| Message-ID | <da232fe8-7356-4ae5-a6a3-24d4041b494b@googlegroups.com> |
Is there a way to trace where an iteration do lockup in a javascript? Could they not printout the row executed when you break script?
[toc] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2015-05-18 14:00 -0700 |
| Message-ID | <5acca82a-d227-410d-a4cf-2fd1fb568a49@googlegroups.com> |
| In reply to | #27740 |
Den måndag 18 maj 2015 kl. 22:34:31 UTC+2 skrev jonas.t...@gmail.com: > Is there a way to trace where an iteration do lockup in a javascript? > Could they not printout the row executed when you break script? I've put console.log(¨1¨),console.log(¨3¨),console.log(¨3¨), etc within all while loops. Is there anything i further can do to find out where it lockup?
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2015-05-18 22:25 +0100 |
| Message-ID | <874mn9lgrp.fsf@bsb.me.uk> |
| In reply to | #27741 |
jonas.thornvall@gmail.com writes: > Den måndag 18 maj 2015 kl. 22:34:31 UTC+2 skrev jonas.t...@gmail.com: >> Is there a way to trace where an iteration do lockup in a javascript? >> Could they not printout the row executed when you break script? > > I've put console.log(¨1¨),console.log(¨3¨),console.log(¨3¨), etc > within all while loops. > > Is there anything i further can do to find out where it lockup? Most systems have some form of debugger. I can't help much with how to use them because I prefer to use lots of tests. Your code is almost untestable because all the parts are tied together through globals. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2015-05-18 14:58 -0700 |
| Message-ID | <37baacaa-ffd8-4ae9-bce6-159aa00d97c8@googlegroups.com> |
| In reply to | #27742 |
Den måndag 18 maj 2015 kl. 23:25:51 UTC+2 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > > > Den måndag 18 maj 2015 kl. 22:34:31 UTC+2 skrev jonas.t...@gmail.com: > >> Is there a way to trace where an iteration do lockup in a javascript? > >> Could they not printout the row executed when you break script? > > > > I've put console.log(¨1¨),console.log(¨3¨),console.log(¨3¨), etc > > within all while loops. > > > > Is there anything i further can do to find out where it lockup? > > Most systems have some form of debugger. I can't help much with how to > use them because I prefer to use lots of tests. Your code is almost > untestable because all the parts are tied together through globals. > > -- > Ben. Well i decided to make a counter within main, from what i can see it do not lockup on bases less than 10 and it is sporadic but the higher the base and higher the number the higher chance for loop lockup. So using base 11 and counter from 1 to first lockup number, and take it from there.
[toc] | [prev] | [next] | [standalone]
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
|---|---|
| Date | 2015-05-18 14:53 -0700 |
| Message-ID | <fc7a62f5-142e-47fc-bec9-0aa3e613f36d@googlegroups.com> |
| In reply to | #27740 |
On Monday, May 18, 2015 at 3:34:31 PM UTC-5, jonas.t...@gmail.com wrote: > Is there a way to trace where an iteration do lockup in a javascript? > Could they not printout the row executed when you break script? In the Firefox debugger you can tell it to pause on exceptions. I suspect the other popular browsers support this functionality as well.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2015-05-18 15:18 -0700 |
| Message-ID | <2be4ebc1-2b4f-4743-9009-f3136580289d@googlegroups.com> |
| In reply to | #27743 |
Den måndag 18 maj 2015 kl. 23:53:56 UTC+2 skrev Michael Haufe (TNO): > On Monday, May 18, 2015 at 3:34:31 PM UTC-5, jonas.t...@gmail.com wrote: > > Is there a way to trace where an iteration do lockup in a javascript? > > Could they not printout the row executed when you break script? > > In the Firefox debugger you can tell it to pause on exceptions. I suspect the other popular browsers support this functionality as well. I just implemented a counter, and get strange maybe even impossible result. I use base 11 and start to convert from 0 using a counter. But the program decides to loop at different numbers at different executions, is that even possible? Javascript is not threaded, it is linear execution?
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2015-05-18 15:40 -0700 |
| Message-ID | <11cf284d-7d4d-496b-a104-b8e4c00f2339@googlegroups.com> |
| In reply to | #27745 |
Den tisdag 19 maj 2015 kl. 00:19:02 UTC+2 skrev jonas.t...@gmail.com: > Den måndag 18 maj 2015 kl. 23:53:56 UTC+2 skrev Michael Haufe (TNO): > > On Monday, May 18, 2015 at 3:34:31 PM UTC-5, jonas.t...@gmail.com wrote: > > > Is there a way to trace where an iteration do lockup in a javascript? > > > Could they not printout the row executed when you break script? > > > > In the Firefox debugger you can tell it to pause on exceptions. I suspect the other popular browsers support this functionality as well. > > I just implemented a counter, and get strange maybe even impossible result. > > I use base 11 and start to convert from 0 using a counter. > > But the program decides to loop at different numbers at different executions, is that even possible? > > Javascript is not threaded, it is linear execution? It do bug out at 29 ones or nines. But when i use a counter it can bug out on any number between 117-1000
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2015-05-18 15:42 -0700 |
| Message-ID | <6334a69b-22e4-408b-a7f6-1db54b1118e9@googlegroups.com> |
| In reply to | #27746 |
Den tisdag 19 maj 2015 kl. 00:40:33 UTC+2 skrev jonas.t...@gmail.com: > Den tisdag 19 maj 2015 kl. 00:19:02 UTC+2 skrev jonas.t...@gmail.com: > > Den måndag 18 maj 2015 kl. 23:53:56 UTC+2 skrev Michael Haufe (TNO): > > > On Monday, May 18, 2015 at 3:34:31 PM UTC-5, jonas.t...@gmail.com wrote: > > > > Is there a way to trace where an iteration do lockup in a javascript? > > > > Could they not printout the row executed when you break script? > > > > > > In the Firefox debugger you can tell it to pause on exceptions. I suspect the other popular browsers support this functionality as well. > > > > I just implemented a counter, and get strange maybe even impossible result. > > > > I use base 11 and start to convert from 0 using a counter. > > > > But the program decides to loop at different numbers at different executions, is that even possible? > > > > Javascript is not threaded, it is linear execution? > > It do bug out at 29 ones or nines. But when i use a counter it can bug out on any number between 117-1000 If i just could find the smallest number it bugs out for in base 11. But the counter approach does not work because it locks up on different numbers different execution which to me is ape weird.
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2015-05-19 01:20 +0100 |
| Message-ID | <87y4klju4m.fsf@bsb.me.uk> |
| In reply to | #27747 |
jonas.thornvall@gmail.com writes: > Den tisdag 19 maj 2015 kl. 00:40:33 UTC+2 skrev jonas.t...@gmail.com: >> Den tisdag 19 maj 2015 kl. 00:19:02 UTC+2 skrev jonas.t...@gmail.com: >> > Den måndag 18 maj 2015 kl. 23:53:56 UTC+2 skrev Michael Haufe (TNO): >> > > On Monday, May 18, 2015 at 3:34:31 PM UTC-5, jonas.t...@gmail.com wrote: >> > > > Is there a way to trace where an iteration do lockup in a javascript? >> > > > Could they not printout the row executed when you break script? >> > > >> > > In the Firefox debugger you can tell it to pause on >> > > exceptions. I suspect the other popular browsers support this >> > > functionality as well. >> > >> > I just implemented a counter, and get strange maybe even impossible result. >> > >> > I use base 11 and start to convert from 0 using a counter. >> > >> > But the program decides to loop at different numbers at different >> > executions, is that even possible? >> > >> > Javascript is not threaded, it is linear execution? >> >> It do bug out at 29 ones or nines. But when i use a counter it can >> bug out on any number between 117-1000 > > If i just could find the smallest number it bugs out for in base 11. > But the counter approach does not work because it locks up on > different numbers different execution which to me is ape weird. Your code has reached the point where it is no longer comprehensible even to you, its author. I think you need to spend a portion of the time on this project to learning how to program. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | "Christoph M. Becker" <cmbecker69@arcor.de> |
|---|---|
| Date | 2015-05-19 02:54 +0200 |
| Message-ID | <mje1jp$bgt$1@solani.org> |
| In reply to | #27749 |
Ben Bacarisse wrote:
> jonas.thornvall@gmail.com writes:
>
>> If i just could find the smallest number it bugs out for in base 11.
>> But the counter approach does not work because it locks up on
>> different numbers different execution which to me is ape weird.
>
> Your code has reached the point where it is no longer comprehensible
> even to you, its author. I think you need to spend a portion of the
> time on this project to learning how to program.
It might be useful to point out some resources for JavaScript/ECMAScript
beginners. I've read praises for "Eloquent JavaScript"[1] in this
regard, but it has been critized in this NG. The FAQ is rather terse on
textbooks...[2]
[1] <http://eloquentjavascript.net/>
[2] <http://pointedears.de/scripts/faq/cljs/#books>
<http://jibbering.com/faq/#books>
--
Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
|---|---|
| Date | 2015-05-18 17:36 -0700 |
| Message-ID | <966d4f19-b873-4f82-bf35-7b56d4bcca12@googlegroups.com> |
| In reply to | #27746 |
On Monday, May 18, 2015 at 5:40:33 PM UTC-5, jonas.t...@gmail.com wrote: > It do bug out at 29 ones or nines. But when i use a counter it can bug out on any number between 117-1000 Did you try setting a break-point yet in your debugger?
[toc] | [prev] | [next] | [standalone]
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
|---|---|
| Date | 2015-05-18 17:33 -0700 |
| Message-ID | <55bf628e-1aae-4576-b085-654215bb2a34@googlegroups.com> |
| In reply to | #27745 |
On Monday, May 18, 2015 at 5:19:02 PM UTC-5, jonas.t...@gmail.com wrote: > I just implemented a counter, and get strange maybe even impossible result. > > I use base 11 and start to convert from 0 using a counter. > > But the program decides to loop at different numbers at different executions, is that even possible? > > Javascript is not threaded, it is linear execution? Without looking at your code (wherever it is), I am going to assume you are reusing your loop variable in multiple places. what happens when you paste your code in a linter such as the following: <http://jshint.com/> I don't need to see the results...
[toc] | [prev] | [next] | [standalone]
| From | "Michael Haufe (TNO)" <tno@thenewobjective.com> |
|---|---|
| Date | 2015-05-18 17:35 -0700 |
| Message-ID | <1a4ee6e8-a057-4a55-a9b3-c377f11de058@googlegroups.com> |
| In reply to | #27745 |
On Monday, May 18, 2015 at 5:19:02 PM UTC-5, jonas.t...@gmail.com wrote: > Javascript is not threaded, it is linear execution? If you're asking, it's probably safe to assume you're running code that is single threaded.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web