« first day (3654 days earlier)      last day (1287 days later) » 

7:23 AM
@MalikBrahimi that middleware probably has to access a database as part of its functioning and that's non-trivial if you want a secure system
If you want to authenticate/authorise/some other "auth"-y term a user, how will do you that if it's running client-side without exposing what you're doing? At least to me, that's a pretty compelling argument to have a hidden backend
However, I'll accept a "well, there's this approach, dontya know" as a response :P
 
7:43 AM
@MalikBrahimi Brett Cannon is working on that!
 
I suspect this will all get implemented and I'll be left looking the the troglodyte that angrily waves my fists at cyclists on the pavement
 
No, you'll be the critic who forced the project into usability!
 
"It was at that very moment when roganjosh's tomato hit my face, I just knew we needed to implement Feature X. And so... it was born".
 
8:03 AM
That seems to presuppose that flying tomatoes have a critical function. It's going to be that kind of a weekend ...
 
Would it be better if I threw a lettuce?
I mean, I'm not too fussy on the tool for heckling if it lines your weekend up better
 
As in less critical, or more? :P
 
Oh, there's a ranking?
 
When it comes to flying vegetables the only rule is "thrower's choice"
 
Then I'm erring on the side of the tomato for superior aerodynamics
 
8:07 AM
I thought heckles were usually verbal. Perhaps you could just shout "tomato!" at appropriate intervals.
Definitely with you on the aerodynamics. Avocados, however, are denser and heavier ...
 
@holdenweb <eyes you suspiciously> you mean to say you don't use flying foodstuff to drive your point home??
@holdenweb yeah, but I'm not trying to hospitalise them :P
 
"You've insulted me, sir. Tomatoes at dawn tomorrow!"
3
That kinda works in salad. Imagine two people hurling mild obscenities at each other across the morning mists to settle a difference of opinion. Immediate world peace!
I realise I've elided a few steps along the way but [waves hands] that's just detail.
 
Yeah, our ancestors definitely had it all lined up when they used to throw fruit/veg at people on stage. We were this close to world peace. Where did it all go wrong?
@holdenweb yeah, none of that, please :P
 
A day in the stocks would certainly teach our current batch of parliamentarians ho they were held in [absence of] public esteem. I haven't been to London in > 6mths, but I'd make a trip to throw rotten fruit at cabinet members. Or shadow cabinet members, come to that.
They shouldn't be allowed the dignity they are.
However, happy to veer away from potential political differences by changing the subject.
Look, squirrel! [points]
The sad fact is there's more money in manufacturing armaments than vegetables.
 
@holdenweb I suspect there are no differences to be had, here. But yeah, reading the news is enough of that for me so it might be best :)
 
8:15 AM
Got to think about the readers.
 
@holdenweb Does the second amendment mention right to bear fruit? I think not! (Risky political discussion averted.)
 
8:26 AM
Next thing you know vegetables will be demanding the right not to be thrown. It's a crazy world we live in nowadays.
 
I want to open expose an endpoint on my website for someone to leverage the vehicle routing server. I want to see if my thinking is off so I invite feedback. I could create the endpoint that checks for a UUID in the JSON payload e.g. {'access': <pre-distributed uuid here>, 'drivers': [...], 'matrix': [...]} and just reject the request if the uuid doesn't match. It's a mixture of least effort (this is temporary) and not being too fussed about traffic. However I feel like I might be blinkered
<cont.> and might be doing the equivalent of rolling my own crypto
There's also a consideration for the end user(s) that I don't want it to be complicated to access. It's basically to support developing a python wrapper on the solver while I work on building the stack internally. So, temporary and it's only going to be toy data going through. It's me that carries the risk and I might be underestimating the risk to me with that auth mechanism
 
8:46 AM
Eh, I reject that approach on my own terms. If I'm gonna do it, I should do it completely and properly, and the users will have to accept the correct auth mechanism
 
9:06 AM
too broad doesn't start to cover it stackoverflow.com/questions/64400574/…
 
