« first day (3780 days earlier)      last day (1160 days later) » 

2:24 AM
@roganjosh and everyone: What are you using instead of conda? pipenv? pyenv? Appreciate quick opinions, my conda env is messed up and I'm nuking it today.
 
2:39 AM
^ To be clear, my use case is I'll want to have multiple 3.7, 3.8, 2.7 envs, with different and quite likely incompatible package dependencies. And I don't want the unpredictable update time (constraint solving spinning-wheel that hangs) of conda update.
 
 
2 hours later…
4:26 AM
@smci I am not a "power user" I just use venv and pip
I just have two different python folders for 3.9 and 3.8 :D
 
 
2 hours later…
6:45 AM
@AndrasDeak reading this article docs.microsoft.com/en-us/visualstudio/python/… it is clear that creating environments helps to deal with different versions of python.
I don't know why my question was ignored.
 
7:39 AM
@EnthusiastiC You'll need both python 3.8 and a C++ compiler to install bimpy
 
8:35 AM
I'm more and more using poetry and tox to manage multiple environments per project. Cross-ver4sion compatibility is important, and poetry lets you manage multi-version development fairly easily.
@EnthusiastiC One of the nice features of conda is that you can create environments with whichever supported Python you want. But that doesn't mean that all libraries support all versions of Python.
 
@holdenweb I'm using Visual Studio now
I think it's more clear
but now i'm facing another problem.
 
@smci Alternatively you could just rewind its history and start again? Try conda list --revisions ...
 
I could not upgrade pip
 
Which pip is telling you to do?
 
this is the error
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Requirement already up-to-date: pip in c:\python27amd64\lib\site-packages (20.3.4)
 
8:42 AM
Stop using the pip command and start using python -m pip
 
i'm running it from VS Terminal
 
Ah, so you are using an obsolete environment. You shoud fix that ...
 
no
i'm using python 3.7
 
Evidently not.
 
Reading that message, it appears as though something is running 2.7. But I already told you to run python -m pip
 
8:46 AM
okay i'll try to add python 3.7 to environment variables list
 
[goes back to programming]
 
Each time I want to install a package an error pops out
Each time I fix an error another one pops out!
 
9:09 AM
i'm trying run a script called main.py
which invoke offsets.py by
from offsets import [some namespaces]
offsets localized in the same directory
but could not recognized
 
10:03 AM
@roganjosh I would like to thank my parents, who always believed in me, even when i thought i would never be able to win this award
 
@AndrasDeak because <=> in PERL is the cmp operator, returning -1,0,+1 for <, ==, > respectively. See this.
@holdenweb No, because some conda updates are necessary. And the conda constraint-solving hang/hours delay every time you try to update a packge or two is insane. See the conda issues for the least few years, 2016-current.
 
 
2 hours later…
AAB
11:52 AM
hi all,
need some advice
in django is it better to add classes using form widgets or use something like django-crispy or widget-tweaks
All I need is to add classes to my form fields, is it better to just use widgets to do the same?
 
12:29 PM
@EnthusiastiC I tried helping you multiple times. Each time I saw the same thing: you either not reading properly what you're told, or just not being able to understand what people try to tell you. Then you keep asking the same thing over and over again, hoping to get the answer you expect (but then why ask in the first place?).
At this point I normally point people to the help vampire guide and tell them to stop behaving like that. But in your case I feel that it's not that you're lazy: this is just how you are and you couldn't do better even if you tried. So I just opted to ignore this question going forward.
 
Andras be gentle
 
Can't you tell I am?
 
i can't :p
 
ignoring the question was the gentlest choice
 
I am diving back into pokemon after such a long time. Feels nice
 
12:37 PM
Watching or playing?
 
both actually. but i'm not a fan of the new galar arc. Sword is hella fun on the Switch tho
and a massive step-up from the 3DS games (X, Y)
There's also an online pokemon rpg I used to play over a decade ago. Went back to my old account after leaving it untouched for years and picked that up again
 
 
2 hours later…
2:34 PM
how would you split a string on characters that are not in a set
so yaaazbbzcccd and not in a,b,c?
 
whats the expected output?
 
aaa, bb, ccc
 
uh, your description does not align with the expected output, at all. but okay. what about yaabbcczzaac. whats the output?
 
aabbcc, aac
 
2:56 PM
ok, then you can explore a simple regex for this. link
 
3:07 PM
@Trajan isn't that what you did before already?
 
omg thanks
 
4:00 PM
@EnthusiastiC With conda you can create a Python 2.7 environment and install 2.7 modules in it. But Python 3 modules (unless designed for compatibility) con't generally run in a 2.7 environmeent.
The command you want is conda create --name py27 python=2.7 - when you activate that environment the python command will run python 2.7.
 
user7659542
arr = [[3621.63, 3662.45, 3669.01, 3666.72, 3699.12, 3691.96, 3702.25, 3672.82, 3668.1, 3663.46, 3647.49, 3694.62, 3701.17, 3722.48, 3709.41, 3694.92, 3687.26, 3690.01, 3703.06, 3735.36, 3727.04], [567.6, 584.76, 568.82, 593.38, 599.04, 641.76, 649.88, 604.48, 627.07, 609.99, 639.83, 633.25, 622.77, 655.9, 695.0, 649.86, 640.34, 645.98, 661.77, 663.69, 665.99]]

