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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
31 views

How to render one component after deleteHandler on other component

this is my Blog Component import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { useAuthContext } from "../../hooks/useAuthContext"...
B.Dukov's user avatar
-1 votes
1 answer
80 views

Brainfuck Compiler in javascript [duplicate]

I wrote a BrainFuck compiler in JavaScript and it works fine with this input: ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++.....
Laczkó Lajos's user avatar
-1 votes
0 answers
51 views

(C++) Program only breaks out of loop if I flush output stream [duplicate]

This is a part of my attempt to one of the introductory problems of the CSES problemset. My doubt is regarding the flush(cout); line. long long int sum = 0,k,digit = 0; cin >> k; while (sum < ...
Thekkepat Sankalp's user avatar
0 votes
3 answers
70 views

Do-While loop with try and catch exits loop without asking for new input

I have to create a do-while loop to validate any user input that is not a double and is not zero. I've been looking around on here and googling, I was creating an infinite loop, but I figured that out ...
PurpleCyndaquil25's user avatar
2 votes
2 answers
64 views

Why this function are in infinite loop?

This function just stay in a loop while my user dont type the right input(in this case an integer). The infinite loop happens when the user type the wrong value(like a string). But why this happen? ...
Ramon Jales's user avatar
0 votes
0 answers
14 views

MIPS code does not print output and goes into an infinite loop

.data input: .space 200 input_data: .word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 output: .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
displayName's user avatar
0 votes
2 answers
70 views

Code Infinite loop don't know how to stop or fix

Whenever I input choice 3 I loop through the dictionary infinitely but I don't know what's causing it. I want to loop through the dictionary and display the key and values on separate lines once. Also ...
Artiz's user avatar
  • 29
0 votes
0 answers
37 views

Postgres create policy returns infinite loop error or unexpected result

I'm trying to understand SQL policy but ran into a problem. I have a table employee with columns data_center_id, role and login. Administrator role can only see employees that work in same data center ...
Mitchell's user avatar
0 votes
0 answers
57 views

Where to put a function in Qt Quick with C++ to be called over and over again as the main code runs?

I'm learning Qt Quick qml but I have problems with the main loop. I have two functions called update() (for variety of things) and fixedUpdate() (for handling physics) and I'm wondering where to put ...
skrovno_CZ's user avatar
0 votes
0 answers
9 views

Stuck while iterate through Dataloader

I am trying to create a 3D testing dataset with 10000 samples (8000 for train and 2000 for validation) to test out my 3D CNN model. Looks all good untill I try to look at the 1st batch of data in my ...
JIAZHENG HU's user avatar
0 votes
0 answers
14 views

Base 64 loop for html

How can I ensure that the Base64 code of 'jobs.html' is embedded in 'index.html', while also having the Base64 code of 'index.html' present in 'jobs.html'? I aim to create this linkage to seamlessly ...
Furria's user avatar
  • 1
-1 votes
0 answers
57 views

Does ansible have infinite loops for tasks?

I want to create a playbook which will restart my service if it returns 404 error. I am using ansible-semaphore, so, I want to use only ansible. Without python or anything else. I haven't found info ...
ar rr's user avatar
  • 61
1 vote
1 answer
59 views

Inserting a number into a circular queue causes an infinite loop

I'm working on a C program that implements a queue, and I'm encountering an issue with an infinite loop. The program is supposed to perform insertion, traversal, and deletion operations on the queue. ...
Partha 's user avatar
1 vote
3 answers
159 views

Haskell Depth-First Graph Traversal has Infinite Loop

I have spent some time recently trying to make a depth-first traversal algorithm in Haskell. However, with my one I would like the function to return a 'visited' list, which has every node visited in ...
lrainey6-eng's user avatar
0 votes
0 answers
67 views

C# WinForms - This causes a endless loop: await publicClientApplication.AcquireTokenInteractive(scopes).ExecuteAsync();

Whole function: public static async Task<SaslMechanismOAuth2> AuthenticateMS365Async(Benutzer user) { if (!user.UseImapM365 && !user.UsePopM365) return null; ...
Fabian Saam's user avatar
3 votes
2 answers
84 views

Adding key pair values into a dict missing

I have been trying to add key values of a list into a dict whereas the key is the amount of times X is repeated in the list, and the value is X itself. my_list = ["apple", "cherry",...
Camilo170299's user avatar
0 votes
2 answers
116 views

Why does my while(Scanner.hasNext()) loop never exit?

I'm learning Java and building a Battleship game as a learning exercise. I created a method to receive a set of coordinates from the user, which is entered as two integers separated by a space. I've ...
eric_codes's user avatar
0 votes
0 answers
39 views

T-SQL Infinite Loop and Warning: Null value is eliminated by an aggregate or other SET operation

I am presently working on simulating a Rock, Paper, Scissors tournament in T-SQL, but have come across a few hurdles: I have found myself in an infinite loop, and am receiving a warning indicating '...
EternalLearner's user avatar
0 votes
1 answer
46 views

How to Stop infinite loop while fetching data from localStorage in next.js?

When I'm fetching data from localStorage in useEffect Hook and passing dependency [] blank. It fetchs data well but it not fetch new data. To fetch that, it requires refresh the page. And when I pass ...
Rohit Sahani's user avatar
0 votes
0 answers
42 views

Infinite loop with observe in R Shiny

I try to make a simulation of selection on a list of plants. This is my code in R with the lib Shiny : server <- function(input, output) { n_pop <- reactiveVal() tab <- reactiveVal() ...
Clément Raspail's user avatar
1 vote
1 answer
58 views

Infinite recursion java issue

I am trying to solve a problem and can't seem to figure this one out. I have tried creating Lists and sets that keep track of the towns visited and then to skip if it is already visited but none of my ...
Wragnam's user avatar
  • 33
0 votes
1 answer
50 views

dbus-cxx Block main thread until DBUS connection is disconnected

I'm using the dbus-cxx library to communicate between programs using DBUS. However, one part I'm confused about is how to keep the main thread from exiting while the connection is open on the server ...
nreh's user avatar
  • 466
-1 votes
1 answer
86 views

How to make a java Thread unstoppable without catching Throwable

I want to make a thread unstoppable for some reason, what is the sonarcube compliant solution? I have to catch Throwable but. It says: Catch Exception instead of Throwable. Throwable and Error should ...
Bora Ciner's user avatar
0 votes
1 answer
38 views

useEffect pair causing infinite loop if typing too fast in sub-form

I've got a form updating a state's array elements independently, but the way it's made causes an infinite loop when "typing too fast" in the form. The section state is meant to be a copy of ...
Horkos's user avatar
  • 231
0 votes
0 answers
50 views

How to write infinite loop logic in C++ which listens to specific data at every cycle?

Say I have several parameters, and specific combinations trigger specific actions. The parameters are dynamic and will be updated during runtime. Every time I update a parameter, I except the output ...
SonOfEl's user avatar
  • 175
0 votes
1 answer
96 views

useInfiniteQuery doesnt go to the next page

I have this code in react native, where i am trying to implement react-query: const { data, isLoading, error, fetchNextPage, hasNextPage, isFetching, isFetchingNextPage, refetch } = ...
Damo's user avatar
  • 7
0 votes
0 answers
14 views

How and where to execute code for "clearing Jupyter Notebooks Output in All Cells"

I have created an infinte loop and now my jupyter notebook is stuck. I have found a solution in this article: https://saturncloud.io/blog/how-to-clear-jupyter-notebooks-output-in-all-cells-from-the-...
Tuan's user avatar
  • 1
-1 votes
1 answer
69 views

How to not get TIMEOUT (Infinite loop) error

The user inputs integers and the program determines the even max and even sum. The program output is correct but I get an error at the end that says "TIMEOUT (Infinite loop?)". Is there a ...
Anthony's user avatar
0 votes
1 answer
76 views

How to solve Jupyter notebook infinite loop problem

I am new to python and using Jupyter notebook on anaconda prompt. So I ran a program which has a while True loop and it initiated an infinite loop which wont stop. It got my whole laptop hanged and I'...
Sher's user avatar
  • 1
1 vote
1 answer
175 views

run streamlit from python script

I'm trying to run streamlit out of my python script with the following command: os.system('streamlit run 'r'G:\Python\Projekte\Userausgabe\1.3_Userausgabe.py') When I run my script, it works as ...
Åsa's user avatar
  • 11
0 votes
0 answers
68 views

Infinite Middleware Calls when Using not-found.tsx in Next.js 13

I'm experiencing a strange issue with my Next.js project, which is running on version ^13.4.19. I've implemented the "not-found.tsx" page in my "/app" folder, but I'm encountering ...
mbelleri's user avatar
-1 votes
2 answers
132 views

Linked Lists in C++ without a pointer to the Node class

As specified in the title above, I am trying to program a linked list in C++ without a pointer to the Node class, and am instead directly using the object belonging to the node class. This is a method ...
EclipsedProgram's user avatar
0 votes
0 answers
374 views

How to Resolve 'Maximum Call Stack Exceeded' Error when Using 'useClient' in Component?

I'm working on a Next.js application, and I'm encountering an issue when trying to use the useClient hook within one of my components. Whenever I include useClient in my component, I receive a "...
Abdullah Developer's user avatar
0 votes
1 answer
26 views

Oracle SQL : Why my prompt is repeat and repeat

Enter the year you would like to check >2022 Enter the Tour Guide ID you would like to check >TG02 72 73 74 75 76 This is the output of the screen alter session set nls_date_format = 'DD/...
QiFeng's user avatar
  • 1
-1 votes
1 answer
64 views

I keep getting stuck in an infinite loop with my password checker [closed]

Every time I run this program I keep coming up upon an infinite loop that keeps repeating the else statement "this password is incorrect" every time I run this program also what other ...
Dylan Andrews's user avatar
0 votes
1 answer
29 views

Loop which sends commands via COM port to syringe pump stops sending commands after some time

I have created this code to communicate with a syringe pump. Everything is working fine, but I need this to run for hours on end, and it keeps stopping at what seems like the same time every time (I ...
pedwards1's user avatar
0 votes
0 answers
38 views

Code works in CLion but not when using vim editor in Ubuntu command line terminal

This block of code is supposed to calculate the users heart rate, and then ask them if they want to repeat the process, and inform the user if they have made an invalid input when typing 1 or 0. it ...
Mason_CA's user avatar
0 votes
0 answers
42 views

React useEffect hook creating infinite loop of renders in ThreeJS Grafana Panel Plugin

I am building a Grafana Panel Plugin using ThreeJS. I loaded in a .gltf object and it displays correctly in the Panel with no data. Now I am trying to add the data piece to the project. The Goal is to ...
zebedee freeman's user avatar
0 votes
1 answer
32 views

Why isn't my nested while loop in an if/else statement outputting correctly (infinite loop)?

I have two loops (a while and an if) embedded in an if/else statement. I'm wanting to check if the user input is a number and if not, set a limit to how many times the user can try again (3 times) and ...
chiaseed's user avatar
-1 votes
1 answer
104 views

Infinite for loop if condition [duplicate]

Code Snippet 1: int i=1; for(;;){ if (i<5){ cout<<"Hello World"<<endl; i++; } } Code Snippet 2: int i=1; for(;;){ if (i<5){ cout<<...
Utkarsh Kumar's user avatar
0 votes
2 answers
53 views

QUICKSORT Algorithm - JavaScript. Im stuck :(

can anybody tell me why this generate infinite loop? Im stuck. Maby i miss something? const quickSort = function (arr) { if (arr.length < 2) { return arr; } const pivot = arr[0]; const ...
user22467047's user avatar
2 votes
2 answers
66 views

infinite loop in cs50 speller assignment

I was working on the cs50 speller assignment, and once I finished debugging the load function, the program just ran in an infinite loop without doing or printing anything. // Implements a dictionary's ...
Peter Van Voorhis's user avatar
0 votes
0 answers
13 views

Infinite rotation around point without of rotating view around itself? [duplicate]

Code for rotation took from here: Swift Continuous Rotation Animation not so continuous extension UIView { func rotate360Degrees(duration: CFTimeInterval = 3) { let rotateAnimation = ...
Gargo's user avatar
  • 1,179
0 votes
3 answers
45 views

Output array elements infinitely

I'm trying to output array elements infinitely. I've already found another way to do this, but can you help me understand why the first element doesn't output in this code after the first iteration of ...
Abraam's user avatar
  • 25
-6 votes
2 answers
95 views

Continue statement

The continue statement is for skipping the iteration but it doesn’t work as I expect. Here is my code: int i = 0; do { if(i== 10)continue; printf("\n This is = %d",i); i++; } while ...
user3737377's user avatar
0 votes
0 answers
49 views

Updating Formik Initial Values from Redux

My app is using formik & redux I've encountered a challenge when it comes to updating initial values from Redux without affecting other filled input fields in the form. Currently, I'm using the ...
April's user avatar
  • 1
-2 votes
1 answer
27 views

ios14.5: An app runs away on start gobbling up memory

this Thread 9 Queue : fmdb.<YMMFMDatabaseQueue: 0x600002bd0690> (serial) is responsible for a lot of mallocs invoked. What does this thread do and who made it? UPD: my guess was 100% off. And ...
Anton Tropashko's user avatar
0 votes
3 answers
66 views

Problem with infinite loop when converting ASCII to Binary (in C)

I'm writing a code to convert a text into ASCII and then to binary. The text->ASCII conversion works fine, but during the ASCII->binary conversion I get an infinite loop when I run the program. ...
Nare Avetisyan's user avatar
0 votes
0 answers
42 views

Why isn't the try-catch block working with the while loop? [duplicate]

I am trying to make a rock, paper, scissors game, for which I need an input from the user as his choice. Now, I also want to check whether the given input is an integer or not. To achieve this, I used ...
Anubhav Jain's user avatar
0 votes
1 answer
39 views

JS: do-while loop infinitely loops over function when timeout is set

i need a prompt window to let the user type in a number. When setting the function (code below) once, everything works but this promt window should accure until a variable with an integer (starting ...
Hauskamel's user avatar
  • 115

1
2 3 4 5
72