Closed
Related question: do the traffic lights at crossings where you (the room) are have a dial on the bottom that rotates when it's safe to cross?
Apparently that was invented at the University of Nottingham. It's to help deaf/blind people know that it's safe to cross. I never knew it existed until it was mentioned in some presentation
Certainly in the UK if you put your hand under the box that you press for traffic lights, you'll find a dial there that spins while it's beeping (unless it's super-old)
 
@roganjosh no
The few blind-friendly lights we have make a tick-tock sound and the frequency signals the state
There are even fewer lights that don't make a sound by default but can be enabled with a remote control
If you're both blind and deaf, bad luck...
 
9:21 AM
It's one of those things that is hiding in plain sight. After the presentation, I went out to check and indeed found it. So far I've not met another person in the UK that knew it existed (my grandma happens to be completely blind but can rely on the crossing beeps)
But there's plenty of crossings where the beeper fails and you have to rely on the "green man" so I immediately informed her of this miraculous invention :)
 
9:39 AM
This code snippet should create a black rectangle over the image: "img" at the coordinate 420, 320
But the problem is that it doesn't create such rectangle. What am I doing wrong?
 
I guess the code was formatted correctly
 
@TanishSarmah please see sopython.com/wiki/… for formatting code in chat and practice in the sandbox
@TanishSarmah guess again
 
Well sometimes the ctrl - K is tricky
 
@TanishSarmah Hence practice in the sandbox
 
9:44 AM
Okay my guess was wrong
 
Practice until it works...
 
Yep it worked
 
This time the code was formatted I guess?
 
Notwithstanding that the code wasn't formatted, there seems to be literally nothing in there attempting to draw a rectangle.
 
9:53 AM
data[420, 320] = 0 Doesn't it creates a rectangle over the image?
 
it sets one pixel.
that's not a rectangle in my book.
 
@MisterMiyagi Yes I want that pixel only!..But it is not created why?
 
I wish we waited for the step of learning code formatting as an investment in our collective future
 
@TanishSarmah To answer that, please mind Andras' attempts to teach you to provide an MCVE.
 
9:55 AM
Next time it will be for-if-else and we'll absolutely need indentation
Might as well start now
 
@MisterMiyagi MCVE?
 
@AndrasDeak semi-seriously I've been toying with the idea of having a JS-room-esque bot that pings new users. It wouldn't help in this particular situation but I wonder what the appetite is for it
 
how do I run an async function inside sync function, and get results as well? Like:
async def foo():
    return "hmm"

def main():
    #...
    output = foo()
 
@roganjosh meh
@TanishSarmah MCVE. In this case, a piece of valid python code. Your attempts so far are not due to indentation errors.
 
@BlackThunder "don't"
 
9:58 AM
And imports are missing too for it to be reproducible
 
@AndrasDeak Oh! Okay
 
I thought it would be better than replacing dozens of sync functions with async functions :/
 
@BlackThunder I'm assuming here your actual code has some more sync/async functions, and the sync function likely is called by an async function.
If not, just do output = <your favourite async framework>.run(foo()).
 
10:49 AM
globals()['word'+str(numofwords)] = words[numofwords-1] weekend SO fun
 
seen a "dynamic variables"+"input" question yesterday. of course "exec(...input()...)" came up...
 
I added a NOT RECOMMENDED notice. Question is educational, and it is good for the user to know this solution (with the NOT RECOMMENDED notice) as you and i know about it. Cheers — IoaTzimas 1 min ago
I used to trawl main but I don't think I can get passed ~5 questions now without upsetting someone and getting irritated myself
 
well, at least right now you can try to hit the downvote survey!
 
11:04 AM
Seems I dodged it on this occasion :P
.. I think. I'm not sure I know what it'll look like if I'm selected. If I get picked, I don't think my answer will change anything anyway. "Why did you downvote this?" --> "I draw a lot upon my spirit guide, Keala Settle: 'This is me'"
 
 
1 hour later…
12:08 PM
@holdenweb I've re-reviewed this discussion and feel like I missed an obligatory video :P
 
 
2 hours later…
1:45 PM
@roganjosh Totally news to me.
 
Hopefully gave you a smile, though :) Let's hope the tomato duel works out better!
Oh, I messed up in what you were replying to, sorry
 
