« first day (3791 days earlier)      last day (1140 days later) » 

12:53 AM
@MisterMiyagi thanks for the answer, I wanted to know why, as for fixing it, no not really, if you say it is complex it probably is, so I will see some bugs or issues in aiohttp git page to understand
 
hey
has anyone used flask-migrate before ?
i'm trying to add a column but instead I ended up replacing the table with the temp empty table with one column lol
i'm so glad that that is a test version.
 
1:50 AM
%timeit np.ones(1_000_000_000) * np.pi
%timeit np.zeros(1_000_000_000) + np.pi
any guesses?
3.01 s ± 65.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
2.53 s ± 55.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
 
 
2 hours later…
4:09 AM
@Skyler how does one do these? the main dev who merges is cool? If I do something like this chances are I get a review comment asking me to remove :/
I have however snuck in base64 encoded comments like that. they will just think its random string
 
4:20 AM
Hi there,
I am looking for a person to help me out how can I calculate density of points in a trajectory.
 
 
4 hours later…
7:53 AM
@AsaYa volume/points?
 
@Aran-Fey As far as I can tell, it's a bug in aiohttp, due to a bug in asyncio+windows. Both of these should be fixed today.
But asyncio+windows seems to get very little usage, and thus not much/quick maintenance.
 
8:43 AM
import httpx
import trio


async def main():
    async with httpx.AsyncClient(timeout=None) as client:
        headers = {
            "X-Fsign": "SW9D1eZo"
        }
        r = await client.get('https://d.flashscore.com/x/feed/f_21_0_2_en_1', headers=headers)
        print(r.text)


if __name__ == "__main__":
    trio.run(main)
is that kind of data can be extracted? i mean is it represent any kind of data you familiar with ?
the point that am trying to extract the matches scores from that site if you've navigated to it and selected 2 March, i noticed there's an XHR request which feed the HTML page. am just try to extract the data to avoid using selenium.
 
 
1 hour later…
10:04 AM
Can people help me parse this comment thread on an answer of mine? I am feeling way too dense and slow this morning: stackoverflow.com/a/16238370/100297
I have a sense that the person commenting is wrong, but can't put my finger on why, so I'm assuming I'm missing something vital myself.
 
10:17 AM
I am not sure what exactly they are saying, so it's hard to say whether they are wrong about it. There is a lot of distracting accusations in there.
I think what they are complaining about is that you did not explicitly say why defining any of lt, gt, ... is enough.
Say, show how total order can be derived from lt+"default eq" the same way as the question derives total order from just le.
 
the comments are a wall of thread, so i'll first mention purely re the question and the answer: i think both are clear, and the answer addresses the question well.
lemme get through the comments in a bit
 
cbg
 
i suppose the main question is, the asker is implying that 1 "le" or 1 "ge" should be what the specification should force us to define, and it should automatically define (and be able to define) the remaining 5 operations.
i dont even know if thats true or not.
 
10:57 AM
@ParitoshSingh at least I read the thread right then. I know __eq__ plus __le__ is sufficient to sort with.
@MisterMiyagi: I was addressing the question asked, but I think the commenter wants me to answer a broader question too, but then gets lost in a formal proof of logical comparisons and their equivalents. I think.
 
lacks debugging details; I tend to close these as duplicates of stackoverflow.com/questions/22743548/cronjob-not-running but I already spent my vote
 
I recall a similar discussion by someone else that I directed to the Python Discourse site, I need to look that up.
 
@MartijnPieters Oh. I know that guy. Had a few meta questions that went south.
(FWIW, I also had a few meta questions with them that turned out to be very good.)
"meta" as in not practical but language design/rational/practices.
 
11:32 AM
Hello,
how I can install anaconda package from local (my computer). I downloaded the package from GitHub because when I perform the pip install infostop I came across problem with a error which means there is no package
Hello,
how I can install anaconda package from local (my computer). I downloaded the package from GitHub because when I perform the pip install infostop I came across problem with a error which means there is no package
@Hakaishin these are 28000 records.
 
hi ,i need to store session Id on login and remove it on logout, should i store it as a string or integer ?
 
@AsaYa and?
I wouldn't even touch anaconda with a 10ft pole
 
i'm using flask_login for this purpose.
 
@MisterMiyagi Yes, that Discourse post was created after they continued to discuss their question, stackoverflow.com/questions/60541080/…. You and I both posted answers there. :-)
@LoopingDev: what do you mean by 'session id'? Store it where?
 
@MartijnPieters Oh nice, totally missed that you answered that one! fetches reading glasses
 
11:45 AM
@MartijnPieters user's database , as I'll be using it to send notifications to that specific user later on
so I store it on login and drop it on log out
 
Hey guys I have a upcoming programming trial which will involve making bots for entry level position... considering today was the second on I have done is the way I went about it good considering that when they send the brief may follow similar methodology. I have these: dpaste.com/4APVLGQ6R this is the proxy.py and dpaste.com/9KKLTP94V this is the scraper
 
