python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Ending a loop on time expiration
I have a long computation in a loop, which I need to end prematurely if allowed compute time expires (and return a partially computed result). I plan to do it via SIGALARM handler and a timer:
// Alar...
user2052436
Votes: 0
Answers: 2
Is it safe to update counter from inside one of Promise.all promises in Node.js?
Node.js uses threads from worker pool to perform I/O operations. If I need to count the number of characters in many files concurrently (using Promise.all), is it safe to update the totalNumberOfChars...
hitchhiker
Votes: 0
Answers: 1
Rails first_or_initialize with condition on initialize
I try to make a first_or_initialize with condition on the initialize,
Here what I have :
def find_or_initialize_user(name)
User.where(company: company).first_or_initialize(company: company, name: ...
TheGame
Votes: 0
Answers: 1
Golang - race condition using go-routine
I tried to use the race flag to my program and issue found :(
The func is the following
func (g *WaitingErrorGroup) Start(run func() (bool, error)) {
g.g.Start(func() {
requeue, err := run...
JME
Votes: 0
Answers: 2