« first day (4367 days earlier)      last day (567 days later) » 

12:02 AM
@Aran-Fey We could probably find the main character using trilateration using world quality as a measurement of distance.
 
user19876853
12:37 AM
Can anyone answer this question regarding Natural Language Generator (NLG)? Do you know any friends who can answer? Thank you
 
user19876853
0
Q: An NLG based on Rules or Models, can it still be called an NLG system if it doesn't require "Syntactic Realization" (but it has everything else)?

Max_98I would like your opinion regarding a small theoretical detail on an NLG (Natural Language Generator) system that I am building in Python and Java. Given my decent simplicity of construction, I don't know if I can still call it NLG or just sophisticated if/else software with so many rules (which ...

 
5:05 AM
how can i stitch two graphql schemas, into one ?
 
 
2 hours later…
7:09 AM
@Max_98 that doesn't seem like a suitable question for Stack Overflow at all. Now the bounty prevents us from closing it as off-topic / opinion-based / lacking focus; but don't be surprised if the bounty ends up attracting downvotes instead of answers
going forward, probably review the help section and in particular How to ask and What topics to avoid
 
 
1 hour later…
8:35 AM
@smci Wow - I can't remember - that was 2015, seems like a lifetime ago. Reading the conversation, looks like it was in numexpr, but I really can't recall even the context.
 
 
2 hours later…
10:37 AM
It was only 7 years ago @JRichardSnape, what's up with you? :P
 
 
1 hour later…
11:39 AM
Ooo... github.com/openai/whisper is fun to play with
 
Doesnt "ReferenceType"/"weakref.ref" support type hinting?
It can't resolve the objects method and attributes if I do this:

 _object: weakref.ref[ClassA]

or

 _object: ReferenceType[ClassA]
I can do this, but it's kind of ugly:

if isinstance(self._object, ClassA):
    self._object.i_can_now_auto_detect_this_method()
I should maybe only type hint to the actual class? Hmm
 
12:04 PM
@JRichardSnape ...ordering eidetic recall, expedited delivery...
 
12:25 PM
Why doesn't contextlib.ExitStack work with dataclass?
I get "'Object' object has no attribute '_exit_callbacks'" when I use dataclass decorator.
 
1:10 PM
@Warcaith Provide an MCVE please. And for future reference, every time you ask a question like "I get this error when I do xyz", provide an MCVE.
This goes for everybody, of course
 
1:31 PM
@JonClements yeah, it is. I played with other stuff on openai myself, even though I don't necessarily like that kind of stuff usually (and have my own probably pedantic POV when it comes to AI...). Anyway, there are a couple existing open source clones of most of the stuff on openai if you're interested since many things they support are paid or don't provide the model they use
 
@NordineLotfi seems alright to me... you get the model (depending how much you want it to be) - and it's not actually too yam
even the basic model seems to get it "mostly" right
 
ah yeah, for the one you posted they do give basic models. I meant that for other stuff on openai like dall-e etc
 
when I have time... I need to re-learn a few bits and how those models work and see if I can't train a model to recognise a single person's voice
 
 
1 hour later…
2:59 PM
hello
I need some guidance
what’s the best way to show a message in Flask when a send_file() download starts?
my web app prepares a zip with some subtitles but there are sometimes when some of them are unavailable
I would like to show an informative message for that without reloading or jumping into a new webpage
 
sounds like a concern for the front-end. So time for some JS coding
 
the thing with JS is that I don't know how to listen to the send_file() download
you can listen to a web loading, some button, but I assume you cannot do that with a send_file()
Am I wrong?
 
you requested the route that calls send_file somehow, you just need to request if from JS then instead of making it a simple <a> link or whatever
 
how could I call a JS function from Flask?
btw, just received the color edition for Scott Pilgrim comic
literally one hour ago
xD
 
you don't. The HTTP model is generally "client sends request" -> "server answers". There's exceptions but they're not relevant to simple use-cases like this
so, in effect you send the client a web page that contains the JS that does the download request
that is the normal HTTP model
 
3:15 PM
that's why I were asking for a listener for the download
I would someway to trigger a JS function once the download starts
 
something from the client triggers the download, you don't trigger a download from the server side without the client asking for it
so when the client asks for it, ask for it via JS instead of asking with an <a> link
(or rather make the <a> link call the JS function that does the download)
 
the client triggers the download when he pushes the form button but that call ends with a Flask send_file() so I cannot even use render_template() here
 
then make the form button call a JS function
that JS function can trigger both the download and request another route where you render your template
 
you mean download the files using JS instead of send_file()?
 
or I guess you can even let the form button both do it's normal thing and request the other route via the onClick handler of the form submit button
 
3:23 PM
but I cannot know what to show in the new webpage until I finish preparing the file for the download
and I wouldn't like to make the user clic another button or link again to start the download
 
that sounds like you want to first make a call preparing the download and showing some info and then have a seperate route to actually trigger the download
 
please, let me clarify
this is what I have right know: user selects some files and sends the form -> I make some checks, prepare a zip file (some of the files the user asked for maybe not available) and start the download
the thing that I don't have right now is a message where I could tell to the user the files that are not included in the zip
but I cannot know that in advance
 
Sure, so send the initial request, send back your message and the temporary link/route to the zip, then start the download from JS
 