@LoopingDev: and is the session id an integer value? Then store it as an integer. I'm not sure what you are asking here.
 
that is exactly what I'm asking , I've never done this before, I dont know if its integer or not either
what is the best right way to do it?.
has anyone done this before?
 
Just run the app as a test to see what type the id is.
 
ok what do u call that " 6WoF8BPy0dmd-K5uAAAD" ?
clearly not integer.
but is it char or something else ?
 
11:55 AM
it's a string.
 
alright , thanks I'll try to store it and use it as a string and see if it works.
 
btw, just for future reference, dont hesitate to run type on whatever variable you're not sure about. so, type(your_variable)
 
@piRSquared welp, that almost killed my laptop session. Could you please post a warning about the size of those arrays along with the post? I was going to check whether the difference was due to */+ and trying to figure out what your point was, and I didn't notice the sizes.
 
i guess "any guesses" has a new option: almost kill AD's laptop
 
12:14 PM
_id = current_user.get_id()
print(f"\n\n _id: {_id}\n\n") # this prints: _id: 1
user_= Users.query.filter_by(_id)

i keep getting this error:
TypeError: filter_by() takes 1 positional argument but 2 were given
 
@LoopingDev sounds like a class method/static method/instance method issue
for an instance method the object itself is automatically passed as the first argument
The value of _id is irrelevant, because the issue is how many arguments are passed to filter_by.
 
I'm confused, how could we tell the app to pull the right user then without filtering by id ?
 
I don't know any of the DB aspect, I only see a python error.
perhaps you have to pass arguments as keyword parameters
Presumably there's documentation that can be looked up.
 
Yeah... it's keyword argument based... .filter_by(name='whatever', id=5) kind of thing
 
oh yeah, I got it now.

so to fix this : user_= Users.query.filter_by(id = _id)
thanks a lot !
 
12:21 PM
@LoopingDev style suggestion: remove the whitespace from around the = in function calls and definitions. Only keep that whitespace in assignments.
i.e. user_ = Users.query.filter_by(id=_id)
 
I like it,it looks neater, thanks for the tip!
 
No problem. It comes from PEP8 but it's one of the things that makes complying code a lot more readable to those used to it.
 
it took the nagging of an IDE to get me used to that one, i'll admit. that's apparently a PEP8 recommendation.
 
user14697742
for some reason I have stopped using IDEs
 
user14697742
I love vim
 
12:26 PM
@LeonhardEuler that's not some reason, that's the best reason
although it's still easier (i.e. possible) to automatically refactor code with an IDE
 
user14697742
yeah
 
user14697742
but vim can be made very close to an IDE by using plugins
 
Yup. I don't have any, though.
 
i guess big question, if i press tab in vim, does it give me 4 spaces?
 
@ParitoshSingh it takes one line in .vimrc but yes
it's what mine does
Also auto-indents after : and removes a level of indent after return, break etc.
 
12:30 PM
oh. that's a lot better than i presumed
 
pretty much my only gripe with it is that its standard highlighter doesn't recognize rf-strings out of the box, but it doesn't bother me enough to fix it myself
 
umm... think mine is okay with r/f strings...
 
@JonClements not r/f, rf
 
user14697742
and sometimes I use vscode for big projects
 
ax.set_ylabel(rf'$\Delta \Omega_\mathrm{{band}} \left[\mathrm{{{units}/f.u.}}\right]$')
 
12:31 PM
@AndrasDeak ahhh okies... can't remember ever having to use an rf string - so guess that's why I wouldn't noticed :)
 
you mostly only need it for templated latex
 
12:44 PM
@Kwsswart How did that interview go?
 
12:58 PM
@holdenweb Went well they said they are going to send me a programming challenge that will entail building a web scraper hence why I am practicing with more and finding ways around the problems I had before ^^
Thanks for asking mate... Spent the morning doing a little project to go through amazon products as posted above just trying to find out if the method i did it was a good approach if i follow a similar one during the task they set
 
@Kwsswart Sounds like progress. Well done!
 
@Kwsswart congrats, hopefully you are not a victim of "take home projects"
 
1:13 PM
a fundamental question re git: is a merge request supposed to be raised only once a branch is "finished"? or when you've made a branch but havent finished yet? or both?
 
both
 
I like merge requests as early as possible.
Makes it clear someone is working on it, and allows for comments.
 
just to show "its being worked on"?
ah. got it
 
1:30 PM
morning cabbages, folks
 
@ParitoshSingh github even supports "draft" PRs
And I've seen a bot called WIP that can check for WIP or a construction sign emoji in a PR's title and pretend to be a pending test until that's removed, to ensure that it's not merged
 
