« first day (4550 days earlier)      last day (405 days later) » 

9:48 AM
@Dante I'm not sure what you're asking here. You want your flask app to know whether it's using e.g. the debug server or running under gunicorn?
 
 
1 hour later…
10:55 AM
I'm actually quite happy with mkdocs. It's a lot less work than sphinx, and I appreciate the philosophy of moving away a bit from docstrings-only and a mix of user guides and sphinx-style api docs.
 
you can have both with sphinx I think
 
How did you get syntax highlighting to work?
 
 
2 hours later…
1:19 PM
Wow, Twitter actually did open source their algorithm
 
It was 14 hours ago and that's a pretty big ruse if it's untrue
 
the Python code has 2-space indents so it can't be anything other than a joke
 
Ever read tensorflow source code?
 
1:35 PM
I'm having a hard time disproving it. That's a lot of code that seems definitely to pertain to the actual functionality. Also, his employees absolutely hate him, so if he followed through with his promise (he did say it would be open-sourced) then it's not inconceivable to me that they would deliberately let it through and then signpost it to everyone when they removed it. He wouldn't know beforehand. Still, maybe I've fallen victim to it
 
well the history there is 3 force pushed commits
Posted in a 3-minute window. It's not like they couldn't have just force pushed that Elon stuff away.
there's way too much code in there to serve just a prank but nothing that comes from the manchild can be trusted in any way
I mean it is April Fools on top of that
 
Much confuse. Such wow. I don't know what to think about it. I guess it would have to have been released before 1st April for news outlets to pick up on it, but the major ones don't seem to be running it
 
Ah, there have been earlier commits, then force pushed. Some PRs have unavailable diffs due to this github.com/twitter/the-algorithm/pull/160/files
this one started from a "first commit" dated 5 hours before the current "first commit"
oldest fork is dated 18:44 UTC March 31
anyone looking for a nerd snipe (or being pranked) could pull github.com/bryantson/the-algorithm/commit/… and diff it against the current "first commit" to see what they cleaned up
(actually, first one is github.com/achie27/the-algorithm from 18:43, but this has the same first commit)
my bet is that they will soon make the repo private, removing all the forks as well
 
 
1 hour later…
3:00 PM
It would be a pretty flat joke when he commented blandly himself. What strikes me as I dig through it is how utterly uncommented everything is
They had thousands of engineers. No wonder it's tough to move forward when nothing is explained anywhere beyond the README
 
so you're saying that firing all those people made sense in a "bring balance to the force" kind of way :P
 
It just confuses me how they were supposed to act productively each day is all. I don't want people fired for sure, but there's little chance of knowing the impact of each change. Just interesting to look into the workings of such big companies
If they had that many people, it's unclear why it couldn't be documented
 
I doubt that this is the real codebase as-is
 
 
1 hour later…
4:14 PM
This article bothers me from this question. It makes a bold statement that asyncio just dodges the GIL and I don't know a generous way for that to be true
 
4:25 PM
I know that CPython automatically becomes slower if you start a new thread (even if that thread does nothing), so maybe if you're feeling generous you can say that asyncio bypasses this slowdown. But I'm also pretty sure that every asyncio event loop has a thread pool running in the background, so it still slows down your program just by existing
Or I guess you could interpret it as "The GIL doesn't prevent multiple asyncio tasks from running at the same time", which is technically true
 
But that's just conflating concurrency and parallelism
 
Is it? Idunno, they're the same thing to me
 
Why differentiate between the two? Do we even know if parallelism is possible in this universe?
 
There are massive differences between the two
You could watch it on htop yourself on the CPU load
 
@Aran-Fey That's actually an interesting point. I'm not sure the thread pool scales down when it has no work – I'm afraid it doesn't and can thus have a noticeable performance impact.
 
Threads run on the same CPU core, right? Can a CPU core actually execute multiple things simultaneously? I'm not convinced that parallelism exists
 
