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
7
votes
4 answers

Infinite list in haskell combined with fold* doesn't calculate

Let's say I want to get a sorted infinite list of all primepowers up to exponent n. I have got a function to merge two sorted lists and a function that gives me primes. merge :: Ord t => [t] -> [t] -> [t] merge (x:xs) (y:ys) | (x <= y) = x :…
Benji Wa
  • 147
  • 7
7
votes
1 answer

R - svd() function - infinite or missing values in 'x'

I am constantly getting this error. I am sure the matrix does not have any non-numeric entries. I also tried imputing the matrix, did not work. Anyone know what the error might be? fileUrl <-…
Shubham Saini
  • 738
  • 3
  • 8
  • 18
7
votes
2 answers

How to update a TextView in an activity constantly in an infinite loop?

I have an activity which has a TextView, and I want to update the text constantly.. In Java I could just make an infinite while loop, and just set the text each iteration. But when I try to do that in Android, it shows a black screen, and doesn't…
aclowkay
  • 3,577
  • 5
  • 35
  • 66
7
votes
1 answer

PHP infinite loop prevents access to other scripts?

While running an infinite loop in PHP on Apache, others pages/scripts would hang (take forever to load) until I break execution of the script. However, other pages would still execute on a different user session or browser. Can this be resolved?
B00T3D
  • 73
  • 4
7
votes
3 answers

Infinite Zoom with Javascript, Jquery or HTML5 Canvas

I've seen this "The Scale of the Universe 2" and I just want to know if this can be done with javascript or jQuery or with HTML5 Canvas. If you click an item (example the "Human") , an info will pop out beside it. I searched for 3 days here if…
IAMTHESTIG
  • 418
  • 1
  • 8
  • 16
6
votes
2 answers

I happen to stumble upon this code :" With for w in words:, the example would attempt to create an infinite list

I couldn't find an explanation for the code in python doc article 4.2 regarding the for loop. It mentioned something like: if we don't make a copy of the list, then it will print infinite list values for the list words = ['cat', 'window',…
6
votes
2 answers

Scalas (a,b).zipped (or Tuple2.zipped) notion using streams/infinite lists

here is what I thought would be a correct and useful definition of fibonacci nums in scala: lazy val fibs:Stream[Int] = 0 #:: 1 #:: (fibs,fibs.tail).zipped.map(_+_) However, I get the following error: fibs take 10 foreach…
Felix
  • 8,385
  • 10
  • 40
  • 59
6
votes
4 answers

Making the diamond square fractal algorithm infinite

I'm trying to generate an infinite map, as such. I'm doing this in Python, and I can't get the noise libraries to correctly work (they don't seem to ever find my VS2010, and doing it in raw Python would be way too slow). As such, I'm trying to use…
PrettyPrincessKitty FS
  • 6,117
  • 5
  • 36
  • 51
6
votes
2 answers

Is there an alternative to python's permutations for generator input?

I am trying to use an unbounded generator in itertools.permutations but it doesn't seem to be working. The return generator is never created because the function just runs forever. To understand what I mean, consider: from itertools import count,…
6
votes
1 answer

Android looping infinite ListView?

I'd like to make a looping ListView. That means, it behaves a bit like the picker widget on iOs, so when the user scrolls either up or down, the list just keeps looping its contents. I'd guess that one needs to write some fancy custom adapter for…
Zsombor Erdődy-Nagy
  • 16,864
  • 16
  • 76
  • 101
6
votes
1 answer

Infinite list parallel filter in Haskell

I want to find the first matching element in a infinite list in Haskell. This code is working: findPassword passwordHash = (head . filter (checkPassword passwordHash)) allStrings checkPassword is really long (because it's a SHA1 hash) checkPassword…
Thibaud Dauce
  • 367
  • 4
  • 14
6
votes
6 answers

Best infinite loop

Possible Duplicate: while (1) Vs. for (;;) Is there a speed difference? Hi, Which is better,faster and more optimized way to implement infinite loop - for(;;) or while(1)? and why?
iSegFault
  • 947
  • 2
  • 9
  • 18
6
votes
4 answers

Async Infinite Loop

I'm programming a C# software and it has some functions which make like a check-in on my server 5 in 5 seconds (they send http request, but it doesn't matter for my problem). Here is the code: log(); while (true) { alive(); //…
MigDinny
  • 99
  • 1
  • 3
  • 9
6
votes
4 answers

Proper return value for __len__ for an object that acts as an infinite sequence

I am writing a python class that acts as an immutable, infinite sequence. The class does not use a generator to access this infinite sequence, rather it generates a value for an arbitrary index in the sequence according to an algorithm within the…
trevorKirkby
  • 1,886
  • 20
  • 47
5
votes
1 answer

Eager versus Lazy Haskell. Infinite lists possible in Eager languages?

Apparently it is possible to implement Haskell such that it evaluates eagerly without changing the semantics of the language at all. If that is true, how are infinite data structures handled? http://csg.csail.mit.edu/pubs/haskell.html Therefore, a…
TheIronKnuckle
  • 7,224
  • 4
  • 33
  • 56