It was the disc under crossing controls that was news. The video did indeed give me a smile, thanks!
 
2:13 PM
@holdenweb It's one of those reality checks, at least to me. Channel 4 does its job to communicate issues like this </sarcasm>. I wonder whether you're gonna be the next weirdo inspecting traffic lights (been there, done it :P)
 
3:01 PM
Got a weird one here - I have a test function, all of whose assertions succeed when run in the main program, but the final one fails under pytest. I'm comparing two dictionaries. Can't get a handle on this.
 
user12867493
3:20 PM
Something weird is happening with Numpy. When I do *12 on 4417716743823624570 it gives me -2327631295245160008 which is obviously not the answer. Why?
 
because numpy has limited-precision integers
what's the dtype?
 
user12867493
Is there anyway to get around that?
 
user12867493
What do you mean?
 
user12867493
I just do ar = numpy.array(self.FancyList).
 
user12867493
I need it to be an exact answer.
 
3:30 PM
AFAIK to get arbitrary precision in numpy, use dtype=object. That defeats most of the purpose of numpy, though.
 
user12867493
I have to find another alternative. I have to make an API in Python but I keep getting Time Limit Exceeded.
 
@MisterMiyagi correction: that defeats the entire purpose of numpy
 
@Xnero Can you perhaps clarify why you need numbers that large? Most real things are not that large.
 
@Xnero you can convert to float which would turn your 1e20 error into an 1e4 error
@MisterMiyagi [citation needed]
 
user12867493
The API has to create, append to, add x to every element, multiply every element by x and return a certain index of FancyList
 
3:33 PM
@AndrasDeak Private conversation with MisterMiyagi, 2020 AD
 
user12867493
I thought to use numpy to speed it up, not sure how else I can speed it up otherwise
 
user12867493
class Fancy:
    def __init__(self):
        self.FancyList = []

    def append(self, val: int) -> None:
        self.FancyList.extend([val])

    def addAll(self, inc: int) -> None:
        self.FancyList = list(map(lambda x:x+inc, self.FancyList))

    def multAll(self, m: int) -> None:
        self.FancyList = list(map(lambda x:x*m, self.FancyList))

    def getIndex(self, idx: int) -> int:
        if idx >= len(self.FancyList):
            return -1
        return int(self.FancyList[idx]) % 1000000007
 
@Xnero since "time limit exceeded" this sounds like a code challenge site. So the answer is "using an algorithm with better scaling"
 
user12867493
@Xnero It works, just needs to speed up...
 
what works? Fancy is not exactly a problem statement.
 
3:35 PM
keep track of the sum and product as you append values?
 
user12867493
@MisterMiyagi The class works.
 
Marx disagrees
 
user12867493
@AndrasDeak Good idea.
 
@Xnero But what problem does it solve? A class by itself does not do anything.
 
big number problems
 
user12867493
3:36 PM
@MisterMiyagi "Write an API that generates fancy sequences using the append, addAll, and multAll operations."
 
don't tell me you've never wanted to write an API like that
 
user12867493
# Your Fancy object will be instantiated and called as such:
# obj = Fancy()
# obj.append(val)
# obj.addAll(inc)
# obj.multAll(m)
# param_4 = obj.getIndex(idx)
 
@AndrasDeak before or after hitting myself with a hammer?
Answer: Both.
 
you can fasten that hammer on the end of a drill and then you get repeated hits faster
 
@AndrasDeak Isn't there a way to do it with numpy?
 
3:38 PM
in the next release
 
@Xnero so do you actually need all the values at any time, or just one/few values at some time?
it might be faster to store the base numbers and operations, then compute the result on-demand.
 
I think they've already told us what they know about the problem
 