5:05 PM
Of course it does, otherwise why do we have multi-core CPUs?
 
At least not in a way that's relevant in a "threads vs asyncio" discussion
 
@Aran-Fey It's actually much worse than that.
Threads run on multiple CPU cores but immediately go back to sleep when they don't own the GIL.
 
@Aran-Fey That's the part where I think they're being disingenuous at best. They're still bound by one core and there is still a GIL. That's totally different to actually just throwing the GIL in the bin and (no GIL) and spreading the work across multiple cores, which is a thing
 
Huh. Threads running on different cores can share memory? That sounds inefficient
 
It's pretty okay and what happens usually for all programs.
CPU affinity is quite a burden and rarely worth the cost.
 
5:15 PM
@Aran-Fey not for that, no
But I'm talking about »"The GIL doesn't prevent multiple asyncio tasks from running at the same time"«
In isolation that's misleading
 
I won't deny that, I did say it's technically true
 
6:03 PM
@MisterMiyagi got it, I think. You were the expert I was consulting without even a ping :P I knew that asyncio would draw you in :P Thank you
 
6:51 PM
@roganjosh Yes.
 
Can't you set that with an environment variable?
 
7:05 PM
I want to be able to deploy it on a shared host. I don't know what WSGI server is used. The main problem is I want to be able to reboot the server from code regardless of what server is used.
 
7:18 PM
So use supervisor. Flask doesn't need to know anything about that
What is it in your app that needs to change in response to the WSGI server?
 
For example changing database or installing a new module that needs a reboot.
 
Well you're now talking about people actively developing your app, no?
FWIW I did what I think you're asking (in the past). I used to detect the OS and, if was Windows, I knew I was in dev mode and I configured it around that, because deployment was on Debian. I can't stand by that approach, though
 
Actually users can buy modules and install it, like adding a new plugin.
 
7:34 PM
I don't understand how that's related
I don't understand how any of this is related. If you're serving your flask app through gunicorn, just restart the service via sudo supervisorctl restart my_flask_server and be done with it. flask doesn't know you did that
@Dante Install how? We're talking SaaS at best here
 
@AndrasDeak--СлаваУкраїні yeah, mkdocs kind of force me to though because when I first used it the mkdocstrings plugin was so bad that I had to add prose if I wanted to have anything even remotely nice
it is a bit of a backhanded compliment for mkdocs, but I still feel that my docs are now better overall
 
It is a shared host. I don't have access to sudo. And installing a new package inside a module is easy.
 
@Aran-Fey I can try to link a small project with my standard setup. I think I had to publish something anyway
 
@Dante it happens that I'm thinking a lot about SaaS atm but you're not really being forthcoming with examples/anecdotes/direction on where you're going. You just want to know how your flask app is being run and then I get flat answers
Distributing the flask code sounds like a really bad idea to me, though. And that's the only reason you wouldn't be in control of the environment variables (that I can see). The part where you're trying to determine how it's being run... if it was on your side, you know that and you could set the env vars
 
It is kinda SaaS, but it is not at the same time. It is much like WordPress with installable plugins. And I need to restart the app when the user install a plugin.
 
7:49 PM
What is a plugin for you?
 
A new Python package.
 
But it exists already
So that's easier. You need to manage the access through a static flask app
Now you just need to add someone into your DB to the auth list and they get access to something that existed all along. You don't need to restart the server
You can't restart the server as general course, which is what you originally asked. Could you imagine if SO went down every time someone signed up for Teams, just because they rebooted the server? (I mean, that might be quite rare, but anyway)
 
I know what you are thinking now about my project. But the packages are on another server and are not going to be shipped together with the main app.
 
@Dante Nothing is shipped. It's activated.
 
7:56 PM
I know it is weird, but I am asked to do that and it is not my idea.
@roganjosh Again I am not allowed to bundle all packages.
 
I think I'm done for this evening on this one.
 
Thank you so much.
Appreciate it.
 

« first day (4550 days earlier)      last day (405 days later) »