@mousetail'he-him' Yeah, like ATaco said, \3 matches the last successful match of group 3, not the first successful match. So (\3xx|^x) means "match the last value of group 3 plus two more xs, or [if there was no previous match of group 3] match one x at the beginning of the string."
Applying * to it (and ignoring the bigger context of the answer for simplicity) generates the square numbers, because each repetition generates the next bigger odd number, and concatenating all of them together sums those numbers.
For example, if * does three repetitions: First time, can't match \3, match ^x (add x). Second time, match \3xx (add xxx). Third time, match \3xx (add xxxxx). End result: xxxxxxxxx (9).
The same behavior works in Regenerate, though with a somewhat different syntax: ATO
@Seggan I always had it described as a lamp/bulb/LED, but never as a lampshade. Another one I've heard is that it is a fingertip (possibly a thumb) to point out, or give a rule of thumb, for what the code does. Sort of like ☞ in old print media.
@mousetail'he-him' it did but it mixed joblib and multiprocessing. There seems to be a cleverer way using an Array stackoverflow.com/a/79352174/1473517
> If lock is True (the default) then a new lock object is created to synchronize access to the value. If lock is a Lock or RLock object then that will be used to synchronize access to the value. If lock is False then access to the returned object will not be automatically protected by a lock, so it will not necessarily be “process-safe”.
That is correct, it may lead to some flickering. [thread unsafe thing]+=1 is in principle safe if the other processes are only reading, never writing, that value. So it should be fine, if a bit fragile
i think the fact that python's lib remove so much of the complicated parts creates an environment where it's actually harder to achieve your result ifyou already know exactly how this stuff is supposed to function
because now instead of having to roll your own from boilerplate, you're stuck behind someone else's implementation
@Themoonisacheese "The asynchronous execution can be performed with threads, using ThreadPoolExecutor, or separate processes, using ProcessPoolExecutor" Those still exist though
it enables stuff that doesn't care if it runs in threads or processes to just use concurrent.futures as an interface, and client implementation can choose either
python cares very much about their library ecosystem, so if your library say operates on results of a client-specified calculation, yo ucan create your library around concurrent.futures and not care whether the client uses processes or threads, your library will work for both
the whole thread thing in python where they are run sequentially is weird too
" if your library say operates on results of a client-specified calculation, yo ucan create your library around concurrent.futures and not care whether the client uses processes or threads, your library will work for both". I don't really understand what you mean, sorry
If I have a function that calculates something and I want to run it in parallel, do you mean that?
let's say i am the maintainer of some library a, and my library enables you to dynamically store the results of a pool calculation in a database (this is quite contrived but bear with me)
you, as an application dev, have decided to use threadpools because [reason]. you use library a. another user chooses processpools, because it works better for their workload or whatever. if my library's interface expects a concurrent.futures, the code for library a is the same for both users, and i don't have to maintain a separate version for users of any specific executing backend
also, if you were to program a library that executes pool job on en.wikipedia.org/wiki/IBM_Spectrum_LSF, if your library exports a concurrent.futures object, library a would work out of the box with yours, despite neither having been designed with the other in mind
These are the type of things that matter when you write a larger program that is likely to need to be changed over time, now as much a single calculation that only needs to run once
Important question...Assuming you can't distil the whiskey, if you have nothing else to eat or drink, would whiskey keep you alive any longer or would you just die more quickly if you had any at all?