and how do I know when the zip is ready?
 
because you received the link in the reply to the form
if it takes so long that a single request would time out then you need to poll it from the client side like for example google drive does
 
3:35 PM
could you link some coding example?
I am very new with JS
 
I don't have anything at hand. But you should probably break it down into its parts like usual:
1. how to handle the form submission request/reply from JS
2. how to display you message contained in a reply to the form submission route
3. how to trigger a download in the handler for the first reply
(optionally how to poll for a long running process)
 
and one last question
I assume it's no possible to use a Flash message here
 
LUL, like macromedia flash?
wrong decade
 
not that Flash
Flask Flash
flashed messages
 
I don't know enough about flask to answer that
 
3:44 PM
thank you, @PeterT
I'll think about your answer
in any case, I cannot stop thinking that this is too simple to need something from outside of Flask like JS
 
I mean you can send a webpage as a reply with your message and an HTTP redirect to the download
but you said from the beginning that you didn't want a seperate page for some reason
 
yes, I prefer to maintain the UI as simple as possible
I think one clic and one URL it's the best possible scenario
 
well then choose you poison, a simple extra page or a bunch of JS
 
that's the dilemma
 
the http redirect wouldn't require extra user interaction if that was your concern
 
3:49 PM
I know, but it feels a bit weird to me
you send a form and an empty webpage opens
 
I meant HTML redirect, not HTTP redirect, though I guess you could make either work
well, if you want fine-tuned user interaction you gotta go through the JS muck
 
I think so ...
thank you again, @PeterT
 
AAB
4:04 PM
@roganjosh thank you
cbg peterT
 
4:38 PM
I don't really get the cabbage meme. But memes aren't there to be understood, they're here to be propagated, so cbg AAB
 
5:20 PM
I feel like it's more of a tradition than a meme, but I guess there is some similarity
 
5:35 PM
well traditions are pretty much the prime example of a meme, if we're going by the original definition
 
5:56 PM
Can I use max() on enums that uses "auto()" as values in some way? I've googled but haven't found something.
lt was the answer :)
__ lt __
*
 
6:12 PM
Sounds like you want an OrderedEnum
 
6:25 PM
Aaah, cool. That's right :)
 
 
2 hours later…
8:03 PM
When would you all NOT use dataclasses? :)
It's an interesting topic.
 
8:14 PM
I avoid dataclasses because 99% of the time it would lead to different behavior than I'd get if I implemented the class manually. For example, the instances won't be hashable (unless you set eq=False). Writing the class manually is just less of a hassle than making @dataclass do what I want
I pretty much only use them in quick-n-dirty code where such concerns simply don't matter
Plus I made my own version of dataclass, so I just use that ¯\_(ツ)_/¯
 
8:31 PM
Aah I see. We'll see if I end up with the same conclusion some day. I've not yet seen the struggle with it, but there's probably a lot of them!
Btw @Aran-Fey
Can I create an empty weakref.ref?
weakref.ref(None) is forbidden.
 
lambda: None can serve as a dead weakref in a pinch
I usually end up writing a bunch of if self._weakref is not None: statements though
 
I tried using "lambda: None", but it completely destroyed the type hinting, haha.
But I guess that's the way to do it
_ref: weakref.ref[TestCase] = lambda : None
_ref: () -> None = lambda : None
It transform it to the bottom one (which is understandable, but not what I really want)
I used a proxy instead
Okay, that didn't work for the type hint either
Gaaaah
 
What's wrong with Callable[[], Optional[TestCase]]?
 
8:47 PM
_ref: weakref.ref[Callable[[], Optional[TestCase]]] = lambda : None
Like this?
 
No, without the weakref.ref
 
Aaah, yeah, that would work great. "Optional[TestCase] = lambda : None" for proxy then, right?
I want to avoid having to call the object everytime.
That's the main difference between proxy and ref, right?
 
No idea how you'd annotate a proxy
 
Aaah, that's just Optional[TestCase] = None
Or not
Hmm
Well, thanks anyway for the help!
 
9:45 PM
@Aran-Fey Any reason the typing for weakref "ReferenceType"/"ProxyType" is completely broken? First time seeing things like this.
The hint resolves to exactly nothing when using them as hints.
 
I never tried typing weakrefs. What's the problem, exactly?
 
"_tests: list[ReferenceType[TestCase]]" resolves into "_tests: list"
"_tests: list[TestCase]" resolves into "_tests: list[TestCase]"
 
No idea what "resolves into" means. What tool is generating that message?
 
I do want someone to know that there is references in the list and not the "raw" objects.
Hmm, "resolves into" tends to mean that something goes from something into something else, or am I wrong? :|
PyCharm :)
 
But type annotations don't usually go anywhere...
 
9:52 PM
Well, they do go through some processing via "Code completion/Intellisense" in PyCharm/VSCode?
But yeah, okay.
I'm just trying to figure out if PyCharm is the villian here or if I'm doing something wrong I guess.
 
Your IDE might use your type annotations to deduce the types of other variables that you haven't annotated. But at no point should it change a type annotation you've written
 
It actually does though. But I'll investigate this further. Thanks anyway!
I think dataclass is the villian here...
Ooops
 

« first day (4367 days earlier)      last day (567 days later) »