« first day (4942 days earlier)      last day (23 days later) » 
00:00 - 14:0014:00 - 23:00

2:08 PM
/internet/www would be more logical since the www is a subset, not a superset
 
2:31 PM
@MahNeh These aren't cheat sheets, but they contain very useful info about Python's data model, which has some important differences to the data model you're familiar with in JavaScript / TypeScript.
Oct 17, 2019 at 8:44, by PM 2Ring
@djsmiley2k Have you seen and Facts and myths about Python names and values by Ned Batchelder? Also see Other languages have "variables", Python has "names" for a briefer version of the same stuff, with cute diagrams.
@Aran-Fey If you're doing stuff with light-years, please use the modern definition, which uses the Julian year of 365.25 days (of 86400 SI seconds). Google's Calculator uses an ancient pre-1984 alternative definition based on the tropical year.
Note that SI doesn't define any other time unit apart from the second. And even the second is a derived unit, defined as the inverse of 1 Hertz.
 
It is?
I thought kg s cd A K mol m are the basic units
 
Since the 2019 SI redefinition.
 
I'm too stupid to do the math, but I got 1ly = 9_460_730_472_580_800m from wikipedia
 
Unless I'm hallucinating. ;) Let me check...
 
2:45 PM
What next, redefine the kilogram?! :P
 
puts up an "I believe in cgs" poster
 
From physics.stackexchange.com/q/147433/123208 (this might be messy, due to MathJax)
Oh. It's a mess. I'll try again.
> That is, the second is actually implemented as a frequency standard: we use the resonance frequency of a stream of caesium atoms to calibrate microwave oscillators, and then to measure time we use electronics to count cycles at that frequency.
 
> The second will remain unchanged in its essence, but it is likely that the specific reference transition will get changed from the microwave to the optical domain.
definition changes but it stays basic unit
Phew!
 
@Aran-Fey That value is correct.
 
How the units are defined doesn't really matter to me. I have to define them in such a way that common calculations don't lead to type errors. For example, getting an error from electric_charge: Mul[Duration, ElectricCurrent] = amperes(5) * seconds(2) would be really annoying
 
2:57 PM
@AndrasDeak--СлаваУкраїні Yeah. We have much higher frequency (optical) atomic clocks now, that are several orders of magnitude better than caesium. But those clocks are still cutting-edge technology. I have an answer about that: physics.stackexchange.com/a/770976/123208
@Aran-Fey Understood. The Google Calculator is very impressive in its ability to handle a vast number of units in its calculations. It also has a bunch of built-in constants. So it's annoying that it screws up light-years, when it's otherwise excellent (AFAIK).
You can even do stuff like (mass of proton) * c^2 in electron-volts
 
Google Calculator?
This?
 
Yes, but you can just type a calculation into the Google search bar
 
Right
 
If it doesn't understand that you're doing a calculation, try wrapping it in parentheses.
 
@PM2Ring ^^ this?
hmmm
Got it
@roganjosh This is a relatively simple case of placing an MRE.
Thank you for helping to close the question! This was very useful for me because I will soon ask a question about the subject with MRE, and closing this other question avoids the possibility of my question being considered a duplicate.
@smci Ok, sorry, I forgot about that friendly request, thanks!
 
3:20 PM
@Marco Well, that OP hasn't been seen since 2021, so they're unlikely to add an MRE now. ;)
 
@PM2Ring yeah, probably! :P
@roganjosh This case is definitely not a complicated case, I can assure you.
@roganjosh "However it does seem that they detailed the API usage enough that someone might be able to check it against their own implementations to see whether it reports different values": but it's still not an MRE :(
@roganjosh I don't believe there is any impediment to posting questions about machine learning on SO, but there are certain rules for this, I believe that it basically needs to have MRE and that it includes a code.
 
3:45 PM
@Marco The problem is that the MRE needs to include both a piece of runnable code, and some suitable test data, and expected output. But ML usually needs a large amount of data, and it's not practical to paste that into the question. But it may be possible to include code that can generate some test data. Another option is to link to a repo of standard data, but such links may rot.
 
