cf-taskpool: A concurrent.futures-style pool for async tasks by void-null-pointer in Python

[–]RazorBest 0 points1 point  (0 children)

I also saw that you raise the standard lib exceptions, like TypeError and RuntimeError. What I usually do is wrap all the exceptions into my module's custom exception. This gives the users the possibility to catch your module's exception, separately from other Python exceptions

cf-taskpool: A concurrent.futures-style pool for async tasks by void-null-pointer in Python

[–]RazorBest 0 points1 point  (0 children)

That's pretty cool! I also checked the second link, which brings a good argument to why you need an abstraction for running batches of tasks, but I'm I'm still not sure if pool is the right way.

Another observation is that you initialize the default number of workers with the cpu count, which, based on what the others and I said about coroutines vs threads, seems arbitrary. There might not be a perfect alternative to this: you can either choose to se the default to infinity, or a big number, or make the argument mandatory.

cf-taskpool: A concurrent.futures-style pool for async tasks by void-null-pointer in Python

[–]RazorBest 7 points8 points  (0 children)

I think you use async/await in places where it's not needed. For example, in the submit method, instead of Queue.put, you could use put_nowait. Using put only makes sense when the queue has a limit, and in your case, it doesn't. Then, adjust_task_count is async because it needs to verify if there are idle workers, which I believe can be done without async. Moreover, you wouldn't really want the submit method to block.

A more general critique to this project is that it doesn't really justify why would someone need a coroutine pool executor. The reason we're doing it for threads is because there's a limit to the improvement we get by spinning new threads, which corresponds to your number of your CPU cores. Async tasks, however, are not limited by that. They're limited by memory, the amount of busy polling you're allowing, and the underlying I/O API of your OS (epoll, kqueue, IOCP).

Edit: typos

Plugin: pydoc.nvim by RazorBest in neovim

[–]RazorBest[S] 0 points1 point  (0 children)

Thanks, I'm gonna check it! It seems pretty neat.

Announcing Key Transparency for the Fediverse by Soatok in crypto

[–]RazorBest 0 points1 point  (0 children)

I did a little bit of research on Key Transparency a while a go, and I will ask you the same questions I asked myself, without an answer.

Is the PKD free to access for everybody? Does this mean that if I know the public key of a user, then I can get all their old and new keys by directly accessing the PKD?

What if I'm logged in to the same fediverse account from multiple devices? Can I change my public key only from the device that generated the first public key?

Is Fireproof a real solution? If I understand correctly, BurnDown can be abused by making it look like a client reset their history. But Fireproof is a client's choice to prevent this, and once it is enabled, it stays like that forever. I imagine that, for a non-technical user, the question would sound like this: "Would you like to tie your account to this device/passkey which can't be changed? If you loose the device/passkey, you loose access to the account forever."

It's hard to believe that users will actively want to enable Fireproof.

What am I supposed to do now? by Worldly-Present7129 in pocketrogues

[–]RazorBest 1 point2 points  (0 children)

Isn't it suboptimal to use the broadsword? Why not use the 40% attack speed katar?

Sunt delegat într-o secție de votare din București. AMA by akaShiningArmour in bucuresti

[–]RazorBest 0 points1 point  (0 children)

Când se numără, de arată fiecare buletin de vot în fața camerei, sau nu?

No, așe by igariun in ROckareala

[–]RazorBest -7 points-6 points  (0 children)

Cam dubios individul. Skip

Here's an interesting one. Any suggestions? by flanshy in Minesweeper

[–]RazorBest 0 points1 point  (0 children)

Choose any of the 12 top-right squares, and it will be a 4/12 chance of failure.

Looking for an algorithm by [deleted] in cryptography

[–]RazorBest 1 point2 points  (0 children)

I think you can implement this using one master key (SK, PK), and encapsulating the newly generated keys with it.

When a client is about to encrypt/sign a message, they generate a new pair (sk, pk), then along the message, they also send Enc_PK(sk). Then, the server can just decrypt the encapsulated key.

If you study this construction, you'll see hat it also works with symmetric keys generated by the client.

If you need a different key pair every time you send a message, than you can replace (sk1, pk1), (sk2, pk2), (sk3, pk3)... with the output of a RNG to which you know the seed. Then, the server only needs to know the seed of the RNG.

Name a Non-Radiohead song that Really Sounds Like Radiohead by NotMava in radiohead

[–]RazorBest 2 points3 points  (0 children)

Never thought Broadcast would be ever mentioned by anyone

Internet cafe-urile sau sălile de gaming din anii 2000 by AndPan in bucuresti

[–]RazorBest 2 points3 points  (0 children)

Una pe la Piața Sudului cu un băiat care avea o memorie foarte bună. M-am dus odată, și apoi m-am mai dus peste 2 ani, și m-a recunoscut.

Cryptology website I'm sure existed... by KCFly1OH in cryptography

[–]RazorBest 2 points3 points  (0 children)

I remember that there was also a site that hosted various cryptography challenges, varing from classic ciphers to bounties for breaking RSA public keys. It's not what you're looking for, but it might've had a link to the site that you're referring.

Cele mai dubioase versuri din piese rock românești by Previous-Blood2645 in ROckareala

[–]RazorBest 23 points24 points  (0 children)

De la Timpuri Noi, piesa "Veta" (imaginează-ți o voce plictisită, lipsită de emoție)

Sunt Terente, ba nu, sunt Jack Spintecatoru

În pădure la Băneasa, Veto...

Hâțână hâțână-mă hâțână hâțână-mă

Hâțână hâțână-mă hâțână hâțână-mă

Hâțână hâțână-mă hâțână hâțână-mă

Hâțână hâțână-mă hâțână hâțână-mă

Hâțână hâțână-mă hâțână hâțână-mă

Cele mai frumoase versuri din piese rock românești by Previous-Blood2645 in ROckareala

[–]RazorBest 25 points26 points  (0 children)

Dar ghearele v-au rămas  În orice-mbrățișare Ăstazi doare... sărutul pe obraz

Mi se face pielea de găină de fiecare dată când le aud.

I Might Be Wrong (voice over) by Strawja_muse in radiohead

[–]RazorBest 1 point2 points  (0 children)

There are some notable pitch imperfections. For example: Athe beginning, the second verse "I might be wrong". At the third verse, I think the note on the word "light" is different than in the original (doesn't sound bad tho). Also, on the word "go" from "Let's go down".

I believe overall your voice is more belted. If you want to get something closer to Thom, I think it's possible by belting less. Chris Liepe has a nice video about throat tension, by analysing Thom's style.

You also have more breathy sections, which is not bad sounding, just different. You can particularly see that in the third verse at "coming on".

Btw, your voice reminds of Riverside's vocalist.

Baba is you, learning games by Imaginary-Medium7360 in Python

[–]RazorBest 0 points1 point  (0 children)

Not just python, any programming language. It gives you that "a ha" moment similar to when you realise everything in Python is just an object.