75 questions
1
vote
1
answer
99
views
Why am I getting this RecursionError?
I'm working on making a program to read a chart of accounts and turn it into a tree of Account objects, which I will be doing stuff with later. The chart of accounts in question has several levels of ...
3
votes
1
answer
85
views
Question about Node js infinite recursion and async/await behavior [duplicate]
I've been trying to make an infinite loop in Node js, and came across this problem. I experimented a bit and came up with these three functions.
async function rc1(){
rc1();
}
//-> stack ...
-1
votes
2
answers
86
views
How to change the base case so it starts recursion all over?
I am trying to force a recursion to loop infinitely for a project of mine.
This is my code up so far:
putStr' :: String -> IO ()
putStr' (a:as) = do putChar a
putChar '\n'
...
0
votes
1
answer
164
views
Infinite recursion from spreading map tile modification algorithm - why is it happening, and how can it be fixed?
The code in the Stack Snippet is meant to work as follows:
Click the table cell in the top right corner, which has a value of 0
The value will instantly change to 4
After a delay, the numbers in the ...
2
votes
0
answers
124
views
How to capture and log infinite recursion errors in production PHP?
Recently I had a problem where because of invalid data in DB some PHP script ran into an infinite recursion on production. We have Sentry added in our system for error log management, but that did not ...
1
vote
1
answer
68
views
Want to update 2 input state values dynamically without recursive calls
I am making a React application for a currency converter website. I have two <input> fields where the user can input the number to get the exchange rate as shown here:
Screenshot of Component
...
0
votes
0
answers
47
views
Using a variable outside its function
I want to use the checkedCount variable inside of the generatePassword function in order to not call the function matrixEffect at the end of generatePassword if the value of checkedCount is 0.
I used ...
0
votes
1
answer
95
views
Given an adress, how can I access the object in Python?
How can I access a Python object by it's address that I get from id(self.__dict__)?
The background is the following, I want to access one class instance from the other (both classes mimic custom ...
1
vote
3
answers
139
views
Python Dynamic Programming Problem - ( 2 dimension recursion stuck in infinite loop )
In the book "A Practical Guide to Quantitative Finance Interview", there is a question called Dynamic Card Game, 5.3 Dynamic Programming)
The solution according to the book is basically the ...
0
votes
1
answer
225
views
Typescript Type Flatten Child nested objects
i have been following this example and here to flatten a type invain. Most of this flatten the object completely into removing the nests. I would like to to maintain my structure, just removing ...
0
votes
2
answers
968
views
Getting infinite recursion with ObjectMapper even though entities' fields are annotated with @JsonIgnore
Got two entities:
class Entity1{
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "entity1Id", unique = true, nullable = false)
private Integer entity1Id;
@OneToMany(mappedBy = "...
1
vote
1
answer
304
views
Why does the compiler issue a template recursion error?
I'm currently trying to deduce a std::tuple type from several std::vectors that are passed as parameters. My code works fine using gcc, but the compilation fails with Visual Studio Professional 2019 ...
2
votes
2
answers
723
views
Implementing N choose K recursively in Java
I am new to Java and am I trying to implement a recursive method for finding "n choose k".
However, I've run into a problem.
public class App {
public static void main(String[] args) throws ...
0
votes
1
answer
375
views
How to execute AST or code object in a separate process without exceeding max recursion depth
I am trying to write a metamorphic quine. Without the "spawn" context, the subprocesses seem to inherit the stack, and so I ultimately exceed the max recursion depth. With the "spawn ...
0
votes
0
answers
67
views
Stack Overflow Exception in Recursive Program Due to Missing Check
I am battling with this puzzle where I have a small, recursive program that is sort of similar to Conway's life. It has a set of octopuses arranged in a 10x10 grid, and each one has an energy level ...
0
votes
1
answer
368
views
What is the best way to build own system metric collector agent
Myself have an idea to build own metric collection agent for linux systems with various customised features and controls. Would like to know what is the best practice to collect metrics continuous ...
0
votes
0
answers
37
views
Why a recursion error occurs when implementing the Karachuba algorithm in python
Karachuba algorithm : https://en.wikipedia.org/wiki/Karatsuba_algorithm
threshold = 4
def prod2(a, b):
n = max(len(str(a)), len(str(b)))
if a == 0 or b == 0:
return
elif n <= ...
0
votes
0
answers
61
views
Infinite recursion of class at initialization
I've been working on a side project in Java in order to become more familiar with threads. It's a cookie clicker clone that uses different threads for the clicker, the counter, and everything else. ...
0
votes
0
answers
44
views
lazy computing of primes with python without recursion error [duplicate]
I came across this great video from computerphile which talked about lazy computing. In the video, they lay out this really beautiful bit of python code that will calculate primes using the sieve ...
0
votes
1
answer
1k
views
Infinite JSON in ManyToMany relationship mapped by Intermediary Table
I have 2 entities that relate to one another. These 2 entities should map to each other in a Many-To-Many relationship, however, I need to also have a timestamp of their respective relationship (when ...
1
vote
2
answers
216
views
PHP recursive function not allowing page to load
I am trying to display the total number in each line of a file that does not contain a path to another file as well as the filename,
but if it has a path to another file loop through that file and sum ...
1
vote
3
answers
1k
views
Alternative to recursion?
I'm starting to learn Python. Right now I'm creating a CLI that allows to create, view or delete contacts stored in a SQLite 3 DB. The problem is that everytime I finish a task I call the main ...
0
votes
1
answer
104
views
Why is this code is generating an infinite recursion in SML if it has a base case?
I wrote the following code in SML with the NJ Compiler:
fun all_answers (f, xs) =
let
fun aux(accu, xs_left) =
case xs of
[] => SOME accu
| x::...
0
votes
0
answers
198
views
Infinite recursion and sys.setrecursionlimit stops script without any errors
I wanted to do a few little experiments via measuring runtimes, especially comparing three implementations of fibonacci: recursive, lru_cache and linear (with linear space). I accidentally implemented ...
2
votes
1
answer
175
views
Compile-time detection of missing user-defined to_string()
I want to provide a to_string(obj) function for every object type I create.
I found this question, applied the accepted answer, and it works. So far so good.
Then I created a new type, but forgot to ...