@PM2Ring Of course, there are cases where it is necessary to use specific data to reproduce, but I believe these are more specific cases.
And this definitely is not the case with the aforementioned question.
 
Yes, it's certainly trickier if specific data is required. But IMHO, such cases aren't very suitable for SO. But if the problem can be reproduced with generic data, then the question is more useful.
A question that relies on specific data is probably too localised. We want questions that are likely to be helpful to future readers with a similar problem. Problems that arise due to some quirk in the data generally don't fall into that category.
 
4:00 PM
Yes
Fair
 
 
3 hours later…
user22676652
6:31 PM
Hello python chat, I need your help.

I am working on a discord bot and I recently realized that the moderation commands I added to it don't work without the bot having administrator, so I changed the oauth link on the website it is on and added a command to announce to every server it is in to kick and reinvite the bot. However, I keep getting this error:

Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/commands/core.py", line 124, in wrapped
 
user22676652
I realized that the bot code stops working because one or more servers the bot is in does not have perms to send a message. How would I ignore those servers and ping the servers that I DO have perms in?
 
try: ... except?
 
user22676652
#announce command
@bot.slash_command(name="announce", description="ping everyone in a server and send a message", guild_id=["1119428346485407744"])
async def announce(ctx, message):
    try:
        for guild in bot.guilds:
            await guild.text_channels[0].send(f"@everyone {message}")
        print(f"Successfully announced: {message}")
    except discord.errors.Forbidden as e:
        print(f"Bot ran into error while running announce command: {e}")
        pass
 
user22676652
trying this code does not work, is there another way to do it?
 
That still interrupts the entire command. You want to skip that particular guild, not all of them
 
user22676652
6:39 PM
How could I do that then?
 
This shouldn't be so difficult. Your code literally only has two lines: 1) For every guild... 2) ...send a message to that guild. Which part of this code do you want to skip in case an error happens?
 
user22676652
I want it to not send the message at all
 
Right. The error happens when you send a message, and when it happens, you want to skip sending the message. So the part of the code that needs to be wrapped in a try...except is...?
 
user22676652
I don't know
 
The first line, the 2nd line, or both of them?
 
user22676652
6:48 PM
I don't know which is why I came to this chat
 
I don't want to hand you the solution on a silver platter because it's been a long time since you started working on this and yet it still feels like you barely have a clue what you're doing. It is high time that you start figuring out basic concepts like error handling. If you don't, you're just wasting your and our time
 
user22676652
Because this isn't my job, I want it to be my job but it isn't the first priority of my life to learn how to code a Discord bot.
 
user22676652
And how a teacher teaches someone is if they make a mistake the teacher tells them what it is and explains how it works.
 
I'm not your teacher.
 
@zoomingspeed why don't you post a question with MRE on the main site?
Even here it is necessary to post a question with MRE, something you didn't do.
Check the room rules: sopython.com/chatroom
 
user22676652
6:55 PM
I am banned from the main site, I have tried to fix my questions but nothing has been happening
 
Then post a question with MRE here.
 
The provided MRE seems fine to me, honestly
 
user22676652
And Aran, you are right, you aren't my teacher, but if I ask you for help for something and you just simply say "Nah, you should know what it is because it's that easy" then why did I come to you in the first place
 
user22676652
I should just know what it is just because it is that easy?
 
@Aran-Fey Hmm, great, I thought it wasn't, sorry.
 
user22676652
7:00 PM
Every conversation with anyone in here that has done that to me instead of learning something I leave the chat annoyed
 
I have tried to make this educational for you and failed miserably. I don't know how I can help you at this point
I could give you the working code, but I don't have the faintest clue how I can teach you something
 
user22676652
Ok then if that stupid method where you repeatedly ask me the questions expecting me to know isn't working then show me the code and explain how it works so I understand it further.
 
Asking questions is stupid, really?
Before I can explain it to you, I first have to figure out what you don't know and why you don't understand it. To do that, I have to ask you questions.
 
user22676652
If I am in a class and a teacher uses that method and the student doesn't know how to answer, does the teacher go "I won't tell you how it works, because you should understand how it works"
 
Again, I'm not your teacher.
I'm not willing to invest that much effort into this for your sake.
 
