« first day (4759 days earlier)      last day (414 days later) » 

01:07
making a super complicated argparse setup, how can I use indents to increase readibility without getting a runtime error?
decided to use if 1:
 
1 hour later…
02:25
I would rethink why you want this structure. It sounds hard to use.
 
2 hours later…
03:55
i want create chatbot in python. anybody help me on same.
 
3 hours later…
07:19
@shintuku You can, but seriously you should not. If the data ultimately comes from some machine/database/automated-thingy, use JSON. If you want humans to input the thing, stick to JSON as first choice and consider a literal re-implementation of that graph via PyParasing second.
@shintuku from a Unix perspective, this isn't a weird thing to do. I once made a complicated argparse setup: github.com/secemp9/openai-tools/blob/main/… but I forgot to document it, so I don't recall exactly what each lines does (I could remember if I use print statement). Anyway, this work in emulating Linux-like workflow, using pipe, etc. If you use argparse, you might be able to do it, but you need to test things and play around to find something that work
 
2 hours later…
09:10
Hello, how do I tell mypy that my mixin depends on a certain attribute?
class A:
    def __init__(self):
        self.name = "name"
    def get_name(self):
        return self.name

class LengthGetterMixin:
    def get_len(self):
        return len(self.name)

class B(A):
    ...

class C(LengthGetterMixin, A):
    ...

print(B().get_name())
print(C().get_len())
this works, but mypy complains "LengthGetterMixin" has no attribute "name"
class LengthGetterMixin:
    name: str
    def get_len(self):
        return len(self.name)
thanks for replying, the general idea is that I add attributes that I would need at class level?
@MisterMiyagi I forgot to reply, thanks, this is what I ended up going with
name: str just tells the type checker that this class is supposed to have such attribute with this type, without actually creating that attribute
thanks, that works equally well, I tried something like this, though I did def get_len(self: A) but it complained with a different error
did not know protocols with property worked like instance attributes
09:25
Yeah, an @property is treated as any readable attribute - be it an actual property or a real attribute.
PyRight had different rules a while back (not sure if they changed it) that treated properties and attributes differently and it was a major pain.
10:24
I don't suppose anyone has insight on amortized O(N) for SQL joins? Is that due to page loads?
 