mkt = arr[0]
for i in len(mkt):
    print(mkt[i])
 
user7659542
Why does the above code return:
 
user7659542
TypeError: 'int' object is not iterable
 
user7659542
?
 
@cs95 What pokemon rpg is that?
 
user7659542
4:13 PM
Never mind found it: range(len(x))
 
4:40 PM
@traducerad Note that you do not need indexing to iterate. just for element in mkt:print(mkt) should work.
 
You mean print(element) :P
 
I claim educational errors to be fully intentional :P
 
4:59 PM
@smci If I needed fine-grained dependency management on this, I would probably be playing with pyenv now, based on things I've been told internally. But at the moment, each of my projects runs in a dockerised environment and I just pin my python version based on the individual project - a single env per workspace is working fine for now
 
5:33 PM
@holdenweb I appreciate that!
@AndrasDeak Or your answer might be unclear to be understood.
 
6:29 PM
@toonarmycaptain ever heard of the pokemon poke center (tppcrpg)?
its been around since 2000, but it's aged quite a bit now
 
If a CSRF token expires while you have the tab sat open for hours/days, what do people think should happen? I've just realised it's totally silent on my website and the AJAX query will just fail. Should it be an alert on the site? I don't think I've seen any sites that would alert on this, and I don't know whether a user would understand what it says (maybe "session has expired - please refresh"?). Or is there another chain of events I should be triggering on the backend?
This is with Flask btw
 
7:06 PM
Surely that's a matter of site policy?
 
In which case, I think I'm asking how to design it?
To my knowledge, there's nothing about my host that dictates this. My site just dead-ends as it is, which feels bad.
 
What's your session timeout policy?
 
Let's say I standardise on 24hrs as the most flexible policy. So your token definitely gets killed-off after that much idle time. I think what you're angling at here is that it's just in my hands and I'm free to handle it as I see fit?
^ would be a perfectly acceptable answer if my assumption is correct. I'm just unclear whether there's a standard checklist I should be going through i.e. force a redirect and flash an alert on the frontend
 
7:26 PM
I think it should be safe for your server to respond with a "sorry, that CSRF token expired, here's a new one"? Then the JS on your page could silently retry its request and the user wouldn't even notice that something went wrong.
And an attacker can't do the same thing because of the same-origin policy
 
That's my thought too, but I didn't know whether I'd just be side-stepping the security by having an avenue to re-issue a token. I think I need to dig into this a bit more
Specifically, I wonder whether I need to check whether the expired token was originally valid before a re-issue of a new token
In any case, there has to be something better than a silent fail of the website :)
 
7:42 PM
I don't think you need to check if the expired token was valid. Consider: There already is a way to obtain a valid CSRF token just by loading the website and then extracting it from the HTML code. Adding an API request that returns a valid CSRF token doesn't open any doors; it just makes it more convenient to do
 
AAB
@roganjosh if on the ajax failure you refresh the page what is the security issue?
 
@AAB I don't know; that's what worries me. My instinct is to catch the CSRF failure and reload the page with a new token, and an alert to say what just happened. I don't know whether this leaks meta info that's useful to others (like saying "incorrect password" vs. "unknown username and password" which leaves it more ambiguous that you're testing against a valid username). I'm just sense-checking against best practice, if anyone knows it.
 
I don't know about CSRF tokens specifically, but I know tons of websites which break if you leave them open for too long...
Start watching a video, then try to resume it 3 hours later? Lol nope, the video won't load anymore unless you refresh
 
just this week I found a web store that discarded your shopping bag after a few hours
 
is the pattern matching pep the next meme after walrus?
judging by the reception to the news on the starboard i'll say "yes"
 
7:53 PM
I feel like it's not being memed as much as the walrus. Not sure if it's because people like this one more, or because it's sunk in that this is really happening, or if they're long gone and moved to another language
 
to the safe haven of python 2.7
 
@roganjosh it's perfectly safe for your site to automatically get a new CSRF token and retry the request without ever showing an error to the user. remember, CSRF tokens are to prevent CSRF. but a request originating from your site is never a CSRF attack
in fact, if you think users may keep your site open for an excessive amount of time and don't want expired tokens (regardless if session or csrf) to result in errors, you could always open a popup window where the user has to login again, and then keep going in the original window (and retry whatever request failed due to the expired token)
 
8:14 PM
@ThiefMaster perfect; thank you!
 
AAB
8:28 PM
@roganjosh @ThiefMaster I read that browsers don't allow cross-origin requests as in I cant send an ajax call to gmail or amazon form from my website so how does one do a csrf attack?
sorry if the question sounds stupid all I know is csrf creates a secret string, a copy of which is in user session and then the other in user form in Html. When a user submits a check is made to see if the 2 match.
 
8:51 PM
@cs95 I had not. Just had a look. Yes, quite aged, but still looks like fun. The graphics could use some work, methinks. Kinda glad I didn't know of it...quite the potential timesink.
 
 
2 hours later…
10:39 PM
@roganjosh Thanks, that's my Saturday evening project.
 
10:52 PM
@AAB usually by submitting a hidden form
or if a GET request is enough through an img tag
 

« first day (3780 days earlier)      last day (1160 days later) »