user12867493
@MisterMiyagi When the API is called, the new values are checked.
 
user12867493
Too long.
 
@AndrasDeak I am waiting for their realisation that they should try and know more about the problem.
@Xnero I have no idea what that means in practical terms.
 
3:42 PM
perhaps they just have to wax on, wax off
 
user12867493
@MisterMiyagi When multiply or whatever is called, I have to modify it right then before the next call.
 
@Xnero Says who? The usage example shown above does not check that.
 
ah, addAll and multAll (ugh) don't take the product and sum of the numbers
    return int(self.FancyList[idx]) % 1000000007
that's the only value you're grabbing from your "API"
So... you don't need big ints, do you?
 
user12867493
Yeah.
 
user12867493
I'm pretty sure it checks the list value after every call.
 
user12867493
3:44 PM
I'll have to check.
 
do they check the list value, or the list value % 1000000007?
do you ever need the value without % 1000000007?
 
user12867493
@MisterMiyagi Nope.
 
4:04 PM
Then strongly reconsider why you need to store the result of 4417716743823624570 * 12.
 
 
2 hours later…
user13598750
6:27 PM
hi
 
6:41 PM
Come on @user13598750 . You've broken multiple room rules. You've posted a big block of code, pinged Andras out of the blue and (not in the rules) requested access to Ouroborous
Why have you pinged Andras? Have you had some prior discussion over this that I've missed?
 
they didn't even ping me :P
 
I noticed the typo afterwards :P
Still, there's probably some analogy for "shots fired"
 
6:59 PM
The docs really need a better explanation of self. It's first mentioned in the text here, even though they've been using it in method definitions for several sections before without explanation. Then, when they finally do get around to mentioning it, all they say is
> Often, the first argument of a method is called self. This is nothing more than a convention: the name self has absolutely no special meaning to Python. Note, however, that by not following the convention your code may be less readable to other Python programmers, and it is also conceivable that a class browser program might be written that relies upon such a convention.
 
@MattDMo which is true
 
What's a "class browser program"? Sphinx?
 
It is, but they don't say anything about its referring to a class instance, for example.
 
@roganjosh linter etc. I think
@MattDMo because it doesn't :P
 
huh?
 
7:02 PM
also, that's the tutorial, not the docs (but this is just pedantry)
@MattDMo it doesn't refer to a class instance in a classmethod or a staticmethod or when you look up an instance method on the class etc.
The point of the paragraph is that self is not special which I agree with. What the tutorial should do instead (and I hope it does) is explain well how different kinds of methods get their first arg passed automatically.
 
@roganjosh Any utility that allows you to examine the class structures.
 
@AndrasDeak Don't you still need it with classmethods and staticmethods?
 
@MattDMo for classmethods the first arg is the class, and staticmethods don't have an automatic first arg at all (that's their point)
 
OK, classmethods use cls...
@AndrasDeak oh yeah, right
 
def instance_meth(self, *args), def class_meth(cls, *args), def static_meth(*args)
 
7:05 PM
@roganjosh Bro you really don't sound like you understand
I was talking about client side Python
The problem is that Python isn't inherently dynamic or built for web
It will render a template once with it's corresponding context on page load
 
> Pyrhon isn't inherently dynamic
 
Bro, I think you're approaching me totally wrong
 
@MalikBrahimi Rather an insulting way to make your point? I for one have little idea what you are talking about.
 
Anyway my point is it would be cool to do what's available with client side JavaScript with Python
 
@holdenweb you don't get it either, bro :P
 
7:07 PM
"If you want to authenticate/authorise/some other "auth"-y term a user, how will do you that if it's running client-side without exposing what you're doing? At least to me, that's a pretty compelling argument to have a hidden backend
However, I'll accept a "well, there's this approach, dontya know" as a response :P"
 
:-)
 
Hence why I said "client side"
No one said expose DB credentials in your frontend
 
I said it
 
@AndrasDeak but it does refer to the class instance in just plain (not @classmethod or @staticmethod decorated) methods, right?
 
