3,601 questions
-4
votes
1
answer
111
views
Why does my component re-render infinitely when using useState inside a setTimeout? [duplicate]
I'm building a live clock component in React using useState and setTimeout. The goal is to update the time every second. However, as soon as the component mounts, it triggers infinite re-renders and ...
0
votes
1
answer
110
views
How can I define an infinite loop condition in the for loop in java?
I was making a program in which user can keep entering numbers till user enters a multiple of 10. So I wanted to created a for loop for that and didn't knew what should be the infinite loop condition ...
0
votes
0
answers
23
views
Apache AliasMatch: map certain directory when matching specific string - infinite loop
I am facing a particular request from the SEO team of a client and I need to handle two different CMS served on the same domain. Basically, the "root" cms is already configured in order to ...
0
votes
0
answers
176
views
Basic script causing a fault on a Shelly device
someone could help me understand why I had 2 Shelly 1 Mini Gen3 unusable after I run a very simple script on them?
Below is the script:
Shelly.addEventHandler(
function (event, ud) {
print('raw ...
0
votes
0
answers
133
views
Infinte loop trying to read last line of InputStream
I am working on a project and am using whisper.cpp for speech to text. I am not using the Java bindings, and am instead compiling examples/stream and running it using the Process/ProcessBuilder API. I ...
0
votes
1
answer
55
views
React useEffect Dependency Bug with Async Data Fetching
I'm building a React app where I fetch data from an API and update the state. However, I'm facing a bug related to useEffect dependencies, which is causing an infinite re-render loop. Here's the ...
0
votes
0
answers
30
views
Toroidal effect (infinite Loop) in sections of uiCollectionView
I have a mosaic of cells with interleaved movement, but I have not achieved a toroidal effect so that the cells appear again.
import UIKit
class ViewController: UIViewController {
@IBOutlet ...
0
votes
0
answers
52
views
Rails attachment delegation to another model optionally
I have two models InInvoice, Disbursement. Both are associated: InInvoice optionally belongs_to disbursement. Both have a has_one attachment called att.
InInvoice is supposed to delegate att calls to ...
-1
votes
1
answer
352
views
Struck in Infinite Recomposition due to Horizontal Pager's Pager State
this code snippet do infinite recomposition while scrolling , not able to find why?
How to manage state and animation in a HorizontalPager in Jetpack Compose?
I'm working with Jetpack Compose and ...
-1
votes
2
answers
123
views
Verilog clock implementation gone wrong
I just started learning Verilog and made a system clock and its respective testbench, but it is getting stuck in an infinite loop in the testbench. Could you please help me?
Below is the ...
1
vote
0
answers
68
views
Linked List merge sort implementation attempt with Python runs into an infinite loop
Context
I was implementing a LinkedList sort solution with python (over on leetcode.com).
The solution is a bottom up merge sort approach (divide and conquer).
The code below is incomplete, it's ...
-1
votes
2
answers
140
views
Why does this code not stop to take input?
This is a program which allows only authorized shareholders to attend a meeting, which is given as a file input.
It asks for a name on the terminal and checks if it is in the file. If it is not, it ...
1
vote
1
answer
116
views
Problem extracting a line from a buffer readed from a file descriptor
Well, i am trying to create a program that reads from a file descriptor piece by piece (defined as BUFFER_SIZE), until it finds a '\n' or the EOF. The problem its i am getting stuck in a infinite loop,...
1
vote
1
answer
102
views
I'm trying to create an Library management system and not getting why there's a loop in switch case with break statement too
I've not added any features yet in this program and only added some tasks in "1)Create an account" while in this code block when you enter your name after pressing enter, it starts looping ...
0
votes
2
answers
106
views
How do I prevent circular dependencies in a general tree?
I have a class in c# called Pose. Its functionality is not really important, but it contains as fields another Pose called _parent, and a List called _children. In the setter for the _parent, I need ...
0
votes
1
answer
109
views
Infinite loop issue for my form using nextjs
this is my component. i don't know why the moment i reload the page it'll always give me infinite loop issue. it'll throw the error the moment i go the page. i can't even fill in anything inside the ...
0
votes
0
answers
106
views
Windows Task Scheduler: run .py script without window opening
I have been asked to run a python script from the Windows Task Scheduler.
In my python script I will substantially use watchdog library in order to instanciate and run an Observer that will monitor ...
0
votes
1
answer
121
views
Fork in Linux: Weird infinite loop while freeing condition variable
Context
System: Fedora 40
Library Used: pthread.h
Details: Read "To the point" if not interested
I apologize for providing no code here as the whole program is more than 4000 lines of code ...
0
votes
1
answer
170
views
Why is my solve_ivp stuck in an infinite loop?
I'm trying to solve a problem involving a fixed-bed reactor that uses a system of ordinary differential equations, but for some reason it gets stuck in an infinite loop. Here's the code:
import numpy ...
2
votes
1
answer
98
views
Longest Repeating Substring With Replacement
Working on an online practice problem and ran into an issue that I can't seem to figure out. I am looking to find the longest length of a string of characters whose characters can only be replaced &...
-4
votes
1
answer
116
views
Changing a single line in my code leads to an infinite loop [closed]
In the following code,
#include <iostream>
#include <vector>
using namespace std;
vector <int> otm;
vector <int> past;
vector <int> strength;
bool leaves(int n){
...
0
votes
1
answer
50
views
how can recyclerview central item highlight?
At first, I tried to use a view pager, but due to the overall size issue of the view pager, I didn't think it was right to implement such a screen.
So I started using Recycler View and even worked on ...
1
vote
1
answer
81
views
I made a one-card game, but it keeps falling into infinite loop
I've tried implementing a one-card game with c, but my code is that when I run about 5 times, I fall into infinite loop at least 2 times. I've talked to chat-gpt a lot to solve this problem, but I ...
1
vote
1
answer
59
views
Compilation and return values of infinite loops with try-catch blocks
I encountered this problem when experimenting with file I/O. This method compiles:
public static int testMethod1() {
try {
while (true);
} catch (Exception e) {
...
1
vote
1
answer
153
views
Why does my code go into an infinite loop?
I have the following code at the moment:
executed = False
while executed == False:
try:
inp = input("Enter the variable you want to change (e.g.: limit = 10): ")
eval(...