#voice-chat-text-1

1 messages · Page 33 of 1

delicate wren
#

thanks to Microsoft's involvement

lime flicker
#

@proper ridge do you know you can close tabs 😂😂😂

delicate wren
#

those are not allowed to be closed

lime flicker
#

wtf :\

delicate wren
#

migration to firefox is still in progress

lime flicker
#

@proper ridge what are you working on ?

delicate wren
#

pickle might work; depends on the type

#

pickle is the way model weights are loaded by many AI libraries

#

only load trusted data, because pickle allows arbitrary code execution

#

at least it's not Yandex Browser

stuck bluff
#

@deep niche @stray imp 👋

deep niche
#

howdy?

stray imp
#

Hello @stuck bluff , how are you doing?

stuck bluff
#

@shrewd tide 👋

delicate wren
stuck bluff
#

@sudden fern 👋

delicate wren
#

just another chrome

lime flicker
delicate wren
#

hmm

#

reminds of mongo requiring AVX to start

#

"someone somewhere forgot if exists"

#

wouldn't be surprised if they use AVX for BSON/JSON parsing thus leading to relatively poor performance on pre-AVX CPUs~~ (which would look bad on benchmarks)~~

stuck bluff
#

@small zenith 👋

#

@agile elbow 👋

agile elbow
#

man i hate the voice verification

#

@proper ridge what are you programming?

delicate wren
#

Self means exactly the same type

#

for [[1]], __getitem__ does not return Self

#

what you seem to have meant there was returning a type that implements the same protocol

#

hmm

#

or not, that one might be correct

#

ig Collection itself is fine

#

