« first day (5100 days earlier)      last day (38 days later) » 

00:03
@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
 
2 hours later…
02:20
ABCDEFG,HIJKLMNOP. May make someone think LM is a letter, NO is a letter, P is a letter
https://www.zhihu.com/question/364201888/answer/79526348910
@DLosc Are you planning to incorporate my golf here into your answer anytime soon? If not, can I post it as my own?
02:40
> The character ⍝, called lampshade, both for its shape and for the enlightment you get from its presence, introduces a comment.
this is probably the most fun description of ive seen :P
Lampshade, more like sus-shade
03:04
What does do in APL?
Ah I see, gets you arrested
6
 
4 hours later…
att
att
06:54
@ATaco qwerty is somewhat lefthand-biased
 
4 hours later…
10:47
python is a tricky language....having multiple tqdm progress bars when running code in parallel is much harder than I expected!
11:01
@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.
@Simd Did the queue based method not work?
@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
It still uses a queue from multiprocessing though
@mousetail'he-him' from multiprocessing import Pool, Array
That's all it uses from multiprocessing
Ah ok, an Array is kinda the same thing intenrally
11:07
it is using a shared Array
I didn't know that. I do wonder if it needs locking as I say in my comment
> 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”.
By default it will have a built in lock
@mousetail'he-him' the code says progress_cntrs = Array('i', [0] * n_tasks, lock=False).
does that mean we are in the not process-safe case?
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
would the with progress_cntrs.get_lock(): progress_cntrs[pos] += 1 be harmful?
11:23
There would be no lock, so I assume progress_cntrs.get_lock() would just return None? The documentation is unclear
The lock is the part of queues etc. that makes them slow so if you can avoid them it should save a lot of performance, at the cost of lower integrity
ah ok. Booboo replied already explaining another reason why it isn't needed
my next challenge is to make it possible to quit cleanly by some keyboard press
I don't mind what it is
Yea, s Booboo says, if you wanted something like an "overall" progress bar that every process updated then you would need a lock
thanks so much for this. I am still a complete newbie with it comes to python multiprocessing
which is funny as a I am not a newbie at all in the theory
s/with it/when it
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 yes! I also have no idea why concurrent.futures and multiprocessing both exist
there is also joblib
I can't find any clear explanation of why you would use each one
11:32
JobLib seems to be intended for if you might want to change the backend threading/multiprocessing/cluster later on.
as in change it while some long running process is happening?
on a different note, the phi4 llm seems very good
No, for example you can run it with multiprocessing to test but then when it's done you run the full dataset on a cluster
so the test is on a shared memory machine but the full dataset needs MPI?
Something like that
I'm pretty sure it predates multiprocessing.Pool etc. so it may have had use like that before, but now that seems like the main benefit
what about multiprocessing vs concurrent.futures?
11:38
I beleive concurrent.futures is very new
12:02
@mousetail'he-him' so why does it exist??
I assume it has a different set of features
it was added in version 3.2 so that is 14 years old now
12:16
@Simd :concurrent.futures is a wrapper around both threadpool and processpool, which makes it so both can have the same interface
@Themoonisacheese "The asynchronous execution can be performed with threads, using ThreadPoolExecutor, or separate processes, using ProcessPoolExecutor" Those still exist though
yeah, wrapping something doesn't mean you have to remove it
also python3 has been quite shy about creating breaking changes, and that would definitely breaking
for example see the introduction of soft keywords in order to make match possible without breaking anything
so what is the point of it? Does it make some code cleaner?
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?
12:25
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
thank you for the explanation!
thank you.
I have moved on to trying to work how to let the user quit cleanly mid parallel computation
that's a whole can of worms lol
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
@Themoonisacheese yes. It's worm day today for me :)
 
2 hours later…
14:38
@Simd Vyxal 3, 33 bytes: 5ʁƛ3 8↯ℭʎŁ1≠[⑴-v※¨uf#[1|1_#]≡|1]⎘ Vyxal It Online!
should™ be correct
@Ginger the sequence should all have length 5
3, 4, 5, 6, 7 should be in there too. 3, 4, 5, 6 is increasing and 7 is decreasing according to my definition
sequences
15:21
CMQ Find the longest shakespeare quote that can be made just by concatenating IATA airport codes
15:44
Best typo in history
15:56
it's a good question though
 
1 hour later…
17:48
@emanresuA Yeah, you know what, it's so different that you should post it as your own.
 
2 hours later…
19:22
Why did my 3 year old code review answer get two upvotes in one day? Doesn't seem it got bumped as far as I can see
19:41
@NewPosts could a mod edit this to something prettier on the starboard?
(and the one in tgc)
 
1 hour later…
21:04
hey Wheat Wizard could you leave some of the reviews for the rest of us please
(first column is moderators, third is everyone else)
(/j, you're doing a great job)
21:22
@NewPosts mfw only 8 users destroyed
@Ginger cc @lyxal
I got mentally destroyed, is that counted?
@mousetail'he-him' nothing in comparison to the 446 destroyed on pldi
I guess our lighting fast post deletions actually had an effect
21:41
Hi all
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?
21:53
if ure in the arctic youd die faster
@NewPosts Is Code 👏 Golf 👏 Review the unholy offspring of CodeGolf.SE and CodeReview.SE?
@Simd I mean it's calories and water, it should be better than nothing
22:45
Alcohol is a diuretic, right? I wonder if drinking it might actually make you more dehydrated in the long run.

« first day (5100 days earlier)      last day (38 days later) »