« first day (4911 days earlier)      last day (32 days later) » 

7:13 AM
The internet really needs a better permission system... being unable to change the volume of an audio stream or download a file just because it's hosted on a different domain is ridiculous. How's a guy supposed to write userscripts like this?
 
7:41 AM
@Mikhail sounds like an exception, tbh
having to handle exceptions is the main advantage over error codes and friends.
if you are concerned about distributed setups, remember that exceptions can be caught, sent via a queue/stream/pipe/... and reraised on the other end.
 
8:15 AM
To that end I started drafting something out and realised I have a hole in my understanding. In the past, I was sure that I made a class with a class method that could be used as a decorator, so I wanted to play with that. This doesn't work, however
And the answers I can find are like this where the decorator is outside of the class itself. Did I just have a fever dream that I defined a decorator inside the class body?
 
"In the past, I was sure that I made a class with a class method that could be used as a decorator, so I wanted to play with that." - well, yes; in the code that you show, the thing that you're trying to use as a decorator isn't a class method, but an instance method.
 
Ah, good correction sorry
 
but actually you'll probably want @staticmethod here rather than @classmethod. But the conceptual problem is: you've written the decorator so that it expects self to be an argument to the decorator, but there isn't a self at the point that the other method gets decorated. Instead, it will be an argument to the wrapper, which you should explicitly separate from *args.
 
@classmethod
def _check_failed(cls, func):
    @functools.wraps(func)
    def checks_valid(self, *args, **kwargs):
        if self._failed:
            raise RuntimeError("Something went wrong")
        return func(*args, **kwargs)
    return checks_valid
Something like that should work.
Not that you need cls either, mind.
 
beat me to it
 
8:40 AM
Thanks both. I made a complete hash of that memory and my question. I did indeed mean an instance method defined in the class body and I remember now my inspiration was our own SOPython site. This can be used to wrap routes, but [...]
This eventually gets us back to the instance of a particular User. Somewhere along the way I've fabricated an interesting view of what I built in the past
 
 
1 hour later…
9:49 AM
Does somebody know if I can use the same django translations for html and js?
 
10:29 AM
@Aran-Fey yeah, the restriction on the DOM is a pain. I get they want security, but this is too much. And you can still bypass those through bugs and whatnot, but then they end up "fixing" it, by making it worse for everyone else
 
 
1 hour later…
11:48 AM
The worst part is that Tampermonkey provides a download function for this exact reason, but... it doesn't work :/
 
 
4 hours later…
3:43 PM
Is it possible to listen to XDND events across windows? (meaning: reading the data that was dragged and droped from one window to another?) I've spent days trying to understand how xdnd protocol works and how to listen to event using python-xlib module but whatever event masks I enabled or things Idid, I failed... so any idea on how should i approach it?
* across all windows
 
4:13 PM
@GiorgosXou No clue about the actual topic, but it might be useful to look at somebody else's implementation like github.com/PhilPotter/xlib_xdnd or similar
 
 
2 hours later…
6:37 PM
@GiorgosXou I know you would probably need to listen to events on the root window for that to be possible. But I'm not on Linux atm, so this is just my own conjecture
btw, I used the xlib module a lot last year, and I can tell you, it's not a 1:1 port of it's C counterpart. Lots of stuff are still left non-implemented in the python version, but I think for your case, it's still doable
worse scenario, you might need to use a small C code to do what you want with Xlib, then use ctypes in Python to interface with it
@Hakaishin ah, you beat me to it :P
 
7:01 PM
@KarlKnechtel hi karl, I just saw your message last night. I am not really good with using init, so how exactly would I do that?
 
8:00 PM
@NordineLotfi listening to the root window doesn't seem to do the trick (or I might be missing something).., it only detects the active windows, mouse-events and stuff like this only... I does though detect the rectangle that is created during the DND event but it fires\\calls no detectable event back. To close with, here's a repo I found that might help anyone diving into this later github.com/frank038/Xorg-clipboard-xdnd.
* stuff like that only
* It does though
 
@GiorgosXou I see, so that means the repo you linked here work for your case or?
also it seems to depend on gnome apps, so I don't think this is the right solution, but I guess it's a start
 
@NordineLotfi no it doesn't work. The repo demonstrates how dnd works on a newly created window. I, want to get\\capture the (draged and droped)-data from any window (without creating one).
 
I get detecting dnd event on all windows, but could you clarify when you say "without creating one"?
so you want to do that without ever creating any window?
 
@NordineLotfi yes
 
what's the use case? could you give an example because it's hard to picture
 
8:15 PM
Yes, I need to virtually-detect a drop action under a terminal github.com/GiorgosXou/TUIFIManager/issues/21
I want to differentiate a drop action between a normal window and a window that doesn't accept droping stuff (like most terminals)
 
but how do you want to do that? on all terminal, even the ones where you aren't running said application?
ah, nevermind, looking at the github link make more sense now
 
I only want this to work with the one terminal
where i run my app
 
I don't think you need to detect it across all windows yeah. Just need to know how the dnd data looks like so you can craft it, and send it to any window when doing the dnd event
 
Yeah, but i can't grab it
I can't capture the data
I can capture the rectangle that it is created during DND but not any data
It is more important for me to capture the data dropped from a GUI into the terminal app
and not so much the reverse (drop files\data from TUI to GUI [that's doable without xdnd too])
I just want somehow to get data droped into a terminal
that;s all
data meaning files, text, images from web and etc.
Anyways it's late here, I'm leaving for today, see you all tomorow, gn
 
9:22 PM
I just found this interesting thread on Greg Egan's Mastodon page. hachyderm.io/@inthehands/112145650651353941
> Yesterday a student came to me with project questions. She was trying to learn some ground-level tool basics (how useState works in React, but details don’t matter), and she was just hopelessly confused: the pieces were there, fragments of nascent understanding littered all around, but somehow it just wasn’t coming together for her.

She walked me through her fragments of non-working code, and as I was trying to figure out how she’d got so lost, she popped back to her documentation source:
> ChatGPT.

I had her type “react usestate” into a search engine and showed her how to identify the React project’s •actual documentation• in the search results.

She looks at it. A long pause. Then: “This is SO much better.”

After who knows how many hours of struggle, she was unstuck in 5 minutes.
 
How do you never look at the actual documentation? That's wild
Are people cargo-culting information gathering now? "Everyone uses chatgpt, so I'll use chatgpt"?
 
pretty much. they depend on a singular thing, and then end up being surprised when it's not good enough...especially with the whole anthropomorphizing, which make it worse
 
Though, I can't blame the students too much... I mostly blame schools for not teaching important real-world skills like that
 
9:53 PM
It's basically the same problem that led to the banning of GenAI on SO: ChatGPT sounds like it knows what it's talking about. So newbies are fooled onto thinking that they're getting good-quality info. And experts have to put in a lot more effort to assess ChatGPT output because many of the traditional symptoms of low quality aren't present. Or at least you have to dig deeper.
OTOH, that can also be reversed: if you're an expert, and you've become familiar with the writing style of ChatGPT, you may be tempted to unfairly reject something just because it sounds like ChatGPT. And ChatGPT fans may intentionally write stuff in the GPT style because they think it sounds smart.
 
I mean, looking on another lens, you don't need to be a newbie or expert to discern this. Just critical thinking or self reflection (or related thinking paradigm)
 

« first day (4911 days earlier)      last day (32 days later) »