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

I can't update more than one on my infinite thread in button click

At the below code i try to take the user's current location each second as x and y axises.At the first time of loop,the code works.But second and so on it doesnt work.What is the missing thing on this code.What should i do.Thanks.. new Thread(new…
-2
votes
2 answers

iphone dev - UIScrollView massive content tricks/tips

I have a horizontally scrolling UIScrollView and I want to display potentially thousands of UIImage's side by side. Obviously I can't do that for memory reasons so what I am thinking is set the content size to be the 2000 or whatever but only show…
Mike S
  • 4,092
  • 5
  • 35
  • 68
-2
votes
4 answers

Make an infinite list of natural numbers pasted together and find index python

I need to make an infinite list of numbers and list them like this: [12345678910111213141516171819...] or [1,2,3,4,5,6,7,8,9,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,8,9....] So that the numbers are pasted together and can be separately indexed(find the…
Eludum
  • 5
  • 1
  • 4
-2
votes
2 answers

C- number checking function gives infinite loop

I'm trying to write a small function that will get a number. The function should be idiot-proof so it would give warnings if ie. someone entered a character instead. I wrote a function like the one below, but if I enter a non-int the program gives…
aln447
  • 981
  • 2
  • 15
  • 44
-2
votes
1 answer

looping code: infinite how to stop this

Hi I was trying to create a loop so that when someone dies in my code it would stop and likewise the code wouldn't end until someone died (that is, there strentgth or skill reached zero) however, no matter what numbers I put in, the game…
-2
votes
2 answers

Timeline is not running infinitely (JavaFx)

I used to have a simple, timed (more-or-less) infinite loop: while (!canrun) { do_stuff(); //simple calculation update_gui(); //updates some labels Thread.sleep(waittime); } Which, naturally freezes the JavaFX-Application until it is…
Matty
  • 63
  • 1
  • 9
-2
votes
2 answers

How do I make a random number increase every set number of times in java?

In an infinite loop, how would I print a random number that will increase every set number of times( example 10 times )? Here is my code at the moment. `import hsa.*; public class MidTermProject{ public static void main(String[] args){ …
-2
votes
1 answer

Infinite loop not seeing updated variable

I have an infinite loop that waits for a method to update a boolean, and while this seems to all work fine at school it doesn't work at home. Not sure if that really means it's computer-based or what, since it also works with the print statement in…
Syxx
  • 19
  • 1
  • 5
-2
votes
2 answers

Why do I get an infinite loop with raw_input in python?

Here is the code - pretty simple - but it gives me the first exception in the main part of the program infinitely - without even asking for user input where I assumed it should at- at the first input of raw_input - I'm a beginner with a good grasp…
-3
votes
2 answers

Indefinite while loop when generating random list

I've created a function (izanamiPressureLevel_1) that makes a random list (pressure) following a certain set of rules. I'm trying to make while loop that iterates until it returns a list of a specified length, but it always loops printing suitable…
folufolu
  • 1
  • 1
-3
votes
1 answer

What is exactly causing my main method to run infinitely when instead I want it to run my method incrementally based off the user's response?

I'm trying to write a beginner program, where I roll 2 dies, and it tests the dies, if there's any evens it will say "evens are better then odds" and if there's a scenario where there's only odds it will say, "Odds are still cool", and after each…
Iseez Ice
  • 9
  • 3
-3
votes
2 answers

Bug :- Scanner class asks for input infinite times

import java.util.*; public class Composite_Magic { public static void main() { int i,j,m,n,fact=0,sum=0,temp=0; boolean k=false; Scanner sc=new Scanner(System.in); System.out.println("Enter 2 numbers as upper…
Dasyud
  • 23
  • 8
-3
votes
1 answer

PHP infinite loop delay

I am trying to make a PHP loop with delay between the loop this doens't work I am trying to get this as an output: 1 [wait 1 second] 2 [wait 1 second] 3 [wait 1 second] 4 [wait…
-3
votes
2 answers

infinite while loop for unknown reason

I seem to have gotten myself into an infinite while-loop: while(number != 0){ if(number % 2= != 0{ numberState[1]++; } else numberState[0]++; } The program should be able to count the amout of even and odd numbers using arrays. when I…
CasaRol
  • 39
  • 1
  • 13
-3
votes
2 answers

Why is this while() loop coming up as an Infinite Loop?

Just trying to figure out why the following code is an infinite loop? var x = prompt("enter a number"); while (isNaN(x)){ prompt("please enter a number"); } All I wanted to do was to keep asking the user to enter a valid number until she does…
nishkaush
  • 1,512
  • 1
  • 13
  • 20