(I might've confused it with what recursive one does)

#

seems correct

stuck bluff
#

@wise hazel 👋

delicate wren
#

these two behave differently for list and ndarray

#

it can't check generics, yes

wise hazel
delicate wren
#

otherwise it'd be very complex

#

you can only reasonably check that statically (using mypy and others)

delicate wren
#

because it repeats the list

#

!e

print([1] * 2)
print([1] + [1])
print([1] * [1])
coarse hearthBOT
delicate wren
#

!e

print([1] @ [1])
coarse hearthBOT
# delicate wren !e ```py print([1] @ [1]) ```

:x: Your 3.12 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     print([1] @ [1])
004 |           ~~~~^~~~~
005 | TypeError: unsupported operand type(s) for @: 'list' and 'list'
delicate wren
#

!d operator.matmul

coarse hearthBOT
#

operator.matmul(a, b)``````py

operator.__matmul__(a, b)```
Return `a @ b`.

Added in version 3.5.
delicate wren
#

added because of numpy

#

it's part of Python

#

@ binary operator

#

it's not used anywhere in Python itself afaik

#

the only type you can reasonably use there is probably tf.Tensor

#

@thin lintel some amounts of background noise

thin lintel
#

Sorry, I'm in train

delicate wren
delicate wren
rotund bough
#

python supports operator overloading so just implement the functionality

proper ridge
bleak flare
#

Hi

delicate wren
#

I'm back
(was outside signing papers)

#

for __method__s

#

somewhere in the nested sections it lists operator overloading

turbid gull
#

Hi, everybody!

#

Have a good day, everyone!

delicate wren
#

and rather just what type.__call__ does

turbid gull
#

I can't talk on voice chat because I didn't pass verification

#

I try to do it

delicate wren
#

two more messages approximately

turbid gull
#

ohhh

proper ridge
#

!e

help(list)
delicate wren
#

yeah, probably should base functionality on usecase

coarse hearthBOT
# proper ridge !e ```py help(list) ```

:white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | Help on class list in module builtins:
002 | 
003 | class list(object)
004 |  |  list(iterable=(), /)
005 |  |
006 |  |  Built-in mutable sequence.
007 |  |
008 |  |  If no argument is given, the constructor creates a new empty list.
009 |  |  The argument must be an iterable if specified.
010 |  |
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/6CL6YLGO3FGQFLGBHTCR2OFL4I

turbid gull
#

help(list)

delicate wren
#

and, yes, help does work there

turbid gull
#

!e

coarse hearthBOT
#
Missing required argument

code

delicate wren
#

but it's not interactive

#

(not scrollable)

#

!d list

coarse hearthBOT
#

class list([iterable])```
Lists may be constructed in several ways:

• Using a pair of square brackets to denote the empty list: `[]`

• Using square brackets, separating items with commas: `[a]`, `[a, b, c]`

• Using a list comprehension: `[x for x in iterable]`

• Using the type constructor: `list()` or `list(iterable)`...
turbid gull
#

!e print('Hello World')

coarse hearthBOT
delicate wren
#

there is often a set of operators expected from a certain concept (e.g. a number)

turbid gull
#

!e help(list)

coarse hearthBOT
# turbid gull !e help(list)

:white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | Help on class list in module builtins:
002 | 
003 | class list(object)
004 |  |  list(iterable=(), /)
005 |  |
006 |  |  Built-in mutable sequence.
007 |  |
008 |  |  If no argument is given, the constructor creates a new empty list.
009 |  |  The argument must be an iterable if specified.
010 |  |
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/MS2ZCRFEWXN4Z4G6T4YBBECIHI

delicate wren
#

in Rust, there is a common pattern of having a IntoSomething interface (IntoIterator, IntoFuture) to allow for conversion into something compatible on "user-facing" methods/functions

#
class IntoCollection(Protocol[T]):
    def into_collection(self) -> Collection[T]: ...
#

^ not entirely valid in case of Python

#

ndarray has a fixed-ish set of what can convert to it

#

so maybe just re-export that

#

@proper ridge usually grouped by what they do

#

__gt__/__lt__/__le__/__ge__ should be together, for example

#

!e

print({1, 2, 3} - {2})
coarse hearthBOT
delicate wren
#

!e

print({1, 2, 3} ^ {1, 2, 4})
coarse hearthBOT
delicate wren
#

!e

print({1, 2, 3} & {1, 2, 4})
coarse hearthBOT
delicate wren
delicate wren
#

@proper ridge CustomClass() != object() should be supported

#

cross-type equality checks are normal for Python

#

check the type, then compare the result if types are the same

#

otherwise return NotImplemented

proper ridge
#

Brb

delicate wren
#

raise TypeError equivalent for equality check is return NotImplemented

#

and generally for operators that is the case

#

!e

print([].__mul__([]))
coarse hearthBOT
# delicate wren !e ```py print([].__mul__([])) ```

:x: Your 3.12 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     print([].__mul__([]))
004 |           ^^^^^^^^^^^^^^
005 | TypeError: 'list' object cannot be interpreted as an integer
delicate wren
#

hmm

#

(not in that case though)

#

I'm trying to remember when it does that

#

!e

import numpy as np
a = np.array([[1, 2, 3]])
b = np.array([[1], [2], [4]])
print(np.matmul(a, b))
print(np.matmul(b, a))
coarse hearthBOT
delicate wren
#

!e

import numpy as np
a = np.array([[1, 2, 3]])
b = np.array([[1], [2], [4]])
print(np.dot(a, b))
print(np.dot(b, a))
coarse hearthBOT
delicate wren
#

wait is dot just an alias

#

ig same for 1d/2d

delicate wren
delicate wren
#

that border is giant though

#

@thin lintel Baltic states are having the same issue because Kaliningrad

thin lintel
#

oh yeah

#

Estonia is building a wall

delicate wren
thin lintel
raw wren
#

cancoon

delicate wren
#

"just bring your own veterinarian"

stuck bluff
#

"If you can't make your own, store bought is fine."

#

@gusty ether 👋

#

@torn goblet 👋

torn goblet
#

I have a ollama GPU instance if anybody need.

gusty ether
#

I can't type on voice chat and unmute my mic, it says no permission

stuck bluff
#

@dim basin 👋

torn goblet
#

The voice verification systyem is pretty bad.

hearty heath
#

Hey 👋

dim basin
# stuck bluff <@967199680108822658> 👋

i may have asked this question before but do you know anything do to with custom tkinter? i'm trying to create a gui for a program i've made in python and need some help setting up a combo box

torn goblet
#

combo box?

stuck bluff
torn goblet
#

Html?

stuck bluff
#

Also, I'm liable to be asleep shortly.

proper ridge
#

When you define __eq__, do you need to define __ne__ as well?

#

Seems quite redundant.

delicate wren
#

!e

class C:
    def __eq__(self, other): return True

print(C() != C())
coarse hearthBOT
delicate wren
#

!e

class C:
    def __eq__(self, other): return False

print(C() != C())
coarse hearthBOT
hearty heath
delicate wren
#

!e

class C:
    def __eq__(self, other): return NotImplemented

print(C() != C())
coarse hearthBOT
delicate wren
#

hmm

#

the result is surprisingly adequate

#

NotImplemented

#

(I did expect that but was not sure)

proper ridge
#

I guess it's not == unless explicitly defined otherwise?

#

Feels verryyy weird to me right now.

delicate wren
#

not == and NotImplemeted is kept as is

#

!d functools.total_ordering

coarse hearthBOT
#

@functools.total_ordering```
Given a class defining one or more rich comparison ordering methods, this class decorator supplies the rest. This simplifies the effort involved in specifying all of the possible rich comparison operations:

The class must define one of `__lt__()`, `__le__()`, `__gt__()`, or `__ge__()`. In addition, the class should supply an `__eq__()` method.

For example:
proper ridge
#

Then why is __ne__ even included?

delicate wren
#

^ if you want to fill comparison methods

delicate wren
proper ridge
#

One moment...

delicate wren
#

!e

import numpy as np
not np.ones(5)
coarse hearthBOT
# delicate wren !e ```py import numpy as np not np.ones(5) ```

:x: Your 3.12 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 2, in <module>
003 |     not np.ones(5)
004 | ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
proper ridge
delicate wren
#

!e

import numpy as np
print(np.ones(5) == np.ones(5))
print(np.ones(5) != np.ones(5))
coarse hearthBOT
delicate wren
#

result of == is unnotable, so != needs be derived

stuck bluff
#

@plain moss 👋

delicate wren
#

iirc Rust allows custom != too

#

but clippy considers it a warning

#

(maybe rustc too)

#

Rust itself seems to override it only for slices and arrays

proper ridge
#

I'm still searching in numpy's src, few more moments...

delicate wren
#

numpy can't override not so it has to prevent it

hearty heath
#

!eval Example of where __eq__ and __ne__ might return something other than booleans. ```py
from dataclasses import dataclass

class Expr:
def eq(self, other):
return Eq(self, other)

def __ne__(self, other):
    return Ne(self, other)

def __add__(self, other):
    return Add(self, other)

def eval(self):
    raise NotImplementedError()

@dataclass(eq=False)
class Binop(Expr):
lhs: Expr
rhs: Expr

class Eq(Binop):
def eval(self):
return self.lhs.eval() == self.rhs.eval()

class Ne(Binop):
def eval(self):
return self.lhs.eval() != self.rhs.eval()

class Add(Binop):
def eval(self):
return self.lhs.eval() + self.rhs.eval()

@dataclass(eq=False)
class Num(Expr):
value: float

def eval(self):
    return self.value

x = Num(2)
y = Num(3)
expr = x + y == y + x
print(expr)
print(expr.eval())

coarse hearthBOT
proper ridge
#

It has __ne__ (through its parent class _ArrayOrScalarCommon).

delicate wren
#

5.5 years dead

proper ridge
#

This is useful for when I implement my QNum primitive, but I still don't quite understand how it would work for like when you have a class and try to just define it for that class.

delicate wren
#

> it will literally solve all issues
no humans => no issues

proper ridge
delicate wren
#

there are reasons why you need separated thinking, and more than one perspective

proper ridge
#

Exactly.

delicate wren
elder wraith
#

It's just techbro optimism that is insane to me

proper ridge
delicate wren
#

it's not even optimism, it's plain delusion

proper ridge
elder wraith
#

normal people call it delusion, techbros call it the future

proper ridge
#

They literally talk about anything besides SE, let alone python. I honestly have made a game out of it hehe.

elder wraith
#

SE/Python is pretty boring

proper ridge
elder wraith
#

It's like talking about Math, it's a solved problem

proper ridge
#

No Rabbit, not to that degree.

elder wraith
#

sure but talking about solved problems is generally boring

proper ridge
#

And since when is math considered objectively solved?

elder wraith
proper ridge
#

I literally have 5 questions from the top of my head that I haven't seen a single publication or reference that solves it.

delicate wren
#

unsolved problems are too niche
and communicating solved problems is more important (and, yes, boring)

proper ridge
elder wraith
#

Do you want honesty?

proper ridge
#

Yes.

elder wraith
#

Yes, most programming problems people bring in voice is newbie solved issues. Most people here are writing CRUD apps. Here is FastAPI, learn classes and a database. Enjoy

proper ridge
#

Besides the newbies learning how to code?

delicate wren
proper ridge
#

Ask the ones who are actually working in the industry. Do you think Anokhi's work for instance is trivial?

elder wraith
#

Anokhi work is not trivial

delicate wren
#

if your company is solving an unsolved problem, good idea could be to shut up and monetise it

proper ridge
elder wraith
#

but Anokhi can't really talk about his work either because it's work

proper ridge
elder wraith
#

we have some interesting fraud problems at work, I can't talk about it period.

delicate wren
elder wraith
#

When people bring programming calculus level problems into VC, sometimes people do help out, it's pretty darn rare it happens.

proper ridge
#

3x + 1, that's a simple 1st degree variable equation. That's what we learned back in elementary school as calculus.

elder wraith
#

most of time it's "My Python install is borked"

delicate wren
#

3x + 1 is number theory not calculus

elder wraith
#

And sure, your quantum computing stuff is interesting to some, I just find it boring because I tend want to mess with practical stuff and Quantum computers are not out of the lab

proper ridge
#

It's useless at the moment. That's why it's an unsolved problem.

elder wraith
#

Sure but others may not find it interesting if they are trying to get venv running

proper ridge
#

They leave as fast as they come.

proper ridge
delicate wren
#

integers -- number theory
floats -- calculus

proper ridge
#

Floats are real numbers. We had them under number theory.

delicate wren
proper ridge
#

I honestly never got that impression during my school days. Even when I was competing at olympiad level, we always referred to the type of numbers as number theory, and variables and functions as calculus.

proper ridge
#

I remember this from like 2nd or 3rd grade.

delicate wren
#

natural numbers, not whole numbers, because "whole numbers" is ambiguous

#

"natural numbers" is ambiguous too, but not as much

proper ridge
#

I even remember when I came to KL, I had this friend who was in 8th grade or so and was like I don't get x, what the fuck is x, and she had just been exposed to variables in calculus.

delicate wren
#

calculus is where many people start learning what functions are, yes

dim basin
#

anyone here ever used Ctk?

delicate wren
#

instead of set theory where it really comes from

proper ridge
#

So, we had number theory in elementary to introduce arithmetics and different number classes, and then it would branch out into calculus, linear algebra, probability and statistics, discrete mathematics, and geometry (I don't think I missed any? I'm just looking at the books I had from back in the day).

#

Calculus had the variables and functions, basically the base framework. LA was mostly vectors, matrices, and their properties (though we did have systems of linear equations where you would have variables). Probability and statistics felt like applied calculus because you would analyze functions to generate some insight. Discrete mathematics was a bit weird, it was mostly combinatorics like the pigeon hole problem, and geometry was geometry.

#

That's how it was for us. When I came to KL we were still in the same system, but I did get a chance to check out the IGCSE A and O level stuff, and it seemed almost identical, but this is from more than 4 years ago, and in a different language, so maybe I misspeak.

#

I'm googling it, if feels like I'm remembering correctly, but please do correct me if I'm wrong.

#

I'll get the books out, one sec...

delicate wren
#

all I'm able to find related to number theory specifies it's about integers within the first couple of sentences

dim basin
delicate wren
#

and calculus is described as differentiation and integration

#

... which doesn't work on integers

delicate wren
thin lintel
proper ridge
delicate wren
#

pygame+pybox2d

tame leaf
delicate wren
#

box2d has a JS version of it

#

(that is what codebullet uses)

proper ridge
#

Again, this was my experience with my system and IGCSE if I recall correctly. I didn't check the US version with AP courses (could never get access to those back in the day).

delicate wren
#

I only remember the maths education for 8~11th grade, since that was basically re-learn of everything

proper ridge
#

So, for special schools, you would apply most during 8-11th.

#

We had 12th being the last year so kids would just prepare for konkoor.

#

I got a wave of nostalgia reading those books, thanks AF.

#

Really really loved those books. They're honestly also more advanced than most stuff I read these days (comparing to OCW stuff especially).

tame leaf
proper ridge
#

We had these three branches.

#

I was math-phy, so we had all the math and phy books (with additional chapters teehee). Biology kids had a lighter math and phy but instead had biology book. Humanities course was basically for drop outs.

#

Perfume is for ladies if I'm not mistaken.

#

Men wear cologne.

#

Sharper smell usually.

#

Dead people usually don't smell pleasent, yes.

#

Sounds like sth Tina Belcher would write.

delicate wren
delicate wren
#

people get into that school from other schools

proper ridge
#

Gotcha.

delicate wren
#

it's only recently that some level of branching was intoduced for math students

proper ridge
#

I loved math, but some other kids had their parents choose for them.

proper ridge
delicate wren
#

mostly

#

those two were separate subjects

#

(from the rest of the mathematics)

proper ridge
#

Were they separate books?

#

Or all the chapters in a single book for each year?

delicate wren
#

one book for geometry
one book for algebra
zero books for everything else

proper ridge
#

Gotcha.

delicate wren
#

books we only used for exercises

proper ridge
delicate wren
#

no, just big lists of exercises

proper ridge
#

Yeah, we had those too. You would read from one book, and do tutorials in another.

#

Oh I see.

delicate wren
proper ridge
#

My favorite books that I read throughout the year (advanced level of the curriculum, helped me stay sharp) were lecture + tutorial + MCQ and repeat.

#

Like each chapter had around 300 or so MCQs.

#

God I wish it was digital, I would have so grinded it for achievements.

#

Achievement Unlocked "BookWorm"

delicate wren
#

we normally didn't have multiple-choice questions

proper ridge
#

Ohh we had TONS of MCQs.

#

Mainly because of Konkoor.

delicate wren
#

I only remember the ones on the final state exam

proper ridge
#

It's basically the final boss like in MK: Armageddon.

delicate wren
#

for algebra and geometry questions were almost always one of three sorts:
prove this
is this correct (prove)
calculate that (and show how)

proper ridge
#

So, in our system you have three categories of exams:

  1. Standard exams (these were the ones you do for your degree, part of the standard curriculum. They were long answer questions, short answer questions, and MCQs)
  2. Competition exams (Almost entirely MCQs, very time intensive. I did have some of these be in multiple stages, and you would for instance have like 100 MCQs in 90 minutes, and then have the second stage be the long answer questions. MCQs would teach kids about time management and being efficient)
  3. Final exam (Konkoor, which is basically the ultimate exam consisting of everything from your entire education. Also completely MCQ)
proper ridge
#

Calculate that was in both MCQ and long answer format.

delicate wren
#

just for weekly tests

proper ridge
#

You would then have them in the final exam at the end of the academic year.

#

For standard we had weekly tests, and then two final exams (one in the middle of the year, the other at the end).

delicate wren
#

there is one dumb statistics problem in the final maths exam in Russia which always takes a whole page to prove (and it's in almost all variants we had)

proper ridge
#

Although weekly tests depended on the lecturer too.

proper ridge
#

Same. We had those too. God you'd feel insane if you would lose marks for a simple calculation mistake.

#

Like put 12 instead of 16.

delicate wren
#

I was confident enough to leave after only half the assigned time had passed (2 hours out of 3h55m)

proper ridge
#

I got low marks once in my life because I used to do alot of the calculations in my head (now my answers were correct, but my lecturer minused marks to teach me a lesson. I did make lots of small careless calculation mistakes here and there too.)

I would solve a three hour exam in 10 minutes, but I would sit until the very end reviewing the exam over and over and over and over.

proper ridge
#

If I was confident, I would start adding extra stuff to my questions out of boredom.

delicate wren
#

I had way worse things to worry about at that time lol

#

I checked the whole thing once

#

and just to avoid extra stress left it as is

#

which resulted in an imperfect 100/100

proper ridge
#

I mean, me too (family stuff mostly, home was hell) and I was very fat back then so studying was my favorite thing, and grades were my way of proving to myself I understood it properly.

delicate wren
#

and, yes, 100/100 can be imperfect because of conversion mechanism

delicate wren
proper ridge
delicate wren
#

primary score gets converted non-linearly

proper ridge
#

Gotcha.

#

Did it eat away at you?

delicate wren
#

someone, who I tried helping, getting <70 was more worrying

proper ridge
#

I was super sensitive about grades, like our scales were on 20/20 scale. Once I got 19.75/20 (meaning a single, small mistake costing 0.25). I felt such shame that I wanted to just die. Don't know why I cared so much.

delicate wren
#

!e

print(f'{19.75/20:%}')
coarse hearthBOT
proper ridge
#

It did push me to work harder though, until my love for the curriculum became big enough to outweigh my stress and I worked as hard if not harder but with less stress.

proper ridge
proper ridge
#

Like why? You got your grade, why would you care? It took a while to understand grades are just grades, stuff you need to graduate.

delicate wren
#

@proper ridge first two are just 3 without 1x

#

yes, audible (just came back)

#

@proper ridge [[1, 2, 3]] instead of [1, 2, 3]

#

[1,2,3] is ambiguous

#

for me seeing it as [[1],[2],[3]] feels more natural

#

!e

import numpy as np
a = np.array([[1,3,5]])
print(a @ a)
coarse hearthBOT
delicate wren
#

!e

import numpy as np
a = np.array([[1,3,5]])
print(np.dot(a, a))
coarse hearthBOT
delicate wren
#

it's too smart

#

@proper ridge maybe also first check that there's exactly 2 dimensions on both

#

otherwise ambiguous

#

many matrices is the example

#

that's where you'll need 3

#

and only three, since you can always reshape everything else to one one dimension

#

many operators

#

no

#

not sequential

#

parallel

leaden moth
#

I don't know why I'm here and my English is weak (: But can you evaluate this project that I did (I'm new to Python))

#

import turtle

def draw_sun():
turtle.color("yellow")
turtle.begin_fill()
for _ in range(36):
turtle.forward(100)
turtle.right(170)
turtle.end_fill()

def draw_moon():
turtle.color("black")
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()

def main():
choice = input("Enter 'day' or 'night': ")

turtle.speed(6)  
if choice == "day":
    draw_sun()
elif choice == "night":
    draw_moon()
else:
    print("error")

turtle.done()

if name == "main":
main()

delicate wren
#

C_i = A_i * B_i

coarse hearthBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

delicate wren
peak needle
#

i speak arabic so i can translate if you want

proper ridge
#
print("Hello Ali!")
peak needle
delicate wren
leaden moth
#

بس بعتت اول مشروع الي بالبايثون بمكتبة السلحفاة قلت خليهم يقيموه -- اعطيني تقييمك لو عاوز تشوفه

delicate wren
#

yes

peak needle
#

Alisa

#

he wantes you to rate his project

#

afk

delicate wren
#

code seems clean enough

#

one thing I'd generally suggest when taking string input that you test for exact match would be to remove trailing/leading whitespace

#

!e

s = " day "
print(s == "day")
coarse hearthBOT
delicate wren
#

!e

s = " day ".strip()
print(s == "day")
coarse hearthBOT
delicate wren
#

@proper ridge this would more often come up with many vectors rather than many operators

#

shape (1, VECTOR_SIZE, VECTOR_COUNT) when plugging into matmul

#

(optionally reordered)

#

operators depend on physical arrangement of stuff, right?
so many operators might come up when we're evaluating and comparing different arrangements or whatever

#

like many different quantum computers

#

rather than many different inputs

#

no

delicate wren
#

yes, three dimensional

#

not more

#

(VECTOR_SIZE, VECTOR_SIZE, OPERATOR_COUNT)

#

when we multiply
(VECTOR_SIZE, VECTOR_COUNT)
by
(VECTOR_SIZE, VECTOR_SIZE, OPERATOR_COUNT)
there will be
(VECTOR_SIZE, VECTOR_COUNT, OPERATOR_COUNT) (another place where 3 dims appear)
as output

#

vectors input
operators
vectors output

#

10 operators
25 vectors
250 results

ornate cobalt
delicate wren
#

it just didn't embed because the site is always broken in one way or another

delicate wren
#

@ornate cobalt @proper ridge three skews makes a rotation

#

I will not teach how because I don't know how

serene quail
#

.

#

Any1 know how to instal Python on pc system

delicate wren
serene quail
#

Like I got installed But activate

#

Windows

delicate wren
serene quail
#

11

delicate wren
#

did you check "add to path" during installation?

serene quail
#

Python installer

#

Idk path

delicate wren
#

how are you trying to run it?

serene quail
#

It say Its not Turned on

fast path
#

any chance I can get granted permission to speak on the voice chat?

serene quail
#

In path

delicate wren
fast path
#

I need to speak to @ornate cobalt

delicate wren
#

!voice

coarse hearthBOT
#
Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

serene quail
#

How do I do that path

twin bobcat
#

what's up

delicate wren
#

re-run the installer
check "add to path"
click customize installation
next
install

#

Vue?

twin bobcat
#

view

serene quail
#

How much more I need to talk so I Can talk in Ff

delicate wren
#

I don't remember any problems specific to Vue

serene quail
#

Vc

twin bobcat
#

50 undeleted messages

ornate cobalt
#

It should tell you

twin bobcat
#

and 3 days in the server

#

pretty much it

delicate wren
#

!user in #bot-commands to see how many messages bot sees you've sent

serene quail
#

Month already

#

3 more

twin bobcat
#

womp womp

serene quail
#

1

#

Finaly

twin bobcat
#

ngl

#

Sometimes I feel like an imposter

ornate cobalt
delicate wren
#

ways to call Python from PHP that I'd expect to be possible:
subprocess
network
direct function call -- difficult

#

second one is preferred generally

#

why:
starting Python interpreter frequently is inefficient

#

Python startup times are terrible

#

that's why using some sort of API to connect them is suggested

#

normal Vue on its own has no way of communicating to Python because it's a front-end framework

#

in modern Vue installation, you're often be dealing with Nuxt or something similar that allows back-end functionality too

rotund bough
#

fetch

delicate wren
#

for fetch to work you need proxying to back-end

#

at some point in the stack

#

(as in static Vue won't be enough)

fast path
twin bobcat
delicate wren
#

in LiveShare's model, there's only one copy of the file

#

your local version of the project, if existent, does not synchronise to remote when you connect to remote

#

(local version as in a file not what you see in the UI)

#

for synchronising process on a project across computers, you can use a VCS (for example, Git)

upper garnet
#

hi, i am new

delicate wren
upper garnet
#

i can't make the import functionality work

#

with my own files

#

i am not american i am french

delicate wren
#

there's quite many non-Americans in the VC

#

(so that assumption was a bit off)

#

@ornate cobalt you can use std::sync::mpsc::Sender for reports if you want to have it shared at a performance cost

#

@serene quail it stands for distributed denial of service

denial of service: something doesn't work (usually because of high load)
distributed: many sources of attack

upper garnet
#

can any of you help 😭

delicate wren
proper ridge
delicate wren
#

you're importing your own modules, right?

upper garnet
#

different files in the same folder

upper garnet
delicate wren
#

so

/folder
  module_1.py
  module_2.py

and module_2.py has

import module_1
#

something like this, right?

upper garnet
#

exactly

delicate wren
#

imports don't work as in there's an error?

#

what's the error if any?

upper garnet
#

import "something" could not be resolved

delicate wren
#

is the file named exactly something.py?

upper garnet
#

yes altho

delicate wren
#

how are you running the script?

upper garnet
#

i am working with .ipynb

#

why ? because my friedn who was supposed to introduce me to dev told me to

delicate wren
#

you're trying to import .ipynb from another .ipynb?

upper garnet
#

early on

#

yes

delicate wren
#

that won't work, afaik

#

you need a regular .py

upper garnet
#

so i'll just have to copy pasta everything

delicate wren
#

@proud coral typing speed is generally not the bottleneck
its effects, though not zero, are negligible

#

most time is spent reading

#

> ChatGPT
> concise
not at all, in my experience

#

you need to ask it to be

#

@wraith portal with enough experience you'll often end up in situations when you don't need to google for hours

#

navigating docs will take over

buoyant dagger
delicate wren
#

not sure, but that's very likely

#

!source user

coarse hearthBOT
#
Command: user

Returns info about a user.

Source Code
delicate wren
#

nowadays I use StackOverflow way more rarely than years earlier

buoyant dagger
delicate wren
#

as for AI assistance -- I don't do that at all, not worth it

proper ridge
#

AF, what do you think?

pseudocode:
Define type of a and b:
    if both are bras or both are kets:
        raise ValueError("Cannot multiply two kets or bras together.")

    elif one is a bra and the other is a ket:
        if the dimensions don't match:
            raise ValueError(f"The dimensions don't match. {a.shape} and {b.shape}")
        return a @ b

    elif a is an operator:
        if b is a bra:
            raise ValueError("Cannot multiply A<psi|. The dimensions don't match.")
        elif b is a ket:
            if dimensions don't match:
                raise ValueError(f"The dimensions don't match. {a.shape} and {b.shape}")
            return np.dot(a, b)
        elif b is an operator:
            if dimensions don't match:
                raise ValueError(f"The dimensions don't match. {a.shape} and {b.shape}")
            return a @ b

    elif b is an operator:
        if a is a ket:
            raise ValueError("Cannot multiply |psi>A. The dimensions don't match.")
        elif a is a bra:
            if dimensions don't match:
                raise ValueError(f"The dimensions don't match. {a.shape} and {b.shape}")
            return np.dot(a, b)

    else:
        raise ValueError("Unknown error has occurred.")
delicate wren
#

you can see that in source

delicate wren
dawn pond
proper ridge
#

Kets are column vectors.

delicate wren
proper ridge
#

It's the braket notation introduced by Dirac to simplify the shape.

delicate wren
#

@serene quail what do you mean by minecraft script?

proper ridge
#

Makes your life a lot easier.

dawn pond
proper ridge
proper ridge
dawn pond
delicate wren
proper ridge
delicate wren
#

!d tkinter.ttk

coarse hearthBOT
#

Source code: Lib/tkinter/ttk.py

The tkinter.ttk module provides access to the Tk themed widget set, introduced in Tk 8.5. It provides additional benefits including anti-aliased font rendering under X11 and window transparency (requiring a composition window manager on X11).

The basic idea for tkinter.ttk is to separate, to the extent possible, the code implementing a widget’s behavior from the code implementing its appearance.

proper ridge
#

Dirac probably just bended it into -.

delicate wren
#

tkinter is somewhat limited in its functionality

proper ridge
#

Gotta love Dirac. Made such an awesome representation for vectors and matrices in quantum mechanics, and even went ahead and fixed Feynman's problem with path integrals. Absolute legend.

delicate wren
#

no the topic of minecraft,
in new versions of OpenComputers, the default OS comes with micropython pre-installed

#

since the computers there are now just RISC-V emulators rather than Lua runtimes

#

@obtuse valve why are you dealing with pointers in Rust?

#

or did you mean references?

obtuse valve
#

*&

obtuse valve
delicate wren
#

in most cases:
*&x is x
&*x is x

obtuse valve
#

* dereference

#

& borrow??

#

*

delicate wren
#

normally you only need * to extract a value out of Box or to extract a Copy value out of &T

obtuse valve
#

but * still manages to turn &x into x

delicate wren
#
let x: i32  = 2;
let y: &i32 = &x;
let z: i32  = *y;
#

for T: Copy, * on &T will give you T

#

it's basically just a way to clone the value

obtuse valve
#

can i?

#

or will rust bitch

#

let's check using playground

delicate wren
#
let mut x: i32  = 2;
let y: &mut i32 = &mut x;
let z: i32  = *y;
#

y points to x
z has the same value as x but is at a different place

#

modifying y will modify x but won't modify z

rotund bough
#

makes sense

#

z is not a ref

delicate wren
#
*y = 3;
#
fn main() {
    let mut x: i32  = 2;
    let y: &mut i32 = &mut x;
    let z: i32  = *y;
    *y = 3;
    println!("{x} {z}");
}
3 2
obtuse valve
#

this sucks man

rotund bough
#

z got assigned by copy and then said too late..

delicate wren
#

however
if you instantly take the *y by ref again, it's not moved

fn main() {
    let mut x: i32  = 2;
    let y: &mut i32 = &mut x;
    *&mut*y = 4;
    println!("{x}");
}
4
obtuse valve
#

so when you do *y, you are effectively assigning new memory in order to dump y's value and assigning to z so when y gets changed, z no longer is updated because it has its own "version" of y, which is "outdated"?

delicate wren
#

yes

obtuse valve
#

OMG

#

HMM

delicate wren
#

z is new memory disjoint from x and y

rotund bough
#

if you change y before assignment then z will have new value

obtuse valve
#

& allows for other variables to access the memory location of the referenced variable (and effectively allows the value of the referenced variable to be accessed)
whereas * just fucking unpacks the value of the accessed variable and dumps it into new memory?

#

ik * is also used for unpacking right?

#

is it still true in py?

rotund bough
#

i read * as "value at"

delicate wren
#

in Rust you need ..

#

iirc

obtuse valve
#
struct foo {
}

becomes

{"foo":}
#

after serde

rotund bough
#

python has enums?

delicate wren
#

!d enum

coarse hearthBOT
obtuse valve
#

yeah sure

delicate wren
#

though I think it's not what PyO3 maps it to

obtuse valve
#

yeah im rambling a bit

#

ok so

#

what happened i was at a cs taster yesterday

#

and then the teacher asked us to devise a solution to a contrived problem

#

and it involved data handling

#

and then i just assumed that i was using a decently equiped library eg numpy

#

and i just wrote code that used method calls

#

but bitch actually wanted me to impl those logic instead of using methods

#

smfh

#

and said "stick to something simple"

#

bitch

delicate wren
#

first performance done
lyrics done

#

album when

obtuse valve
#

lol

#

i have the autotune ready

rotund bough
obtuse valve
#

yuh

#

yuh

rotund bough
delicate wren
rotund bough
proper ridge
#

!paste

#
a = np.array([1, 2, 3])
b = np.array([[1],
              [2],
              [3]])
c = np.eye(3)
d = np.array([[0, 0, 1],
              [0, 1, 0],
              [1, 0, 0]])
e = np.array([[1, 2, 3],
              [4, 5, 6],
              [7, 8, 9]])
delicate wren
#

!e

import numpy as np
print(np.array(123).ndim)
coarse hearthBOT
obtuse valve
#

guess whos back

#

dinner was great

elder wraith
#

Shady

obtuse valve
#

and then i'll ask chadgpt to do somethin

#

i will RAP

delicate wren
obtuse valve
#

that was literally her only argument

#

lol

delicate wren
#

!d statistics

coarse hearthBOT
#

Added in version 3.4.

Source code: Lib/statistics.py

This module provides functions for calculating mathematical statistics of numeric (Real-valued) data.

The module is not intended to be a competitor to third-party libraries such as NumPy, SciPy, or proprietary full-featured statistics packages aimed at professional statisticians such as Minitab, SAS and Matlab. It is aimed at the level of graphing and scientific calculators.

obtuse valve
#

okok so for the summer task she told us to make a python programme/website/a writeup on some cringey topics eg ai

#

what should i do

#

the actual first impressions

delicate wren
#

what topics other than AI are there

obtuse valve
#

holdup lemme pull up the docs

#

istg half the class is gonna do some "AI" eg imagenet with pytorch, llms with pytorch etc and using some chatgpt4 api and calling a "python programme"

#

HOLDUP

obtuse valve
#

THEY DONT EVEN FUCKING UNDERSTAND THE TECH AND JUMPING THE TECH BANDWAGON

delicate wren
#

wrapping API -- that's what most AI companies do anyway

obtuse valve
#

they can git clone

#

I FUCKING HATE THEM

delicate wren
#

but can they git clone --recurse-submodules

obtuse valve
#

but they're not 🤦‍♂️

obtuse valve
delicate wren
#

use AI to show how mediocre AI is

obtuse valve
#

yeah imma use chatgpt to write AI slander

delicate wren
#

2. is quite useful

obtuse valve
#

MAKE A FUCKING RAYTRACER IS PYTHON 🤓

#

i was seriously considering 2.

#

but i need hw

delicate wren
#

@proper ridge I'll DM the link to the latest one if you have enough bandwidth to download 128.5MB video

obtuse valve
#

my dad offered me a raspberry pi but idk what impressive task i can do

delicate wren
obtuse valve
#

eg

robot.forward(10)
robot.left_turn(90)
robot.detonate_nuke()
delicate wren
#

you can try and fix their installation script

obtuse valve
#

stupid

obtuse valve
#

rust simulator????

sterile orchid
#

raytracing in python is just minecraft shaders

#

ez stuff

obtuse valve
#

imma make cargo lmao

#

(impossible)

sterile orchid
#

oh coffee time

obtuse valve
#

scratch programming lmao

#

unless i make a PID

#

partial integral deririvative

#

autopilot obstacle avoidance system

#

then that will be full tryhard

delicate wren
obtuse valve
#

or edge inference/compute using ||jetson nano and more "edge asic xPUs"||

#

for ai i am writing an autograd lib

#

like currently but the code is broken

obtuse valve
#

||disclaimer: only 1/2 examples works||

teal warren
#

this is not appropriate for our server

delicate wren
#

the server is connected to almost a gigabit internet, so idk what goes wrong

obtuse valve
#

quantum simulator wot

dusty zealot
#

what is this guy on

obtuse valve
#
import random
num = random.uniform(0,1)
print(num)
#

lol

sterile orchid
#

oh yes

#

you can do that

#

ace is very correct

#

practice means do something you know you will have fun doing

#

what i did was a celestial spere with computer vision

delicate wren
#

!e

import numpy as np
x = np.random.normal(size=5)
r = (x ** 2).sum() ** .5
print(x[:3] / r)
coarse hearthBOT
delicate wren
#

hmm

sterile orchid
#

fun stuff

obtuse valve
#

i might as well just submit my existing a0 code lol

#

python + rust

#

overkill lol

sterile orchid
#

^^^

#

python+flutter

#

fun times

delicate wren
#

python+python

sterile orchid
#

^^^

#

even funner

obtuse valve
#

pypy

delicate wren
obtuse valve
#

like what can i do with robot os without a robot smfh

delicate wren
#

it needs to be two elements smaller than the original

#

that's a very advanced concept called distance

#

!e

import numpy as np
x = np.random.normal(size=5)
r = (x ** 2).sum() ** .5
print(x[:-2] / r)
coarse hearthBOT
delicate wren
#

a bit more clear with -2

delicate wren
#

try generating the result for size=3 many times

#

then look at the distribution

#

size=(3, samples)

#

.sum(axis=0)

#

!e

import numpy as np
x = np.random.normal(size=(3, 10))
r = (x ** 2).sum(axis=0) ** .5
print(x[:-2] / r)
coarse hearthBOT
delicate wren
#

this is just the original but repeated many times

#

result will have a somewhat unexpected distribution

#
x = np.random.normal(size=(3, 1000))
r = (x ** 2).sum(axis=0) ** .5
y = x[0] / r
y.sort()
plt.plot(np.arange(len(y)), y)
#

I've used it somewhere in there, yes

#

at the very end

delicate wren
#

!e

import numpy as np
import matplotlib.pyplot as plt
x = np.random.normal(size=(3, 1000))
r = (x ** 2).sum(axis=0) ** .5
y = x[0] / r
y.sort()
plt.plot(np.arange(len(y)), y)
plt.save('out.png')
coarse hearthBOT
delicate wren
#

I don't remember if it can

#

!e

import numpy as np
import matplotlib.pyplot as plt
x = np.random.normal(size=(3, 1000))
r = (x ** 2).sum(axis=0) ** .5
y = x[0] / r
y.sort()
plt.plot(np.arange(len(y)), y)
plt.imsave('out.png')
coarse hearthBOT
proper ridge
delicate wren
#

!e

import numpy as np
import matplotlib.pyplot as plt
x = np.random.normal(size=(3, 1000))
r = (x ** 2).sum(axis=0) ** .5
y = x[0] / r
y.sort()
plt.plot(np.arange(len(y)), y)
plt.savefig('out.png')
coarse hearthBOT
delicate wren
#

🎉

#

least impressive plot

#

!e

import numpy as np
import matplotlib.pyplot as plt
x = np.random.normal(size=(4, 1000))
r = (x ** 2).sum(axis=0) ** .5
y = x[:2] / r
plt.scatter(*y)
plt.savefig('out.png')
coarse hearthBOT
delicate wren
#

it's constant density

delicate wren
#

projecting a sphere onto a line

delicate wren
obtuse valve
#

???

#

sounds like .reshape()

#

dude i barely know complex numbers dude, im supposed to start learning them when my further maths course starts

#

you forgot that im really bad at mafs

outer oriole
#

So the wires are the data and the matrices are the code?

merry sinew
#

can somebody help me with a project real quick it only takes 10 minutes I need to ask if I did something wrong

merry sinew
#

look at dms

delicate wren
obtuse valve
#

okok should i start debugging my autograd lib

#

i can streammmmmmm

#

yeah i would fix my autograd lib and call it a day i guess

outer oriole
#

... everything starts with a failing test...

#

FWIW, @proper ridge is laying down some solid wisdom.

obtuse valve
#

how can supporting open source earn money?

#

from donations?

proper ridge
obtuse valve
#

iirc i know some projects are sponsored by companies

#

interesting

proper ridge
obtuse valve
#

i have 0 wisdom to give lol

#

eager to receive though

proper ridge
obtuse valve
#

heheheheheh i suck at accounting lol

#

i took an accounting class for like a term 2 years ago

#

credit side never equalled debit side

#

tax deductible?

#

and exemptions??

#

mark to market accounting?

#

shitter

#

how to commit fraud 101 /j

delicate wren
#

in how Oxide operate, open source value doesn't come from donations; it comes from what it gives them as a business: publicity, more job candidates, contributions from external developers

obtuse valve
delicate wren
#

and all that for the company that doesn't use Microsoft/Oracle style of monetisation

proper ridge
obtuse valve
#

probably some person using chadgpt for it:

proper ridge
#

Have fun performing image processing on 10 by 10 pixel images hehehe.

obtuse valve
#

(for a school project lol)

#

/j

proper ridge
obtuse valve
#

that's even worse, git cloning

delicate wren
#

"you don't have to license the bios if you don't use a bios"

obtuse valve
#

issue: rewrite your shit so that it's correct

delicate wren
#

AMD

proper ridge
obtuse valve
#

issue: fix skill issue lmao

proper ridge
#

This is the cycle QML guys make:

  1. Do QML
  2. See QML suck ass
  3. Cry about it
  4. Think of bottlenecks
  5. Choose to work on changing QML as a whole, or giving up and moving to another thing
obtuse valve
proper ridge
obtuse valve
#

interesting

#

so moral of the story: vertically integrate everything so that you set the standards?

#

lol

#

alternately outsource the production of code etc but buy the rights for them for cheap? eg hire programmers in areas with cheap labour costs

#

but apple was technically aimed towards a different niche

#

the "pros"

#

yeah, i though apple was always luxury/status/lifestyle brand

delicate wren
obtuse valve
#

oooooooof

#

||chatgpt||

#

completely forgot about that lol, my capitalist side took over /j

#

lol im typing this from m1 air lol

#

but i thought we were initially talking about companies @outer oriole

#

like we were talking initially about google being vertically integrated

#

and the advantages of it

sly pond
#

So whyare we talking about M chips?

crystal aurora
#

Engine. Pistons.

sly pond
#

that's such a small part of APple

obtuse valve
#

dude calm down

sly pond
#

vertical intergration works best when you have boatloads of cash

#

does not work for small businesses becasue it's not viable to exclusively serve yourself

delicate wren
#

buying apple products because of the processor is reasonable, and that's the success of it

sly pond
#

As a developer, I hate the M chips

#

when the OS only runs on their chips, which you cannot buy, you cannot hackintosh

obtuse valve
#

youre muted

#

nvm

sly pond
#

that's how they are killing the hackintosh

obtuse valve
#

i can hear you

#

say something

#

all good

#

shit my airpods are gonna die soon

#

they're a lifestyle company

#

luxury

#

conspicious consumption

#

it's like a badge of exclusivity

#

pcmr moment:

#

so public companies are bad????

#

google = big bad boi???

#

lemao dont be evil

#

closedai:

#

i mean openai

outer oriole
#

I think maybe Ford

obtuse valve
#

idk why tf my left airpods drain so fucking quickly

#

i use both

#

smfh

sly pond
#

What's the title of this book?

elder wraith
sly pond
#

Question about Kodak

outer oriole
#

Yes, when Andy Grove moved to RAM chips people thought he was the crazy

sly pond
#

did oyu say they didn't make digital cameras?

obtuse valve
#

exerpt from zero to one by peter thiel, that's what i thought about products

elder wraith
#

Kodak had invented digital camera, had some patents on it but didn't do anything with it because film

delicate wren
#

> peter thiel
well that makes it a never-read book for me

elder wraith
obtuse valve
#

lol

sly pond
outer oriole
#

In hell, the only vendor is IBM Global Services

delicate wren
#

"developers developers developers"
oh wait not that quote

obtuse valve
#

shit

#

you were faster than me

#

i was typing that shit

#

i heard ballmer

#

my brain:

elder wraith
#

Pichai Sundararajan (born June 10, 1972), better known as Sundar Pichai (), is an Indian-born American business executive. He is the chief executive officer (CEO) of Alphabet Inc. and its subsidiary Google.
Pichai began his career as a materials engineer. Following a short stint at the management consulting firm McKinsey & Co., Pichai joined Goo...

obtuse valve
#

wait is it for his "developers" presentation???

#

or was it another one

obtuse valve
#

r/trueoffmychest /j

obtuse valve
#

i watched it this afternoon

#

I WATCHED IT IT WAS W TAKE

#

it was so fun

delicate wren
#

the only time I use copilot is on someone else's IDE when they need help/quick demo/whatever

delicate wren
obtuse valve
#

numpy lmao

#

once again

delicate wren
#

@sly pond
AI-based tagging?

#

in a way

obtuse valve
#

@delicate wren yk the stuff i said earlier today lol

#

moral of the story: use numpy

delicate wren
#

as for grouping:
some would call K-means AI too

elder wraith
#

It's like everyone who use Copilot says "Write Fizzbuzz" and it works great

#

then they give it some leetcode, it goes great

obtuse valve
#

lol

elder wraith
#

then they are like "Write this crazy CRUD app" and 💥

delicate wren
obtuse valve
#

is this how ultron is built lol

delicate wren
#

fancy search solutions + copy paste in case of leetcode

obtuse valve
#

startup cost:

  • chadgpt subscription cost
elder wraith
#

grifters are just trying to put money from PE in their pocket

delicate wren
#

ibm acquired hashicorp

#

terraform

elder wraith
#

and Red Hat

delicate wren
lofty merlin
sly pond
outer oriole
proper ridge
kind sky
#

oh alr

hoary citrus
#

@proper ridge hi

#

Yes

sly pond
#

Whoa, someone's writing Python?

#

madness

hoary citrus
#

What are you working in?

hoary citrus
#

@proper ridge Why you have so many tabs open?

#

isn't this make your computer/laptop slow

thin lintel
#

@misty sinew nooooo 😭

sterile wind
#

Truue

#

yippee

#

Happy birthday, CheeseburgerFreedomLand!

#

I'm jumping head first back into python with only gdscript experience and vague memories of python in high school to guide me.

obtuse valve
#

@thin lintel my airpods got charged

#

turns out i think the left slot got dirty

#

popcat1!!!!!

proper ridge
#

He's rapping at this point.

#

I asked him to slow down a bit.

obtuse valve
#

this video started my programming career

obtuse valve
proper ridge
#

I'm ok.

#

And no, not an 'merican either. Was just working late.

#

He's from somewhere on earth, why care which patch of earth?

obtuse valve
#

well use ctrl f to fix it

#

do you like rust/!??!?!?!?!

#

yayyyayazyay

proper ridge
#

Welcome Opal dear.

#

Gonna head out for dinner. Cya guys later.

obtuse valve
#

HAHAHAHAHHAHA

#

RUST

#

i program in fortnite!!!1!!

#

is the earth flat!>!!.!>?!/!11!

#

!lol!

coarse hearthBOT
#
Sending images in embeds using discord.py

Thanks to discord.py, sending local files as embed images is simple. You have to create an instance of discord.File class:

# When you know the file exact path, you can pass it.
file = discord.File("/this/is/path/to/my/file.png", filename="file.png")

# When you have the file-like object, then you can pass this instead path.
with open("/this/is/path/to/my/file.png", "rb") as f:
    file = discord.File(f)

When using the file-like object, you have to open it in rb ('read binary') mode. Also, in this case, passing filename to it is not necessary.
Please note that filename must not contain underscores. This is a Discord limitation.

discord.Embed instances have a set_image method which can be used to set an attachment as an image:

embed = discord.Embed()
# Set other fields
embed.set_image(url="attachment://file.png")  # Filename here must be exactly same as attachment filename.

After this, you can send an embed with an attachment to Discord:

await channel.send(file=file, embed=embed)

This example uses discord.TextChannel for sending, but any instance of discord.abc.Messageable can be used for sending.

obtuse valve
#

wtf

#

!

sly pond
#

!lol

obtuse valve
#

lol!

sly pond
#

!lol!

obtuse valve
#

!lol!

elfin breach
#

!gg!

obtuse valve
#

wtf

#

i summoned the demons

#

colonise the schedule lol

#

!lol!

#

ohshit

#

i de-summoned the thingy

#

no home?

#

:(

#

no web

#

🕸️

#

dude

#

guess what

#

my first lang was js

#

im a traumatised soul /j

#

embrace the inner chaos

stuck bluff
#

@soft turtle @shy jasper 👋

soft turtle
stuck bluff
#

I noticed.

#

Don't let me detain you.

soft turtle
#

aight you're good

obtuse valve
#

THIS IS SO GOOD!!!!!!!!!!!!!!!!!!!!!!!!!!!

obtuse valve
#

@thin lintel

obtuse valve
raven orbit
obtuse valve
#

yeah ive seen this verision before

#

i take 4 a levels

#

and i plan to take crest award + epq

stuck bluff
#

@woven vine 👋

woven vine
#

Hiii

#

I need help

stuck bluff
woven vine
#

One minute…

stuck bluff
woven vine
#

I don't write English very well and I can't speak on the call because of the verification

stuck bluff