Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
99 views

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 ...
In Hoc Signo's user avatar
3 votes
1 answer
85 views

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 ...
minyoung heo's user avatar
-1 votes
2 answers
86 views

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' ...
Ciuppo's user avatar
  • 43
0 votes
1 answer
164 views

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 ...
Quack E. Duck's user avatar
2 votes
0 answers
124 views

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 ...
bigmacpro's user avatar
1 vote
1 answer
68 views

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 ...
Amrut Wali's user avatar
0 votes
0 answers
47 views

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 ...
flexbeatz's user avatar
0 votes
1 answer
95 views

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 ...
foobar's user avatar
  • 23
1 vote
3 answers
139 views

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 ...
nyan314sn's user avatar
  • 1,986
0 votes
1 answer
225 views

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 ...
muturiken's user avatar
0 votes
2 answers
968 views

Got two entities: class Entity1{ @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "entity1Id", unique = true, nullable = false) private Integer entity1Id; @OneToMany(mappedBy = "...
Marco's user avatar
  • 382
1 vote
1 answer
304 views

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 ...
user16372530's user avatar
2 votes
2 answers
723 views

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 ...
Manish Joyeuse's user avatar
0 votes
1 answer
375 views

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 ...
Innovations Anonymous's user avatar
0 votes
0 answers
67 views

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 ...
ProfK's user avatar
  • 51.4k
0 votes
1 answer
368 views

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 ...
Jithin C V's user avatar
0 votes
0 answers
37 views

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 <= ...
user avatar
0 votes
0 answers
61 views

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. ...
Elijah Zimmerman's user avatar
0 votes
0 answers
44 views

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 ...
lstbl's user avatar
  • 537
0 votes
1 answer
1k views

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 ...
Mike O.'s user avatar
  • 47
1 vote
2 answers
216 views

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 ...
Avikky's user avatar
  • 13
1 vote
3 answers
1k views

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 ...
Rohen's user avatar
  • 39
0 votes
1 answer
104 views

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::...
Pedro Delfino's user avatar
0 votes
0 answers
198 views

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 ...
Uncle Dino's user avatar
2 votes
1 answer
175 views

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 ...
davnat's user avatar
  • 49