@MalikBrahimi By which you mean the web client. Which can't use the DB until it's established a valid identity.
 
7:08 PM
Because I think you're just deliberately ignoring actual constraints to make some fantasy land
 
No you'd still need a backend
Or have a comprehensive framework like next.js in which you have server side rendered templates with dynamic content
 
Whatever he's doing, he's certainly not communicating well.
 
^
I think they're selling us a dream that I have little appetite for
 
You said something about Brett Cannon
What was that exactly
 
And, since I find the assumption we don't understand web technology a little offensive, I'm going to leave you to do your own research.
 
7:10 PM
@MattDMo the first arg does. "self" doesn't. Does this make sense?
 
I didn't say anything to you @holdenweb me and @roganjosh were having this convo yesterday and he wasn't on the same page
Take Django templates for example
If you want dynamic content you have to have a script tag
 
@MalikBrahimi Ok, and do you know who he is?
 
lmao I was asking him so no
 
He's boss bro
 
Point is templates are rendered once in Python land
 
7:12 PM
@AndrasDeak I think so. So, I could write a class where the instance methods all use the first argument cbg and it would be fine, I just need to be consistent, right?
 
There's no real semblance of dynamic content
 
@MattDMo exactly. And only consistent within a method
 
Now with WebAssembly other languages can run in the browser
 
@MalikBrahimi Then go do your research because I'm pretty confident in my opinion that you're talking nonsense when Steve is saying the same
 
le sigh We're a community here, bro. We hang together, and there are some pretty sharp minds.
 
7:12 PM
Not so much Python but at least compiled C
Point is it should be feasible to have a client side Python framework
In very much the same way Blazor is doing with C#
 
Look into Blazor WebAssembly for yourselves
 
I've had enough of this. Can we please stop @MalikBrahimi?
It's not going to go anywhere
 
Given that you apparently have little idea of the significant efforts that have already been made to achieve Python in the browser and are unaware of the many real problems that have already been solved and the progress that's been made.
 
user13598750
@roganjosh Thanks for Your response. Actually am waiting for the last 2 days to sort out my problem. I've also posted it on the StackOverflow. I no one helps me to solve this problem
 
7:15 PM
@MalikBrahimi Then you come in here talking like Lord Muck about something you don't appear particularly well-qualified to discuss. I'm perhaps being over-sensitive, but you've got right up my nose.
 
@AndrasDeak OK, I got it. I guess my beef with the tutorial then it that it doesn't explain that in an understandable way. At least that I found
 
@holdenweb It's my job to try not let that happen :) I'll (try) handle it. Just concentrate on being awesome :P
 
@MattDMo The tutorial's far from perfect. It too is open source, and suggestions for improvement will genuinely be welcomed. It's just that maintaining it is a chore for the devs whose real job is building Python, so they pretty much do the absolute minimum.
 
@MattDMo yup
 
You could make a name for yourself there ...
 
7:19 PM
@holdenweb I actually filled out the release to become a contributor just for the purpose of editing the docs, because I know how little time other devs like to spend on them. Maybe I can update this part with a better explanation.
 
Like me, the tutorial's over 20 years old. You'd be doing the world a huge favour by improving it.
I'd be happy to look over PRs.
 
awesome, thanks
 
And you would probably get good comments here from others too - or at least interesting and informative discussions.
 
Yeah, I'd definitely post them here for review
 
Writing good tutorials is yamming hard. Enough information but not too much, no lies-to-children etc.
 
7:28 PM
I know, I've written them before. I often have to stop myself from going into long parenthetical tangents about relatively minor details, just to make sure the reader understands absolutely everything.
Anyways, if anyone has specific pet peeves about the docs, let me know so I can get my feet wet.
3
 
@MattDMo you mean tutorial
 
right, mostly. I'll try to tackle minor things in the main docs, but I'm no expert on most of Python's internals, so I'd probably leave stuff like that to others
 
