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
11
votes
1 answer

C#: The console is outputting infinite (∞)

I'm using Visual Studio 2015 on Windows 10, I'm still a new coder, I've just started to learn C#, and while I was in the process, I discovered the Math class and was just having fun with it, till the console outputted: " ∞ " It's a Console…
11
votes
2 answers

How do streams stop?

I was wondering when I created my own infinite stream with Stream.generate how the Streams which are in the standard library stop... For example when you have a list with records: List records =…
Juru
  • 1,623
  • 17
  • 43
11
votes
4 answers

why does an infinite loop of the unintended kind increase the CPU use?

I know an infinite loop to the unintended kind usually causes a high CPU usage. But, I don't quite understand why. Can anyone explain that to me?
user342673
  • 624
  • 2
  • 8
  • 17
10
votes
7 answers

How to break an infinite for(;;) loop in C?

I have a vital infinite for loop that allows a sensor to keep updating its values. However I would like to break that for loop when another sensor brings in new values. How can I switch from one infinite for loop to another? Current code: for(;;){ …
NLed
  • 1,845
  • 14
  • 39
  • 68
10
votes
6 answers

Infinite list of infinite counters

For those with suspicious minds, this is not homework, just curious. Given a finite alphabet, is it possible to construct a list of infinitely long words made from the alphabet in reverse lexographic order? i.e. given the alphabet "ab" is it…
pat
  • 12,587
  • 1
  • 23
  • 52
10
votes
1 answer

How to build an infinite tree with duplicate elimination via cache of weak pointers in Haskell

The following code builds up an infinite tree, while at the same time creating a cache of all subtrees, such that no duplicate subtrees are created. The rationale for elimination of duplicate subtrees comes from the application to state trees of…
hkBst
  • 2,818
  • 10
  • 29
9
votes
4 answers

aggrid server side paging 'cannot get grid to draw rows when it is in the middle of drawing rows'

I have a aggrid component like this: private gridOptions = { columnDefs: this.columnDefs, frameworkComponents: { buttonRenderer: ButtonRenderer}, pagination: true, paginationPageSize: 20, cacheBlockSize: 20, // server side…
Vincent Chen
  • 245
  • 2
  • 6
  • 13
9
votes
3 answers

Infinite List in Flutter Application

I am migrating my application from android to flutter and till now I have used ListView in a flutter. my question is, is there any specialized technique to handle a large amount of data in the flutter? for reference, you can look at android…
Kiran Maniya
  • 8,453
  • 9
  • 58
  • 81
9
votes
6 answers

Intersection of infinite lists

I know from computability theory that it is possible to take the intersection of two infinite lists, but I can't find a way to express it in Haskell. The traditional method fails as soon as the second list is infinite, because you spend all your…
Zoey Hewll
  • 4,788
  • 2
  • 20
  • 33
9
votes
3 answers

Infinite Timedelta in Python

How can you express an infinite timedelta in Python? Up to now we use datetime from stdlib, but we could switch, if it is only supported in a third party library. PostgreSQL does support it. And it would be handy in my case. I want to use it to…
guettli
  • 25,042
  • 81
  • 346
  • 663
9
votes
2 answers

Can Dijkstra's Single Source Shortest Path Algorithm detect an infinite cycle in a graph?

So I came to this beautiful problem that asks you to write a program that finds whether a negative infinity shortest path exists in a directed graph. (Also can be thought of as finding whether a "negative cycle" exists in the graph). Here's a link…
Traveling Salesman
  • 2,209
  • 11
  • 46
  • 83
9
votes
3 answers

Haskell how to generate this infinite list?

I saw this code to generate Fibonacci numbers. fibs = 1:1:(zipWith (+) fibs (tail fibs)) Can a similar styled code be written to generate the infinite list [1..]? I saw this link on cyclic structures on the Haskell website. There an example is…
Tem Pora
  • 2,043
  • 2
  • 24
  • 30
9
votes
3 answers

Numpy: use bins with infinite range

In my Python script I have floats that I want to bin. Right now I'm doing: min_val = 0.0 max_val = 1.0 num_bins = 20 my_bins = numpy.linspace(min_val, max_val, num_bins) hist,my_bins = numpy.histogram(myValues, bins=my_bins) But now I want to add…
Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185
8
votes
1 answer

How can I use the Haskell timeout function (in System.Timeout) to halt runaway computations?

The timeout function in System.Timeout sometimes fails to halt an infinite computation. For example, timeout 1000 $ print $ length [0..] returns Nothing as expected because the timeout interrupts the infinite computation. But timeout 1000 $ print…
8
votes
3 answers

numpy mean of complex numbers with infinities

numpy seems to not be a good friend of complex infinities While we can evaluate: In[2]: import numpy as np In[3]: np.mean([1, 2, np.inf]) Out[3]: inf The following result is more cumbersome: In[4]: np.mean([1 + 0j, 2 + 0j, np.inf + 0j]) Out[4]:…
Aguy
  • 7,851
  • 5
  • 31
  • 58
1 2
3
72 73