#voice-chat-text-0
1 messages ยท Page 318 of 1
hello
ok
I am your mother, you listen to me.
Guys, I'm a self taught programmer and I'm struggling with understanding classes, abstracting and implementing them in my projects. Untill now for my projects I'm relying on just functions and basic modules. Do you guys have any tips or recommendations to help me improve this asspect?
Do you understand OOP?
classes are a way to encapsulate data + methods
Basically, let's say you want to represent some entity in your code, i.e.,
class Person:
def __init__(self,
name: str,
age: int) -> None:
self.name = name
self.age = age
def change_name(self,
new_name: str) -> None:
self.name = new_name
def double_age(self) -> None:
self.age *= 2
So, here I have represented a Person with a set of attributes (name and age) and methods (functions that are defined for the object) to manipulate the attributes of the object.
Basically, whenever you want to represent some entity that cannot be represented with basic primitives (i.e., numbers, strings, containers), then you can use a class to define it.
Abstractly speaking, whenever you want to represent some entity/object in OOP, you can use a class. You take in some parameters, you define the attributes of the object (only characteristics you care about/are relevant to your code), and you define methods to be applied to the object.
hello @grim perch
yo
I didn't understand a single word of that. What do you mean by intercept?
okay so it's like a template
Exactly.
The problem I'm having is how can I think in terms of classes. I mean thniking of fuction (input -> output) is simple but classes seems bit difficult.
yeah the constructor method
This is some tgype of training ??:)
easiest example is the getter setter methods.. get name.. set name
!e ```py
class MyClass:
def my_method(self):
print('Hi.')
instance = MyClass()
instance.my_method()```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Hi.
yeah the instance object thing is passed with '.' notation (am i right)?
an object instantiated from a class will have public methods available as defined in the class
!e ```py
class MyClass:
def my_method(self):
print(self)
instance = MyClass()
print(instance)
instance.my_method()```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | <__main__.MyClass object at 0x7fbca72d3710>
002 | <__main__.MyClass object at 0x7fbca72d3710>
!e py a = [] b = [] c = a print(a == b) print(a is b) print(a is c)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | True
002 | False
003 | True
this is pass by reference and pass by value
okay value of a and b is same (empty) but located in different memory
where as c is pointing to 'a'
python doesn't have such a notion
ohh okay
everything is passed by reference in the case of python
Thanks for clearing the doubt
I think C#/Java and some others may make exceptions have special cases (I'm bad with English)
@midnight agate does Java have pass-by-value structs?
as in copy-on-pass
!e
code
!e ```py
class MyClass:
def set(self, value):
self.data = value
def get(self):
return self.data
instance = MyClass()
instance.set(123)
print(instance.get())```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
123
!e ```py
code here
```
as far as I see, Java doesn't, and requires explicitly cloning
!e ```py
class MyClass:
def init(self):
print('Hello.')
instance = MyClass()```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello.
- yes,
PyObject * idstrandintare some of exemplary cases of the notion of pass-by-value in Python being incorrect
ohh so the constructor method is called by itself upon the instantiation of the class object
!e ```py
class MyClass:
def init(self, value):
print(value)
instance = MyClass('Hello.')```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello.
not always
first and foremost, speaking about shared ownership of bigints
copying a bigint would be expensive if it wasn't just an rc bump
ok
same for str
but I know global in scopes
if you want to see what passing strings by value looks like, look at C++
okay yeah inside a function its local scope
so we can have same variable names inside and outside the function
nonlocal is useful for stateful decorators
Yeah thanks but I still have one thing, so tell me how to think of problems in terms of classes?
ohh okay
can you please give an example about the persistance thing that you mention.
classes make sense even if there's no corresponding object inherently existing in the system you're modelling;
those would be introduced to simplify the the program, mostly (bundle related behaviour and data into a single thing)
!e ```py
class MyClass:
def add(self, _):
return 123
instance = MyClass()
print(instance + 'Hi!')```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
123
got it the add symbol is a special method and can be modified depending of data type, here like we can add 2 strings which simply concatenates them
some patterns hinting at needing a class:
global- function has 3 or more arguments which it directly passes to other functions it calls (not saying "2 or more" because that's not worth the refactor that often)
- any resource management (see context managers)
(I will add more if I remember more)
it is about variables
when i write this
input ("Enter first number ") ;x
input ("Enter second number ") ;y
z = y+x
print (z)
Thanks @somber heath for the kind explaination
it gives me this nter first number 3
Traceback (most recent call last):
File "c:\Users\Youss\Downloads\Turtle\Untitled-1.py", line 1, in <module>
input ("Enter first number ") ;x
^
NameError: name 'x' is not defined
where did you get ;x syntax from?
ok
ok
so
x = input ("Enter first number ")
y = input ("Enter second number ")
z = y+x
print (z)
!e py a = '1' b = '2' print(a + b)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
12
yes
!e py a = '1' # a = input('Number one: ') b = '2' # b = input('Number two: ') a = int(a) b = int(b) print(a + b)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
3
but what if i everytime want a custom number
!e
_next_line = iter("""\
1
2
""".splitlines()).__next__
input = lambda *args: (print(*args, end=""), (line := _next_line()), print(line))[1].rstrip()
x = int(input("Enter first number: "))
y = int(input("Enter second number: "))
z = y+x
print(z)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Enter first number: 1
002 | Enter second number: 2
003 | 3
omg
why
yes
it works now
!e x = input ("Enter first number ")
y = input ("Enter second number ")
x = int (x)
y = int(y)
z = (x + y)
print (z)
oops
!e py int('blah')
: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 | int('blah')
004 | ValueError: invalid literal for int() with base 10: 'blah'
!e py try: int('blah') except ValueError: print('Caught.')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Caught.
thanks ๐ I found this kind of problem lately, it's clear now
the point is what are you try to do ??
it is like if:
!e
Print("hellow world")
I am new in python
Where is the mistake
I have written it correctly
it said how to fix it in the output
!e
Print("hellow world")
: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("hellow world")
004 | ^^^^^
005 | NameError: name 'Print' is not defined. Did you mean: 'print'?
Did you mean: 'print'?
ok
new error messages are quite helpful
ok
How the F*** is OpenAI Open when all their code is closed-source ?!? ..
the eternal question
it's legitimate
while True:
try:
value = int(input('Number: '))
except ValueError:
continue
break```
why
!e
while True:
try:
value = int(input('Number: '))
except ValueError:
continue
break```
"open" for use
if not for region block, limits, etc.
that would qualify as "free" or "freemium" but not "open"
ok i understand. Thankyou
while True:
try:
value = int(input('Number: '))
break
except ValueError:
pass```
U can write thx ,......
?
suffering be like :
Hey voided why u gave ur name voided
wdym
r u name-racist or what?
i am one of the people who hate loops
ofc
I often ask question to them who have weired name
Ahm why??
why is your name paulbatnick
yes but
not all the lopps r bad
i love some loops
!e py while False: pass else: print(123)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
123
ok
!e py for letter in 'abc': print(letter)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | a
002 | b
003 | c
letter = 'a'
print(letter)
letter = 'b'
print(letter)
letter = 'c'
print(letter)```
ok
@somber heath i have to go for sometime
so you can continue with the others
bye
!e
for x in range(10):
print()
for y in range(x):
print("*",end="")
Nom not expected
!e py for x in range(10): print() for y in range(x): print("*",end="")
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 |
002 |
003 | *
004 | **
005 | ***
006 | ****
007 | *****
008 | ******
009 | *******
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/I2BNSMYXK7SPFZUQKAEHNTPA2Q
What's wrong with it?
!e py print('abc' * 3) print('+' * 2)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | abcabcabc
002 | ++
!e py for i in range(10, 15): print(i)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 10
002 | 11
003 | 12
004 | 13
005 | 14
@somber heath ๐ค
@oak prawn ๐
Yeah I was expecting something else
Centered?
!e py print('abc' + 'def' + 'ghi')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
abcdefghi
Can u do it
!d str
class str(object='')``````py
class str(object=b'', encoding='utf-8', errors='strict')```
Return a [string](https://docs.python.org/3/library/stdtypes.html#textseq) version of *object*. If *object* is not provided, returns the empty string. Otherwise, the behavior of `str()` depends on whether *encoding* or *errors* is given, as follows.
If neither *encoding* nor *errors* is given, `str(object)` returns [`type(object).__str__(object)`](https://docs.python.org/3/reference/datamodel.html#object.__str__), which is the โinformalโ or nicely printable string representation of *object*. For string objects, this is the string itself. If *object* does not have a [`__str__()`](https://docs.python.org/3/reference/datamodel.html#object.__str__) method, then [`str()`](https://docs.python.org/3/library/stdtypes.html#str) falls back to returning [`repr(object)`](https://docs.python.org/3/library/functions.html#repr).
See anything interesting in the link?
Have a play.
See: String methods.
!e py print('aBc'.upper())
:white_check_mark: Your 3.12 eval job has completed with return code 0.
ABC
I can't speak ๐ฅ
Recorded live on twitch, GET IN
Article
https://gynvael.coldwind.pl/?lang=en&id=782
Guest
https://youtube.com/lowlevellearning
https://twitch.tv/LowLevelLearning
https://twitter.com/LowLevelTweets
My Stream
https://twitch.tv/ThePrimeagen
Best Way To Support Me
Become a backend engineer. Its my favorite site
https://boot.de...
Dumb ne
Inexperience is not to be confused with a lack of intelligence. Mistakes are a component of learning, one where you find out "okay, that was wrong, too far in a direction". Learning what not to do and what it feels like when you're about to make that mistake is important, too.
@restive bough ๐
Thx but code was working in my compiler but not here๐
๐ซก
Whom @somber heath
I can talk in vc
@whole bear ๐
heyy I can't unmute yet
I have been on the server for less than 3 days and sent less than 50 messages, will be able to unmute in a couple of days
Can I connect Pycharm and Github?
replying to me?
no to OpalMist, I don't know the answer to your question
Fast
lmao
I don't know bro, you tell me what kind of music you into? any specific genres/artists that you listen to a lot?
got any recs for me?
oh that's great
..
Orpheus was a musician in Greek mythology, found his story interesting so just put him up
I do listen to classical music a lot
I love India music
..
yeah that's good too
U hear Indian music what can u understand that
ok thanks
Ok before thanks doesn't seems good๐
Hmm which project u are working on
you have mic?
I am in mob
No project now am learning pandas
wbu
Oo panda
wdym?
ok
what are you doing?
didn't understand your question
taking a nap
homer reaches his tipping point after a day at the mall where every business asks for a tip.
Subscribe for More: http://fox.tv/SubscribeAnimationonFOX
Stream The Simpsons on Hulu: https://www.hulu.com/series/the-simpsons
See more of The Simpsons on our official site: https://www.fox.com/the-simpsons/
The beloved animated series focuses on...
hemlock
i just turned on a fan
and i have window open
noodle's temp is saying 34 degrees (C)
well
summer arrived early ๐
like i have a thing under noodle's heat mat
that tells me the temperature
i have it so that when it goes over 35 degrees, it starts to beep
dude i hate this shit
whyyy
my code is not coding
Gamez LYRICS - Bei Maejor Feat. Keri Hilson
Video Game Lover Lyrics on screen
Musical.ly ^_^
Spotify
http://www.youtube.com/user/VanzLyriczHD
http://www.facebook.com/VanzLyricsHD
https://twitter.com/VanzLyrics
ayo?
@rugged root hi
?
code wrong
my kettle works too, just doesn't boil my water :P
:P
youre lucky, my kettle doesnt even boil carbon dioxide.
well i hope not, i'm pretty sure that's normally a gas at room temp and pressure
ye
@rugged root ^ bad UI or good UI ?
Hamlock but it's a strawberry.
@fallen mango ๐
@urban abyss There's no background noise, but your mic is open.
@rugged root This is my current project: rebuilding git in go so I can learn both.
Had to shut off copilot since I need to be able to fail in order to learn
yay i fixed my code :)
!stream 239917638656983040
โ @willow light can now stream until <t:1716563100:f>.
Greetings all
!d subprocess.check_call
subprocess.check_call(args, *, stdin=None, stdout=None, stderr=None, shell=False, cwd=None, timeout=None, **other_popen_kwargs)```
Run command with arguments. Wait for command to complete. If the return code was zero then return, otherwise raise [`CalledProcessError`](https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError). The [`CalledProcessError`](https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError) object will have the return code in the [`returncode`](https://docs.python.org/3/library/subprocess.html#subprocess.CalledProcessError.returncode) attribute. If [`check_call()`](https://docs.python.org/3/library/subprocess.html#subprocess.check_call) was unable to start the process it will propagate the exception that was raised.
Code needing to capture stdout or stderr should use [`run()`](https://docs.python.org/3/library/subprocess.html#subprocess.run) instead:
```py
run(..., check=True)
``` To suppress stdout or stderr, supply a value of [`DEVNULL`](https://docs.python.org/3/library/subprocess.html#subprocess.DEVNULL).
The arguments shown above are merely some common ones. The full function signature is the same as that of the [`Popen`](https://docs.python.org/3/library/subprocess.html#subprocess.Popen) constructor - this function passes all supplied arguments other than *timeout* directly through to that interface.
!d shutil.which
shutil.which(cmd, mode=os.F_OK | os.X_OK, path=None)```
Return the path to an executable which would be run if the given *cmd* was called. If no *cmd* would be called, return `None`.
*mode* is a permission mask passed to [`os.access()`](https://docs.python.org/3/library/os.html#os.access), by default determining if the file exists and is executable.
When no *path* is specified, the results of [`os.environ()`](https://docs.python.org/3/library/os.html#os.environ) are used, returning either the โPATHโ value or a fallback of [`os.defpath`](https://docs.python.org/3/library/os.html#os.defpath).
pygame has been around since 2.7 at least, I think
when was 2.7 released
something doesnt add up.
24 years ago.
wait
that might be the old pygame
!pypi geojson
- Thank you, Bonnie Bees, for making this video possible: https://www.patreon.com/cgpgrey
Related Videos
- The Simple Secret of Runway Digits: https://youtu.be/qD6bPNZRRbQ
- Social Security Numbers: https://www.youtube.com/watch?v=Erp8IAUouus
Special Thanks
- William Raillant-Clark, ICAO Communications Officer: https://www.icao.int/secre...
!pip siphon
the repo I was browsing is here:
Hell yes
it took me a second to remember how to change neofetch's output ๐ญ
u have to make a variable u can't just print it ๐
oh
i was doing print
it's prin or echo apparently but it wont follow color formats
Saying whistle for WSL is easier than saying its letters one by one. It makes the conversation around it much more smoother.
Hell yes
nah i use fastfetch
so neofetch is whatever
fastfetch actually gets the data that neofetch doesn't seem to get
sqlite
HOWEVER! If you are teaching a student who only begins to understand these, its better to say the letter one by one until they developed their own phrase of choice of these acronyms. @rugged root
hi
How's it going
it's goin
Philosopherโs stone, in Western alchemy, an unknown substance, also called โthe tinctureโ or โthe powder,โ sought by alchemists for its supposed ability to transform base metals into precious ones, especially gold and silver. Alchemists also believed that an elixir of life could be derived from it.
let's circle back to that
let's pull in all the families to enable alignment on this epic
@grim solar #career-advice
hey can anyone help me with adb issue ?
@rugged root hi๐
I thought I've just heard a doorbell ringing
(it wasn't)
hallucinations
exploring various Rust crates again
https://crates.io/crates/triomphe
(I was making my own Arc earlier, and now found this accidentally)
surprisingly rare
yummy
"which one?"
programmers are also human video:
Rust programming language
Interview with a Rust developer with Jester Hartman - aired on ยฉ The Rust.
Find more Rust opinions under:
Full version on paah.vhx.tv
Programmer humor
Rust humor
Programming jokes
Programming memes
Rust
yew
Rust memes
Rust jokes
unsafe command
future
traits
#programming
#jokes
#Rust
fav quote from there:
5 games
50 game engines
which part of the app did you write
confused
the browser!
yeah lmao
Yo xD
@rugged root atomic
Wssup
atomic(ally) reference-counted
idk if anyone is interested in watching me unfuck month-old code
Not much, you?
Nothing special i am dev earning low any tips xD
Oh like career advancement kinds of tips? #career-advice would be a better place to ask about that kind of stuff
bugs => add more assertions and tracing
for async, logging/tracing, because stopping the whole runtime isn't viable to inspect the state
Rotterdam is really chewing me out. 520 ping regular? You cold Rotterdam, you real cold.
!voicemute 1167153161958600715 "2 weeks" Spamming to get your message count up for the voice gate is not allowed.
:incoming_envelope: :ok_hand: applied voice mute to @peak mirage until <t:1717779151:f> (14 days).
@frozen owl how do you notice that it drops?
what does it mean that it drops?
hangs? panics?
Codes panic?
what channel are you using?
@frozen owl blocking on shared resource?
are you using any mutex at all?
or rwlock
are there jobs pending in the queue for threads to take?
as in is there anything for threads to do in parallel
if it's not scheduling more than one task, there can't be more than one task in parallel
is there a "pending jobs" counter somewhere?
You can't parallelize two jobs if you don't have two jobs to begin with is what he means.
are you replacing selector?
when network is some
so you're waiting on only one of them at a time
wait on both
that might be a solution
You queue both tasks, and then run them in parallel.
Not do it sequentially if you don't have to do it sequentially (meaning you don't NEED to run the first task before the second).
You should only wait one at a time (which I think AF means run one at a time?) if you absolutely have to run task 1 then task 2 then task 3.
how was that concurrency graph generated, again?
at runtime, this isn't calling python directly, right?
Making progress little by little. Work has been keeping me nice and busy
what do colours represent exactly?
As long as it's getting steady progress it's good. Slow is steady, steady is fast.
same here
im having like month long exams lol
where is the next print?
right after you receive the new thing from the queue, change the colour again
because it's no longer waiting
to make the graph reflect what's actually happening
no
just to cut that thing earlier
to check if it's actually waiting
you can reset the colour, right? as in stop the event
no, in other threads you seem to have thin events
or the thing that's supposed to send stuff to them isn't sending
what are other await points in that function?
what are you receiving
so you
send
recv
send
recv
right?
you need
send
send
recv
recv
are you spawning multiple instances of send-recv task?
can you measure how many generators you have waiting for recv?
just increment/decrement a static and sample periodically
(using atomics)
just a counter
for debug
fetch_add
fetch_sub
load
all with either AcqRel or Relaxed ordering
AtomicUsize::new(0)
you don't need what it returns
fetch add 1 on start
fetch sub 1 on end
load in a separate thread/task
literally what it suggested there but with a global instead of Arc
load somewhere else
yes
loop { print(load()); sleep(); }
but with proper syntax
spawn it once per program run
it's just a temporary debugging tool
until you figure out how to implement the same thing properly via tracing
you can shove tracing data into opentelemetry or whatever
though I doubt that's simpler
the conjecture so far is that it blocks on queue receive?
can you test it more precisely?
because, as far as I saw from code, there's quite a lot of stuff after the receive that chart would not reflect
let now = Instant::now();
// recv, literally one line
eprintln!("{:?}", now.elapsed());
are outputs of this considerably larger than zero?
just to make sure it's not something else that's blocking
in worker threads
(I'm still not entirely sure where time values are actually coming from)
can you show the whole thing with [measure start, recv, measure end, print] again?
it must not be mut
brb
redefine the variable on each iteration
no
I'll be at the PC in ~20 minutes
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
it'll generate the exact same code in most cases
noooo not the discord compact mode :(
why isnt Win+Q the default keybind to close an application
i love win+q
hemlock youre giving me opalmist flashbacks
he used to (might still) tell people to check that channel and its so funny
https://www.wbur.org/news/2024/05/23/mbta-charliecard-fare-collection-system oh cool, better six years late than never, right?
The new payment option will launch sometime this summer on subways, buses and above-ground Green Line trolleys. Riders will be able to pay their fares not just with a traditional pass, but also with a tap-enabled credit card, a mobile wallet like Apple Pay or Google Pay, and similarly enabled smart watches.
exact
my code broke again :)
ohhh thats good ...
My new outfit
Comfortable?
Oh yeah, theyโre so comfy that I had to order a pair in blue too
software engineer is a rare profession in this server tbh
learning some webgl stuff
pretty fun, but the amount of boilerplate code you need is actually absurd
here's a fun little color mixing thingy i dude with my own oklab implementation in webgl
also 3d cube rotation go weeee
same corner colors with rgb mix
you can see all the middle stuff is generally darked (especially the purples and grays)
i'm not look like this
you gotta rotate
i did , not again.
ugh i guess time is relative
i just came back from a shower and a dinner
which queue is it waiting on?
there's, like, multiple receivers
channels, yes
what happens if graph_disconnected && network.is_none()?
seems like it'd just block
if that ever happens
is it mostly blocking on net_receiver or tensor_receiver?
as in which queue it receives from when it's waiting for a long time
@frozen owl send waits if the channel is full
what is the capacity?
of tensor_receiver and of net_receiver
is utilisation ever more than the number of workers?
.len()
workers not generators
of which there's too, iirc
worker fetches jobs from the queue
what is the other event that is active while one of the two is waiting?
(trying to find it in the source)
packing? eval?
is the whole batch a single message?
or many messages?
as in items of the channel
can it be that one thread consumes them all while the other one doesn't get to receive anything?
once a thread starts processing instead of pulling messages, then print .len() of the channels
if it's 0, then that's what's happening
yes
when red crosses into purple on that graph, if I understand correctly
reduce batch size?
so it stops earlier
how does the number of generators depend on batch size?
exactly same?
generators aren't producing items fast enough
@frozen owl where are items coming from?
how many items does a single item cause to be produced?
not enough jobs are generated somehow
I'd say that's expected that it slows down at start and the end
it's tree search, right?
if it ends up in deep calculations, it's too linear to parallelise, I guess
@round stratus it's a worker thread for compute-heavy processing
maybe have dynamic batch size?
hmm
yeah, maybe it's just not parallelisable
is it stopping after a certain depth?
single thread always pull everything it can
otherwise your implementation of workers would be completely dysfunctional
so no red is correct
why not just have a single thread with the largest theoretically possible batch size?
the this
if it doesn't fill up, it partially fills up
not like multiple threads will help that
I'd suggest parallelising based on specific GPU actions
copy while it computes or something similar
@round stratus idk about the graph when it shows parallel, but for the alternating portions it's pretty clear now what happens:
all the work to do fits into a single batch which the worker consumes in its entirety
thread 0 [--copy--][--compute---------][--copy--]
thread 1 [--wait--][--copy--][--wait--][--compute---------][--copy--]
"perfect time to ask if it's running in --release"
wouldn't be surprised if it just slowed down so much
that it doesn't show yet
(on this short of a timescale)
core/training/train.py line 207
def check_size_compatibilities(self):```
cool
Hello
"When I wrote this code, only God and I knew how it worked. Now only God knows"
Goodbye!
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\e\OneDrive\Documents\python\Scripts\ERROR_592834.spec'
C:\Users\e\OneDrive\Documents\python\Scripts>
python pyinstaller.exe --onefile ERROR_592834.py
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\willm\OneDrive\Documents\python\Scripts\options.spec'
hi
@tropic cobalt ๐
Write amplification (WA) is an undesirable phenomenon associated with flash memory and solid-state drives (SSDs) where the actual amount of information physically written to the storage media is a multiple of the logical amount intended to be written.
Because flash memory must be erased before it can be rewritten, with much coarser granularity o...
I'm reading about write amplification rn
will put on some music and start reading
@low minnow ๐
๐๐ป @stark river )
hello are you experienced in dsa?
nope I quit video games thursday and took up coding ๐คฃ
I need moni to buy a dishwasher
lmao im following bro codes tutorial to get started then using the discords python resources ๐
guys i think im not too far into it ๐
yeah he has loads of 12h courses
@open mica how long have you been coding?
wait what school?
W3?
bro my tabs are looking chaotic
yeah i just made the acc so i had it
yeah fricking 3 days to speak in vc is cheeks
sure
im gonna get a note book and write this stuff down
nah just for at school
Im going into a class called STID2 which is science, technology and sustainable developpemnt
im 16
yeah summer is coming up
true xD
bro it looks like so much yap since i can bloody vc
kk projects and network gotchu
yeah when i played skyblock i became a decent dungeons player by vcing and watching screenshares so im gonna do the same with python
tf is family name bro ๐
this is some creative acc making
BRO THIS STUFF WONT LET ME SIGN IN WITH GOOGLE LEAVE ME ALONE
ok for some reason i cant make an acc
this is fire
Your surname
oh ok im just slow
looks busy in here
unfortunately being on discord is like taking drugs according to control freak parents
and talking to strangers is bad because strangers might have bad intentions, also according to control freak parents
oh :(
control freak parents are afraid you'll see they're wrong and maybe you'll try to escape the cycle of abuse
well duh
but the last time i was on vc 0 they uninstalled discord
...
meh who cares
i mean
sorry to hear
airfry eggs?
@solemn saddle ๐
blowing my nose -> air out of my right eye
whats goiong on
@eager merlin ๐
Hello
๐
@fluid sentinel ๐
Hi
sad
oh
umm
btw
what should I do in this situation?
a) make fun of him with my friends in out private server, b) block and report, or c) play into their hands
ok
ig that's closest to b
omg
I'm still gonna make fun of him tho
with my friends
... in a private discord server?
sure
my biggest concern is they're a member of this server
meh
because idk
probably against some rule?
I'll take your advice
ohh wise... opal
7.5k AUD
And weekly too 
I guess it's better than confronting them tho
just ignore
lol
But still... spending 7.5k on someone weekly
even if you're on a dating app you'd probably have doubts
@civic notch ๐
hi
hi\
Hi
my dad was the same in the past
very annoying
most of my youth interactions with my dad consisted of me circumventing his restrictions
What would happen? ZD
some boring tape to "relif" pain
doing after food running around atm ๐
I thought about getting a kitty , but sometimes I play loud music , heard kittys hate that @peak depot
they need hiding places all over ( box + towel ) to escape @peak depot
I have 2 stray cats , wander in yard to mouse , maybe once a week
was looking for PDF books on cat biology , lots for dogs
1 or 2 cats , BIG maybe
inu shiba
barky barky
Chows can be vicious
well were guard dogs
did you ever watch , Dr Phol , vet show @peak depot
mostly dogs , horses , if cats .. they are wild outside
I dont think there is a 3D model of cat for biology studies
amazing to see cat walking animations - get the gate proper
i dont know if AI would do it proper , hair , gate , bla bla
but who knows
im all for automation for drudgery , but art is something that takes such a long time to master
art = draw , music ...
listened to a podcast , troubledminds.org , lots about how AI taking over here / there
found this cheap , thought it was a cat -- its a dog
it is supposed to have tiny AI for voice but its likey a fudge
3 MCUs inside but no remote to activate it , so ... its a project
was clean , no cracks , no water damage - so no kid had it
real kitty - doggy better
do your kittys chase mice ? @peak depot
neighbor cat was outside - saw a mouse - had no idea what it was
shooty shooty bang bang ?
I find occasional turd in yard with fur in it - guess its a kitty hunter
I had a Bobcat sleeping in back yard for 3 hours - looking for wild bunnys
bit bigger , speckled coat - acts like cat but i stay away from it - i want it to return
bye
Hlo @somber heath @vital sinew
What r u guys discussing?
How to Conquer the World: Cockroach Survival Guide | Vantage with Palki Sharma
Cockroaches have slowly conquered the world. There are 4,500 species of cockroaches which are spread across all continents except Antarctica. Even so, their origin has been a mystery to scientists. Now, a new study has solved the centuries-old mystery by revealing th...
@somber heath
Hii @slender sierra
Hi everyone ๐
@solid pagoda ๐
Hii @solid pagoda
@tight zealot ๐
I'm good
#===import(s)===#
import tkinter
import matplotlib
#===============# for copying
root=tkinter.Tk() # tkinter.
def update(data):
#===list=box=clear===#
my_list0.delete(0, END)
#===topping=to=list===#
for item in data:
my_list0.insert(END, item)
#=====================#
#===body/window===#
root.title('simulator')
root.geometry("500x300")
#=================#
#===Button===#
my_button0=tkinter.Button(root, text="search",font=("Helvetica", 15))
my_button0.pack(pady=20)
#===label===#
my_label0=tkinter.Label(root, text="please select simulation", font=("Helvetica", 15),fg="grey")
my_label0.pack(pady=20)
#===========#
#===entry=box===#
my_entry0=tkinter.Entry(root, font=("Helvetica", 20))
my_entry0.pack()
#===============#
#===list=box===#
my_list0= tkinter.Listbox(root, width=50)
my_list0.pack(pady=40)
#==============#
#===list=of=pizza=toppings===#
toppings=["pepperoni", "pepper", "mushrooms", "cheese", "onions","pineapple"]
#===toppings=to=list===#
update(toppings)
root.mainloop() ```
!code
Byy @somber heath Study time
bad conection
truly im sorry
i got an error mesage
line 9, in update
my_list0.delete(0, END)
NameError: name 'END' is not defined
!e py print(END)
: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(END)
004 | ^^^
005 | NameError: name 'END' is not defined
!e py END = 123 print(END)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
123
It's perfectly fine. It's not your fault that your internet connection is made of poo.
Unless it is.
In which case get it together. 
truly im sorry
#===import(s)===#
import tkinter
import matplotlib
import sys
#===============# for copying
root=tkinter.Tk() # tkinter.
#===============#
#===quit===#
END=sys.exit()
#==========#
def update(data):
#===list=box=clear===#
my_list0.delete(0, END)
#===topping=to=list===#
for item in data:
my_list0.insert(END, item)
#=====================#
#===body/window===#
root.title('simulator')
root.geometry("500x300")
#=================#
#===Button===#
my_button0=tkinter.Button(root, text="search",font=("Helvetica", 15))
my_button0.pack(pady=20)
#===label===#
my_label0=tkinter.Label(root, text="please select simulation", font=("Helvetica", 15),fg="grey")
my_label0.pack(pady=20)
#===========#
#===entry=box===#
my_entry0=tkinter.Entry(root, font=("Helvetica", 20))
my_entry0.pack()
#===============#
#===list=box===#
#>>>>>> my_list0= tkinter.Listbox(root, width=50)
my_list0.pack(pady=40)
#==============#
#===list=of=pizza=toppings===#
toppings=["pepperoni", "pepper", "mushrooms", "cheese", "onions","pineapple"]
#===toppings=to=list===#
update(toppings)
root.mainloop()
@somber heath
Because you're calling it.
Instead of letting tkinter call it.
Also, tkinter.?
yes
!e py import sys print(123) var = sys.exit() print('Hello, world.')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
123
what would need to be changed for it to become visible
What you want to do is give tkinter a reference to sys.exit, not to call sys.exit, yourself.
Which you're doing by putting the parentheses after it.
sys.exit() exits because you're calling it when you put () after
See how the hello text is not printed?
yes
It's hitting the sys.exit, which gets called.
You're saying, what is the return of a sys.exit call? Find out and assign END to it. But it never gets one, because a call to sys.exit terminates Python.
END=sys.exit ? no parenthesis
got an error
line 3263, in insert
self.tk.call((self._w, 'insert', index) + elements)
_tkinter.TclError: bad listbox index "<built-in function exit>": must be active, anchor, end, @x,y, or a number
Looks like that's not where a reference to the sys.exit function can go.
I don't see a reference to tkinter.Listbox in the documentation.
Curious.
tkinter.Listbox
I'm seeing some references to listboxes, but I can't locate an actual Listbox class.
Case Study: IDLE Modernization: Part of a Modern Tk Tutorial for Python, Tcl, Ruby, and Perl
The first argument of a tkinter.Listbox.insert call should be the index you wish to insert before.
You have provided a function.
I don't know if it's with my specific python 3.23.3 I think
You're saying, given a list of three things, insert a thing before the functionth element.
"Functionth element?" Python cries.
"That makes no sense! Give the user an exception. I can't work under these conditions."
do you know about the Minimax algorithm
Yes, do you have a question?
so I'm making a tic-tac-toe game and I need to code an opponent
Ai or other player interface?
It's only for AI.
If you want code, here's a good example.
https://www.geeksforgeeks.org/minimax-algorithm-in-game-theory-set-1-introduction/
If you want theory, there's a nice lecture on this by Professor. Patrick Winston on OCW.
Image training?
Pardon?
What I mean is doing on the computer and take small snapshots of each and every one of it could win if it's set to x and oh showing it that every part of the board can be used like trying trying to train it nothing to somewhere from a chess
No, this isn't ML. It's a search tree.
You're not training anything.
Tic Tac Toe is small so it can be used with Minimax, but games like chess are just too big so you would have to use heuristics, like ML.
!ytdl
Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.
For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:
The following restrictions apply to your use of the Service. You are not allowed to:
1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service; (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;
3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTubeโs robots.txt file; (b) with YouTubeโs prior written permission; or (c) as permitted by applicable law;
9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
@somber heath Hey hi Opal
@somber heath it dependss on mutable and immutable objects right?
a = 2
a += 1
a
3
a =+1
a
1
@somber heath another thing I personally have is I often switch between languages, so I often have something like, trying to write for i in range() in C++ or var++ in python
i see i see
Guys, Brb.
@steady sentinel ๐
random_power()(9823075092375098237)
from ursina import *
import traceback
import Game
from Overlays.Notification import Notification
def request_handler(func):
def wrapper(self):
try:
result = func(self)
self.on_success()
return result
except Exception:
self.on_fail()
print(traceback.format_exc())
APIRequest.counter += 1
return wrapper
class APIRequest:
counter = 1
@property
def name(self) -> str:
"""
name of the APIRequest
"""
raise NotImplementedError
def on_fail(self) -> None:
message = f"{self.name}Request failed"
print(message)
Game.notification_manager.add_notification(Notification(message, color.red))
def on_success(self) -> None:
message = f"{self.name}Request succeeded"
print(message)
Game.notification_manager.add_notification(Notification(message, color.green))
# using property class
class Celsius:
def __init__(self, temperature=0):
self.temperature = temperature
def to_fahrenheit(self):
return (self.temperature * 1.8) + 32
# getter
def get_temperature(self):
print("Getting value...")
return self._temperature
# setter
def set_temperature(self, value):
print("Setting value...")
if value < -273.15:
raise ValueError("Temperature below -273.15 is not possible")
self._temperature = value
# creating a property object
temperature = property(get_temperature, set_temperature)
human = Celsius(37)
print(human.temperature)
print(human.to_fahrenheit())
human.temperature = -300``` basically get + set in one
yes
instance.getProperty()
instance.setProperty()
instance.property = ...
instance.property
def log_decorator(func):
def wrapper(*args, **kwargs):
print(f"Calling function '{func.__name__}' with arguments {args} and keyword arguments {kwargs}")
result = func(*args, **kwargs)
print(f"Function '{func.__name__}' returned {result}")
return result
return wrapper
@log_decorator
def add(a, b):
return a + b
@log_decorator
def greet(name):
return f"Hello, {name}!"
# Calling the decorated functions
print(add(3, 5))
print(greet("Alice"))```
> ChatGPT
def make_pretty(func):
# define the inner function
def inner():
# add some additional behavior to decorated function
print("I got decorated")
# call original function
func()
# return the inner function
return inner
# define ordinary function
def ordinary():
print("I am ordinary")
# decorate the ordinary function
decorated_func = make_pretty(ordinary)
# call the decorated function
decorated_func()
#output:
#I got decorated
#I am ordinary
to
def make_pretty(func):
def inner():
print("I got decorated")
func()
return inner
@make_pretty
def ordinary():
print("I am ordinary")
ordinary()
#output:
#I got decorated
#I am ordinary
Source <- I feel like they explain it pretty well here
In this tutorial, we will learn about Python Decorators with the help of examples.
@upper basin Are you in machine learning?
I did my Bachelors in AI/ML, and research QML.
Well, I'd recommend you first start with the theory and then move to coding.
Ok
You can try with scikit-learn, tensorflow, and pytorch.
theory from books?
Can you suggest any? @upper basin
book
I don't know any intro books, but you can try with Andrew Ng's course.
Hi
All good wbu
ur internet is bad ace?
It's damn Rotterdam.
Viikkokalenteri, viikon numerot, nimipรคivรคt, liputuspรคivรคt, mikรค viikko, nimipรคivรค tรคnรครคn
@pulsar shale ๐
!e py import random choice = random.choice(['Get the peach.', 'Stay in bed.']) print(choice)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Get the peach.
@pulsar shale @jolly slate ๐
@somber heath am good, and you?
!e py import random choice = random.choice(['Bus.', 'Bike.']) print(choice)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Bike.
Not all Doctor Who episodes are equal.
Some are very good, some are just...why?
I have had singing lessons.
Provided to YouTube by PIAS
Dead Boy's Poem ยท Nightwish
Wishmaster
โ Spin-Farm Oy
Released on: 2000-01-01
Bass Guitar: Sami Vรคnskรค
Drums: Jukka Nevalainen
Guitar: Erno Vuorinen
Keyboards: Tuomas Holopainen
Lead Vocals: Tarja Turunen
Composer: Tuomas Holopainen
Composer: Tero Kinnunen
Auto-generated by YouTube.
Daylight
@peak depot We've just muted you until you're done
She is.
it lasted less that 10sec...
You have a beautiful voice.
alr unmuted
everyone here has a beautiful voice
Well no, I can't sing to save my life.
i sang like 7secs...
And it was heavenly.
ik but it was right through someone talking
Plome's just jealous because he wanted to sing for me.
hence the temporary mute
thats why I sing byself only...
I'm sure it was great
heyo
@nova knoll @limpid nacelle ๐
unfortunate i cant talk
!voice if you're wondering why you can't talk, here's why.
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
tough
Telling myself, "I won't go there"
Oh, but I know that I won't care
Tryna wash away all the blood I've spilled
This lust is a burden that we both share
Two sinners can't atone from a lone prayer
Souls tied, intertwined by our pride and guilt
(Ooh) there's darkness in the distance
From the way that I've been livin'
(Ooh) but I know I can't resist it
Oh, I love it and I hate it at the same time
You and I drink the poison from the same vine
Oh, I love it and I hate it at the same time
Hidin' all of our sins from the daylight
From the daylight, runnin' from the daylight
From the daylight, runnin' from the daylight
Oh, I love it and I hate it at the same time
Tellin' myself it's the last time
Can you spare any mercy that you might find
If I'm down on my knees again?
Deep down, way down, Lord, I try
Try to follow your light, but it's nighttime
Please don't leave me in the end
(Ooh) there's darkness in the distance
I'm begging for forgiveness
(Ooh) but I know I might resist it, oh
Oh, I love it and I hate it at the same time
You and I drink the poison from the same vine
Oh, I love it and I hate it at the same time
Hidin' all of our sins from the daylight
From the daylight, runnin' from the daylight
From the daylight, runnin' from the daylight
Oh, I love it and I hate it at the same time
Oh, I love it and I hate it at the same time
You and I drink the poison from the same vine
Oh, I love it and I hate it at the same time
Hidin' all of our sins from the daylight
From the daylight, runnin' from the daylight
From the daylight, runnin' from the daylight
Oh, I love it and I hate it at the same time
Suzume ยท Anime Film "Suzume no Tojimari" OST by RADWIMPS feat. toaka
Buy/Stream:
https://lnk.to/RADsuzume
RADWIMPS official links:
Twitter: https://twitter.com/radwimps
Website: https://radwimps.jp
Anime: Suzume no Tojimari (ใใใใฎๆธ็ท ใพใ)
Website: https://suzume-tojimari-movie.jp
MAL: https://myanimelist.net/anime/50594/Suzume_no_Tojimari
IMDb: ...
this one is a banger
suzume was rushed af tho
it is but hard to sing
I think it would have done better if it wasn't a movie
Like the plot and all that is fine
just very fast
This is a gud japanese song too https://open.spotify.com/track/1JrxwbZ9u0VNwemdcJwZNi?si=60ee87431faf44bb
.
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Yes, just be active and wait a couple of days
I'm off to watch some Call the Midwife.
#dnd #animation #cartoon #dndmemes #wizard #barbarian #darksouls #eldenring #lotr #funny
#folkmusic #music #irish #tinwhistle #irishmusic #pennywhistle
Here is a tune I wrote a few years ago after a trip to Tahiti with the Irish music and dance show Celtic Legends. The tune is called Island Hopping.
Check out my album Spanish Point on Spotify for more music!
Instagram :
https://www.instagram.com/kevinmeehanwhistle?igsh=eDZyY2Nu...
learning rust finally ๐ฅ
@scarlet halo good luck
thanks
i made a stack overflow kinda thing where yu can ask questions and answer questions and this is my first django project and i think its cool...๐ ๐ ๐
hello normies
what are yall up to
wat game
haven't played the new one
play anything else?
WAT
bro brush yo teef
surviving
barely
any cereal killers
based
it's all downhill from here
be a good domesticated human
opal
anyone working on anything?
๐คฎ
writing docs for some library written in Rust