7:51 PM
@user13598750 the fact that you waited for 2 days is indeed in the rules. Thanks for doing that. However, it'd be better that you posted that code, with correct formatting, offsite (e.g. dpaste) and linked it here. Also, pinging people without particular reason is not pleasant - at least for me, a ping overrides my train of thought and gets top priority... but you weren't talking to Andras about this previously
 
@user13598750 I'd add that since you have a question that's eligible for linking here, you can just say "Hello, could you please take a look at my question? [link]"
The fact that we forbid linking new questions here implies that it's perfectly fine to do that after 2 days. It also means you don't post duplicate information here and there.
The main reason you didn't get many views is that your question was mistagged: always use the main tag. But someone has kindly fixed that for you already after you posted that question to a chatroom that has nothing to do with python.
 
I don't know whether I've come up short on my research here or whether you've truly reached omniscience :P
 
well they sort of told us :P
 
8:07 PM
Don't want to miss a Python question, even if it just has a version tag? Check out my All The Pythons™ firehose link – never a dull moment!
Hopefully someone cares...
I even put the versions in numerical order
 
@MattDMo That's pretty neat. How do I edit this "query"? It doesn't let me type
 
@BožoStojković You have to edit the URL itself. For some reason there's a maximum character limit in the search box
 
Oh lol
How do I exclude a tag within URL? Do I just do +-tag or something along those lines?
@BožoStojković Because it's not working for me
 
@BožoStojković +-tag should work...
 
user13598750
@AndrasDeak Dear Mentor, thanks for Your kind response. Could You please have a look at my question? Please follow the link: stackoverflow.com/questions/64373671/…
 
8:19 PM
@BožoStojković something like https://stackoverflow.com/questions/tagged/tag1+or+tag2+-tag3 will search for or not
 
It doesn't work for me <shrugs>
Maybe it's just too long
Yup, it works for shorter queries
 
@user13598750 There's a lot of suspicious stuff going on with that question, between the upvote and the mod-deleted answer that references someone else.
 
@BožoStojković that's too bad. You could always try removing some of the earlier Python 2 tags like 2.1, 2.2, and 2.3, as practically no one uses them anymore, and substituting in your NOT tags
 
Seems it's still too long. Oh well :D
 
Yeah, oh well :)
Just out of curiosity, what were you trying to exclude?
 
8:30 PM
laurel
 
Rep-hunter alert :P
 
Haha <sweats>
 
I thought I recommended gspread as a tag to go fix to someone else but I either garbled my delivery or I've just imagined it; search is not giving the result I expected. It's a neat library with a number of open questions (last I checked)
I've put my stake in the ground against as my other focuses are just overrun. I can't answer to all the problems, but it's somewhat manageable... for now
 
8:46 PM
> but it's somewhat manageable... for now
Inb4 me starting to learn
(Not sure if I used inb4 correctly there :P )
 
I'm not sure you did, but I'm still going to go with the bank-manager approach of putting my arm around your shoulders and explaining how you've made the right choice whilst walking away from a desk
 
Am still thinking about flask vs django vs something else entirely. I have a lot of unrelated stuff to do so I might not have time to switch between learning different frameworks. But if I use flask, I have you to tease with questions. So that's a plus.
Anyways, I'm off to sleep. I've been working for 26 hours in past 2 days. Got more work to do tomorrow. <not too sad but tired smiley face>
 
9:01 PM
Night :)
 
@roganjosh Thanks. Will need a good one. Have a great <insert part of day> you kind internet user. :P
 
9:31 PM
@roganjosh you must be gspread pretty thin because chat.stackoverflow.com/transcript/6?m=49745266#49745266
 
Like butter over too much toast...
I'm not yamming you, that did not come up from my 'gspread' search. That's exactly the comment I was searching for
 
 
1 hour later…
11:01 PM
@user13598750 you got two answers, yet you are asking here. Try communicating with your answerers first if the answers don't address your question.
And your question is missing a very significant import: SVR comes from nowhere.
 

« first day (3654 days earlier)      last day (1287 days later) »