@AndrasDeak yeah, that's kind of how i stumbled upon this. we use gitlab and i made my very first merge request (yay!) and it told me to add a WIP if i don't want this merge request to be immediately merged
and my first reaction was, what? a merge request that shouldnt be merged? suffice to say, i did not get it upfront :P
 
gitlab also has that setting as a failsave. If an MR's title starts with WIP, the merge button is greyed out. reduces accidental merging to nearly 0%.
 
If a website endpoint only allows posts, what would you return? Currently we return 404 which seems wrong, I checked the list: developer.mozilla.org/en-US/docs/Web/HTTP/Status but the most specific one I found is 405. Is there a better one?
 
The framework I use goes 405 - {"detail":"Method Not Allowed"}
 
1:44 PM
Yeah, 405 seems to be right, I just checked django and you can pass it a list of allowed methods and the example has post/get
 
@python_user Thanks mate Sounds like its going to be one of them they will give me a week to complete it
 
wow a week seems excessive. Just beware of scammers. Especially if it's for a scrapper, which is often used for scams
 
@holdenweb thanks mate
@Hakaishin seems to be a legit company they have been around for 25 years and essentially working with market research
 
nice to hear
 
2:21 PM
typo, only revealed when the OP updated with their real code stackoverflow.com/questions/66454710/…
 
user13727121
2:44 PM
Say that I have a list of integers, list = [3, 5, 7, 9, 11, 13, 15, 17] and I want to validate the index values where x = 6 or x = -6. Is there any difference in writing -len(list) <= x < len(lst) than just write it in a simpler way x < len(lst)?
 
len(list) <= x < len(lst) took me a while to realise list and lst are two different things. what does "validate the index values where x = 6 or x = -6" mean? I didn't quite understand the ask
 
@CoreVisional you'd normally just try indexing and put it in try:
and yes, there's a difference: what if x = -2*len(lst)?
Last note: don't call lists list because that shadows the built-inlist name.
 
user13727121
I also tested it out, the formal seems to return False if x is out of index bound, like x = -50, but using x < len(list) seems to always return True if given any negative index
 
@CoreVisional yes, why would they do anything else?
Do you understand the basic math at work here?
 
aye, because negative numbers will always be less than a positive number
 
2:52 PM
just to be sure: by "validate the index", you mean "test whether x is a valid index for the list lst"?
 
user13727121
hmm, that means if I don't care about the index in the negative, then x < len(list) will do... but I think I'll just stick with -len(list) <= x < len(lst) to also validate negative index values
 
user13727121
@MisterMiyagi yes
 
@AndrasDeak Ack! Sorry about that. Next time, warnings abound.
 
3:08 PM
@CoreVisional AD had a better suggestion for this though. just use a try: except IndexError if that's what you're doing.
that's considered more pythonic and it's probably also more performant in normal use
 
3:25 PM
hey guys what is a good directory web pages
 
3:39 PM
I just learned this: if you have a child process (using multiprocessing.Process) and you have a queue between the two, If that queue has data (even though the child process has been terminated), the program does not end because the queue is still active. I thought that the queue is de-allocated when the referencing processes are terminated. Is someone able to weigh in on this?
 
4:22 PM
@inspectorG4dget The multiprocessing queue docs have two prominent warnings that Bad Things Happen™ if a queue end is terminated, and if a queue end cannot flush.
Guess you got hit by both. :P
 
it was the second one. Thanks @MisterMiyagi
 
 
1 hour later…
5:32 PM
@ParitoshSingh Also the more often you merge into master the smaller each changeset is, making them easier to understand and verify. Everyone dreads the 43-file 2,000-line pull request!
 
5:43 PM
Totally agree with that. I just went on a mini-rant at work about how we don't make personal branches to close the >1 issues that each of us is assigned - we create issue/feature branches and commit/merge each one
 
Air
6:08 PM
So this is a new one to me. I grabbed 3.9 via apt and it says the version is "3.9.0+" - plus?
I'm not seeing anything about a plus in the python.org releases
 
@Kwsswart google
 
Air
This Q&A says the plus is for an "unreleased version." The link's dead though. I guess apt is just ~5 months behind the .org releases or something?
 
6:39 PM
how can i make a request from a server to another server ?
 
A HTTP request? Same way you do it from a client to a server
 
 
1 hour later…
7:55 PM
@randomscientist Glad you asked. The terms "server" and "client" are relative to the service. A web server, for example, will typically be a DNS client among other things, and there's no reason why it shoudn't also be a client of some other HTTP-based service.
This is, indeed, exactly how WebFaction used to organise making customer web sites available: its front-end Apache server would make HTTP requests to the various customer sites, which would be allocated locahost ports and accessed for content when the approprrite Server: header was found in a request.
 
 
2 hours later…
9:40 PM
@ParitoshSingh Plus working that way encourages development behind "feature flags" allowing code to be deployed to production environments and tested selectively before final release.
 

« first day (3791 days earlier)      last day (1140 days later) »