Questions tagged [infinite]

An infinite structure or process is one which does not terminate. Infinite loops or structures may be bugs in certain contexts, but also may be desired behavior, particularly in server-processes or lazy languages.

An infinite structure or process is one which does not terminate. Infinite loops or structures may be bugs in certain contexts, but also may be desired behavior, particularly in server-processes or lazy languages.

1090 questions
5
votes
2 answers

Terminology for example of codata in Clojure

Imagine the following function to give an infinite lazy sequence of fibonacci in Clojure: (def fib-seq (concat [0 1] ((fn rfib [a b] (lazy-cons (+ a b) (rfib b (+ a b)))) 0 1))) user> (take 20 fib-seq) (0 1 1 2 3 5 8 13 21 34 55 89…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
5
votes
2 answers

Scheme (Lazy Racket) an infinite list of natural numbers

I think that Lazy Racket should be useful for handling infinite lists. According to the Wikipedia Lazy Racket article, fibs (the infinite list of Fibonacci numbers) can be defined as: ;; An infinite list: (define fibs (list* 1 1 (map + fibs (cdr…
user1028880
5
votes
1 answer

Understand and avoid infinite recursion R

I can't find any advice on how to deal with infinite recursion in R. I would like to illustrate my problem in the most general way so that others can benefit from it. Feel free to edit it. I used to run a double for loop for (k in 1:n){ for (i in…
user1627466
  • 411
  • 5
  • 14
5
votes
4 answers

jquery cycle - add then remove css class - infinite loop

How do I use jQuery to infinitely add then remove a CSS class on a set of 4 li's. Basically, see this simple fiddle (without any jquery): http://jsfiddle.net/kHsvN/ I want to cycle through the boxes to change the css of a box, flip back to original…
Ben Davis
  • 51
  • 1
  • 2
5
votes
1 answer

Infinite scroll plugin modify the path with custom query

I am using the infinite scroll plugin (infinite-scroll) with jQuery isotope and was wondering if it's possible to modify the path with custom query parameters as user scrolls down the page to view more items. Is there a way to access the path and…
Vasile Laur
  • 699
  • 7
  • 16
5
votes
3 answers

Clever streams-based python program doesn't run into infinite recursion

I was playing around with clever ways to create a python generator for sequence A003602 This appears to work, but I can't figure out why. It seems to me like it should hit infinite recursion. Is python doing some lazy evaluation somewhere that I…
dspyz
  • 5,280
  • 2
  • 25
  • 63
5
votes
1 answer

How to stop/start a Service that contains an infinite loop on creation

So for background, I am attempting to create an application that continuously records via the microphone and stores the data in a buffer. The goal of the program would be to perform some type of processing on the data in the buffer and act upon…
user1429581
  • 130
  • 2
  • 7
5
votes
2 answers

How to loop select() to poll for data ad infinitum

#include #include #include #include int main () { char name[20]; fd_set input_set; struct timeval timeout; int ready_for_reading = 0; int read_bytes =…
azrahel
  • 1,143
  • 2
  • 13
  • 31
4
votes
2 answers

Infinite Loop : Determining and breaking out of Infinite loop

How would you determine a loop is a infinite loop and will break out of it. Does anyone has the algorithm or can assist me on this one. Thanks
Pankaj Gupta
  • 81
  • 1
  • 11
4
votes
2 answers

Can the unification algorithm in Prolog recurse infinitely?

I am using swi-prolog to produce some examples for students in the context of a Prolog course. Regarding unification I want to draw their attention to the dangers of infinite recursion in the unification process. However, mature Prolog…
Kim Mens
  • 325
  • 1
  • 13
4
votes
0 answers

Keras model using GridSearchCV stuck in infinite loop

I have a keras model and I use sklearn.model_selection.GridSearchCV for tuning the hyperparameters, but it gets stuck in an infinite loop. This is my model: from keras import Sequential from keras.layers import Dense, Activation def…
Moj Taba
  • 85
  • 6
4
votes
7 answers

Infinite yields from an iterator

I'm trying to learn some ruby. Imagine I'm looping and doing a long running process, and in this process I want to get a spinner for as long as necessary. So I could do: a=['|','/','-','\\'] aNow=0 # ... skip setup a big loop print a[aNow] aNow +=…
dlamblin
  • 43,965
  • 20
  • 101
  • 140
4
votes
1 answer

VIF function returns all 'inf' values

I'm handling with multicollinearity problem with variance_inflation_factor() function. But after running the function, I found that the function returned all the scores as infinite values. Here's my code: from rdkit import Chem import pandas as…
Myon
  • 63
  • 1
  • 2
  • 6
4
votes
2 answers

Cartesian product of arbitrarily many lists of different types

Several similar questions have been asked and answered. One can find instances, for example: Cartesian product of 2 lists in Haskell Cartesian product over a list of lists in Haskell How can I compute a Cartesian product iteratively? However,…
Student
  • 400
  • 3
  • 10
4
votes
1 answer

Rare infinite loop in code, don't want to wait for it to happen again

Ok, so I've got a genetic algorithm running in netbeans, and its been running for like 5 hours and seems to have entered an infinite loop. Is there any way that I can attach a debugger to it? or at least get some clue as to where it is in the code?…
wfbarksdale
  • 7,498
  • 15
  • 65
  • 88