2 hours later…
12:24
@roganjosh Not a DB expert (as I've probably said often enough) but I see no problem in an O(N) space/runtime join if you have a 1:1 match between the joined tables.
I don't mind the O(N) part, it's the amortized part that I'm curious about sorry
Sometimes I don't know whether "amortized" is just thrown in as a cover-my-backside caveat but I tend to believe this post that there is some intermittent overhead because it's from NPE
Hm, technically something like building a hashtable by looping over the data once often isn't quite O(N) since you'll likely be resizing along the way and have some overhead versus a raw array.
That makes sense. I guess with the page loads too, it's fair to say it is amortized since pages are fixed size and you might not need all the data from any loaded page
TIL that talking about time complexity of SQL is... fun. I've probably made some outrageous claims about my query vs. their python approach that I can analyse. Burden of proof is on them, though, so I might get away with it :P
Worst case, I'll just fall back on the query planner like blaming the dog for a bad fart. "I mean, I told it to do an O(N) search, it's not my fault it's exploding the RAM and taking forever"
12:45
Incidentally, it's stuff like this why I don't like working with DBs. We've got practically 0 experts on DB development so it's always a gamble how the performance will turn out.
We're still in a pretty bad spot because someone made a bad decision ten years ago that turned an O(n)'ish query into O(n^3). These things sting very hard...
That's fixable though. As long as it's not some 1000s line monster query, you have a shot at straightening it up
The amount of times I exploded our cluster previously was fun; multi-billion-row crossjoins. But, you kill the job and go back and sort it. If you have the foresight to have a staging area then it can be a massive advantage to have SQL in your pipeline
Something like Redshift on your "data lakeside house pond warehouse" (or whatever we're up to now) is actually really seriously impressive
 
2 hours later…
15:09
@roganjosh The problem is that the query introduced some additional degrees of freedom on the data. These aren't needed for the proper case but no one knows if any of the deployments out there use an improper-but-technically-valid way to create data.
Hm, perhaps I should rage against our non-existent deprecation story instead...
There has to be an xkcd for "nobody knows how the yam this works but we're definitely not touching it"
Indeed xkcd/1172 has that certain extra edge to it when your compute farm literally makes the office stay warm in winter...
I really wish coding sucks wasn't narrated in such a stupid, annoying way because there are so many valid points in there
"But they left the suspension cables because they're still holding up parts of the bridge. Nobody knows which parts but everybody is sure they're important parts"
15:38
@MisterMiyagi @KarlKnechtel @NordineLotfi thanks a lot for the inputs! I ended up making a prompt_toolkit CLI with a right-side prompt telling me what are the possible next components in the command, using pyparsing for parsing. Since the questionary library is so easy to use I took 30 minutes to add support for JSON entry-by-entry prompts that fill out a JSON dictionary
@NordineLotfi thanks btw for that reference, gave me new ideas for how to use argparse
16:09
@shintuku No problem, glad this was useful :)
 
2 hours later…
18:01
Browsing a github repo when suddenly
commit 303073e
dumb forced 2fa stuff. Dumping this here for later when I need it

github-recovery-codes.txt
+ 436f6-d6520
+ 6f6e2-c2064
This must be on April 1st?
Sep 25 :/
And you know what makes it even worse? It's CheatEngine
The exploiters become the exploited
Mmmm, my inner Admiral Ackbar is stirring. They can't be that stupid, surely
Same. It's suspicious
there dozen of those repo yeah. Some leak credentials and other secret, etc. The fact it's a popular repo isn't surprising, although, the fact it's CheatEngine is funny
@roganjosh I wouldn't say stupid, but definitely short sighted
there just as bad if you browse with specific search argument on github
18:14
I mean, to be fair, you do also need the password for the account. But still
I'm not sure you do. They are for forgotten passwords. I burned two when trying to reset my password
I lie. It was 3
Jun 21 at 13:50, by roganjosh
When it randomly decides that I need 2FA on my desktop, it also logs me out of the app. This has happened twice. If you don't add a phone number for SMS authentication codes then your only option from the browser is to send the 6 digit code to your app... which it conveniently also just logged you out of, making a vicious circle. I blew 3 recovery codes last time this happened - thankfully I now have SMS confirmation set up
even if you need the password, I bet there was (or will be) a CVE that shows you can bypass this if you have the recovery code
there dozen other platform that had their 2fa break more than once the past year, so this is just a question of when
Surely the recovery code alone can't log you in? They're 10-character alphanumeric strings, and you get 16 of them. That can't be the only thing you need, no way
It's not, but the one thing I understood from that fiasco is that I don't understand how it works. I remember being able to ping-pong between different methods and that makes me wary
I don't get it either, but I guess it's not as bad as I first thought. I think it's basically saying "I don't care about 2FA"
(i.e. "1 factor is enough")
18:25
I wouldn't be putting half of my recovery process in plain sight, that's for sure. Maybe they think of it like the McDonald's Monopoly where there's a million Park Lane tickets and virtually none of the Mayfair tickets for the £100k prize, yet some people were trying to sell Park Lane for £50k on ebay.
Maybe I'm the type of person trying to sell Park Lane tickets through paranoia
I don't understand the analogy, but now I'm hungry!
It's like making your private key (ssh, etc) public thinking that since you put a password on it, then you will be fine.
I messed it up a bit. Basically, the Park Lane tickets were everywhere but you also needed the Mayfair ticket (very rare) to claim the prize with the pair. Some people didn't understand the marketing ploy, so once they had Park Lane, they thought they were 50% of the way to claiming the grand prize... but they were no where close. Maybe the recovery codes here are Park Lane tickets
Oh, that's a pretty clever scheme
18:45
@roganjosh Near misses are prevalent in tons of games. Open the loot box and you're 2 pixels away from the ultra rare skin, might as well buy another 20 boxes (because of bulk 'discounts') to get 1 pixel away!
You have to wonder what the world would be like if things weren't... y'know... purposely designed to be bad or misleading
man I keep hitting this problem
@Peilonrayz The RNG will look favourably on me if I just add a few extra money pounds

« first day (4759 days earlier)      last day (414 days later) »