user22676652
7:06 PM
I never said you were, I am simply making an analogy thats stating what you are doing.
 
user22676652
I asked for help on something, you used that method, I wasn't following along, but because it is super simple to do you aren't going to help me and I should just know what it is?
 
You should be able to figure that out on your own, yes. There are plenty of tutorials about error handling, and your code is literally only 2 lines long. It couldn't possibly be any easier
 
user22676652
All I ask is that you show me what working solution I can use and explain to me how it works so I can understand afterwards if I run into a situation like this again
 
user22676652
If it's that simple for me to learn then it is that simple to teach
 
I don't know what I need to explain. There are tutorials about this topic - and I sincerely hope that you've read at least one them - and apparently you didn't understand that explanation. So why should I waste my time writing another explanation if I don't have a clue why you didn't understand the first one?
 
user22676652
7:11 PM
Ok then I don't understand it because I never learned it
 
user22676652
If it is that simple to understand with two lines of code then it should be that simple to explain it
 
I can either write a comprehensive 5-page tutorial or I can figure out which part you need help understanding. I'm not going to choose the first option, and the 2nd option failed
 
user22676652
I don't want a whole tutorial I just want to know the solution to my 2 lines of code
 
user22676652
And a simple explanation
 
You need a whole tutorial. It's very obvious that you have no clue what you're doing.
 
user22676652
7:15 PM
Look, I don't want to have an argument about this.
 
user22676652
When someone goes on Stack Overflow and asks a question, does someone leave an answer by providing a tutorial link and no actual written response?
 
Sigh. Ok, I'll humor you once. No, they don't. So what?
 
user22676652
Then why are you doing that with me
 
I'm not your teacher, and this isn't a Stack Overflow question. What's your point?
 
user22676652
I want a simple explanation
 
7:19 PM
I'm not giving you one. Because I think you'll need another simple explanation afterwards, and then another one and another one.
 
user22676652
No I won't
 
Yeah, well, I'm not taking that risk, sorry.
 
user22676652
Asking for an answer and a simple explanation to it is a risk?
 
Can we please let this drop here?
@zoomingspeed what Aran-Fey is trying to explain is that there is a degree of self-research involved in programming. I've been less involved with your problems than he has apparently been but it's not up to anyone in the room to give a solution if they don't wish to. You cannot demand that of them. Their reasoning is their own, but this debate is going nowhere
 
user22676652
That isn't what my issue is
 
7:27 PM
 
user22676652
I explained my problem with my code I showed the traceback and I showed my MRE and he did that thing where he asks me questions so I can learn but I told him I don't know multiple times
 
user22676652
Instead of teaching me
 
user22676652
"I won't give the answer on a silver platter because it should be easy to understand especially with two lines of code"
 
@zoomingspeed It's called the Socratic method
 
user22676652
Yes that method
 
7:29 PM
And it's existed for Millenia for a reason
 
user22676652
I don't care how long it has existed for
 
user22676652
I asked a simple question but because I don't know how to answer Aran Frey apparently I have no idea what I'm doing so he isn't going to give an answer and a simple explanation
 
@zoomingspeed Only wrap the await guild.… line in try:...except:, not the entire loop.
 
Fun fact; others do. The reason it works is to get you to question your own understanding and, knowing Aran as I do, I'm sure he would direct you as you went through the process of trying to understand. Right now, you're just expecting an answer
 
user22676652
@MisterMiyagi would this work?
 
user22676652
7:35 PM
oops, let me fix that.

#announce command
@bot.slash_command(name="announce", description="ping everyone in a server and send a message", guild_id=["1119428346485407744"])
async def announce(ctx, message):
    try:
        guild = bot.guilds
        await guild.text_channels[0].send(f"@everyone {message}")
        print(f"Successfully announced: {message}")
    except discord.errors.Forbidden as e:
        print(f"Bot ran into error while running announce command: {e}")
        pass
 
Please acknowledge the fact that MisterMiyagi literally told you the solution, and yet you're trying random stuff that is obviously incorrect
 
user22676652
@MisterMiyagi thank you!
 
00:00 - 14:0014:00 - 23:00

« first day (4942 days earlier)      last day (23 days later) »