Questions tagged [infinite-loop]

An "infinite loop" is a loop in which the exit criteria are never satisfied; such a loop would perform a potentially infinite number of iterations of the loop body. The general problem of determining whether the execution of a loop with given preconditions will result in an infinite loop is undecidable; in other words, there is no algorithm to determine whether an execution of a loop will eventually terminate. This is known as the halting problem.

3528 questions
1
vote
3 answers

Endless Loop - VBA Script That Runs when MailItem is Added to Sent Folder, then Creates Copy

I recently completed an outlook vba script that will scan the subject line of each mailitem added to the sent folder, looking for a project number in the subject. When detected, the script extracts the project number, creates a copy of the mailitem…
Banana
  • 57
  • 1
  • 5
1
vote
1 answer

preventing infinite loops prolog

I got the following promblem: the following facts and predicates are defined: father(avr, yit). male(avr). married(avr, sara). father(yit, yaak). married(rivka, yit). father(yaak, yosef). mother(rachel, yosef). father(yaak, levi). mother(leaa,…
elyashiv
  • 3,623
  • 2
  • 29
  • 52
1
vote
1 answer

Pointer queue extracting goes infinite loop in C

I got a chance to gain some extra points for a couple of C exercises. The task is to enhance program to use head and tail pointers (for FIFO queue) to avoid unneccessary while loops at extract function. Insert() works fine. It sets the tail and…
tuomas
  • 25
  • 4
1
vote
5 answers

Why is this an endless for loop?

I just went through the Looping Techniques Chapter of the Python docs tutorial and I have a question regarding this boy here: [:] I learned that it takes the start and end index of a string, so: text = "This is text" text[:] # will return the whole…
Johnny
  • 512
  • 2
  • 7
  • 18
1
vote
1 answer

Infinite loop prolog

I am writing a function that returns distinct sublists of a size n. When I run the following prolog code with a query gen_list_n(4,D,[1,2,3,4]) it runs into an infinite loop after returning the first answer. How do I prevent this? member_rem(E,L,R)…
1
vote
3 answers

How would I find an infinite loop in an array of pointers?

I have an array of pointers (this is algorithmic, so don't go into language specifics). Most of the time, this array points to locations outside of the array, but it degrades to a point where every pointer in the array points to another pointer in…
NobleUplift
  • 5,631
  • 8
  • 45
  • 87
1
vote
1 answer

JQuery Infinite Horizontal Background Image Panning

ok so I have an image that I want to use as a background, but have it scroll like the image below. Can anyone help me out with this or link me in the correct direction? Hopefully not parallax, unless you can help me out on how I can achieve this…
Michael Schwartz
  • 8,153
  • 14
  • 81
  • 144
1
vote
2 answers

Merge Sort algorithm Infinite loop

I am trying to create a merge sort algorithm, but when I go to sort the broken down arrays, I enter an infinite loop, the main problem is happening in my merge method below. Thanks in advance for the help. public static void mergeSort(double[]…
Weava
  • 496
  • 2
  • 13
1
vote
2 answers

Why does optimization cause my loop to run indefinitely with an int iterator and stop condition at 2.7 billion?

This code I was benchmarking and noticed it would not stop running when optimizations were turned on, im using Code Blocks with MinGW 4.7.0. If I change the iterator to unsigned i; the loop will end with optimizations on. Otherwise I need to turn…
Leonardo
  • 1,452
  • 3
  • 15
  • 26
1
vote
1 answer

endless while loop confusion

So I am trying to plan a path on a 9x9 grid, so boardSize is 9. The while loop should stop path list has a length of 81 or more so why is it possible that it can get to a length of 3531when the creature is at 7,5 and the goal is at 5,2 and…
EasilyBaffled
  • 3,822
  • 10
  • 50
  • 87
1
vote
3 answers

Avoiding Stack Overflow Exception

I am stuck with a stack overflow exception in this section of code, it is obviously occurring because the Customer object calls a list of CustomerBackgroundLevel objects, each one of which creates a new customer object. I am trying to find a way…
user1948635
  • 1,357
  • 4
  • 15
  • 22
1
vote
1 answer

Infinite movie animation in Matlab

From my previous question, I have tried to understand how to create frames or to play an animation in Matlab. I have clarified everything, but now I'm trying to figure out how to play it infinitely. For example let us consider two snippets of code.…
user466534
1
vote
0 answers

ASP.NET: Redirects loop with custom SEO redirect HttpModule

I wrote my httpModule attached on BeginRequest to handle SEO URL transforms and 301 redirects. Most of the things could be done with URL Rewrite, but I wanted a more flexible option and also URL Rewrite would issue multiple redirects for each…
1
vote
7 answers

Infinite loop at compile time?

Is it possible to enter an infinite loop at compile time? My program seems to enter an infinite loop when I attempt to compile it. I have a class with a class constructor that calls the method gameRun(). gameRun() calls itself at the end of its…
Jonathan
  • 3,311
  • 3
  • 22
  • 15
1
vote
1 answer

Emacs No-Window goes into an infinite loop

I remote into a linux machine from cygwin on windows7 via ssh -Y. Once ssh completes, if I execute emacs the usual way (emacs), everything works fine. If I try to execute it in the console (i.e. via emacs -nw), it loads scratch buffer and hangs,…
gt6989b
  • 4,125
  • 8
  • 46
  • 64