#voice-chat-text-0
1 messages Β· Page 206 of 1
in all fairness to the server they didn't make the requirements that high so that's a good thing
in all honesty I've been in this server for the length of time that I have because I was just waiting until I could be bothered to meet the requirements
just "I see" is at the same time the worst response and the best response I've ever heard
also I feel that typing is far more difficult to use overall because if I'm just speaking then I can say what I wanna say in a shorter period of time and without the ability to read over and edit it giving it more of a sincere feel
I can definitly see your point but I mean for people who don't have those problems which is more than not
come to think of it how did you even check my message count?
so it shall seem
I honestly bairly ever use that
longer than 3 days I'll tell you that
I don't use messages on discord servers
only in debates will I actually type
also yes OpalMist is correct
I'm gonna go silent for a while but I can still hear
he doing well
he need a vet visit but he fine opal
check up
he's yearly
so what are you all working on
??
lol
@whole bear π
hello
@long nimbus π
cool i get deer out hear!
hay dos any know what the python discord lib is?
discord.py?
pydis_core?
import discord ?
discord module comes from discord.py package
@humble thicket π
!d discord
In order to work with the library and the Discord API in general, we must first create a Discord Bot account.
Creating a Bot account is a pretty straightforward process.
for a discord bot ??
!pypi discord.py
this for making discord bots
thanks
I'm just gonna type nonesense about what I'm doing atm till I reach 50 messages π sorry for any spam
(will be python related)
Trying to make a menu system for a "game template" then work on fixing socketing
socketing as in TCP?
oooo I'm still learning Python I guess xD
its a basic socket package, it allows you to send data over a network
application layer
yeah
128.000.00
@craggy sundial π
my menu system should allow the user to type in a server ip and then broadcast to clients
tbh I'm just rammbling to get 50 messages XD
yeah, I program TCP on different engines, this is just for simplicity
or what I figured was simpler
MMORPGS?? you think?
AHHHHHHHHH okay, I think socket does TCP
I
Anyone know to set up properly stripe web sockets ?
My order is saving different id number in the database
@neon perch π
Hey y'all
this vc filled up
but no one can talk xD
I'm hoping to get voice verified soon
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
I'm starting to think that the vc verification isn't so bad
That's understandable
yeah, no. I understand XD
I just scream louder if they don't shut up
It sucks when bad apples have to spoil it for people who just want to have a normal conversation
it's not bad it's just not good
I am however having trouble aggregating my data into 1 minute intervals with pandas, think you guys could take a look?
people here just seem really calm compared to the people I usually talk to
fo sho
bet
Yep, that's exactly right
It might take me a second to respond through typing
OH also, been trying to use pypy but I can't get pandas to work on it
Would be super rad but I think maybe pandas doesn't work with it?
that's true
I use asyncio to loop
I appreciate the help and what not
though for TCP specifically, I'd probably prefer some higher-level system like websocket or zeromq
I was going between timestamp and datetime object
Cause I have this
# Convert the timestamp into a datetime object with UTC time
timestamp = datetime.utcfromtimestamp(timestamp / 1000)
I should probably post the whole code instead of that little snippet
I will check that out Opal
a little bit
maybe we could use python to filter the music xD
@unique osprey π
I'm American too, I feel it. However I did get plastered one day and learned French. Should have been Python haha
Interesting lives we all live eh
oh god XD
XD
is there a way to keep a while loop going without messing with the rest of the outide code?
I hear you
yeah
Maybe you could multithread?
data, (ip , port)= sock.recvfrom(1024) # buffer size is 1024 bytes
client_no = [ip for i, ip in enumerate(UDP_C_IP) if i == ip]
if client_no > 0:
recvdata[client_no] = data
I need this to run along side pygame
Asyncio sounds right yeah
I don't think so. I believe you need to have all your imports on that file
loop.run_forever()
???
will that run asycronically?
forgive spelling
man I just madde up a word xD
you know what I mean XD
Asynchronously.
hi all π
!stream 1147845388599054418
β @modest condor can now stream until <t:1698242980:f>.
example for TCP
(some time ago was experimenting with asyncio+sockets)
https://gist.github.com/afeistel/3ff7258d8669879f571d0f641a2b9d23
https://gist.github.com/afeistel/8f05ff74b843baebd44fc3f7644ae344
example for s-lang
I found a async' TCP simple config
question: can async functions work on pygame main loop?
will they interefer?
?I mean will I have to async the main loop with the network loop, or can I just have the network loop asynced
it might be a better idea to put async event loop in a separate thread
(which you'd send pygame events to via a queue)
yeah I was thinking something like that, like I'm calling my async events before the main loop
so they don't keep getting initliased
this seems to be an okay example, but it's slightly outdated
https://github.com/AlexElvers/pygame-with-asyncio/blob/master/main.py
outdated in terms of how it interacts with the event loop
get_event_loop is deprecated, iirc
!d asyncio.get_event_loop
asyncio.get_event_loop()```
Get the current event loop.
When called from a coroutine or a callback (e.g. scheduled with call\_soon or similar API), this function will always return the running event loop.
If there is no running event loop set, the function will return the result of the `get_event_loop_policy().get_event_loop()` call.
Because this function has rather complex behavior (especially when custom event loop policies are in use), using the [`get_running_loop()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_running_loop) function is preferred to [`get_event_loop()`](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_event_loop) in coroutines and callbacks.
As noted above, consider using the higher-level [`asyncio.run()`](https://docs.python.org/3/library/asyncio-runner.html#asyncio.run) function, instead of using these lower level functions to manually create and close an event loop.
asyncio.run_coroutine_threadsafe(event_queue.put(event), loop=loop)
asyncio queues aren't guaranteed to be threadsafe
okay so I should use low level sockets?
this also seems to be missing something like .result() at the end
how many messages per second are you going to send?
probably not millions
would the connection be server-client or peer-to-peer?
do you want to have potential for web-compatibility?
p2p
I mean surely its 8 players * 8 possible move * 2 possible functions?
or am I being stupid
you can also abstract that choice away and just make a wrapper around the underlying transport protocol
and choose the protocol later
most of the application shouldn't know that it's working with TCP/ZeroMQ/WebSockets/etc.
I get transport layer
okay
I get ya
sorry
I saw some stuff on asyc about TLP
but just defaulted to TCP
because thats what I'm used too
sorry been coding all day, donnoh if I get or don't get what I'm thinking XD
class EchoServerProtocol(asyncio.Protocol):
def connection_made(self, transport):
peername = transport.get_extra_info('peername')
print('Connection from {}'.format(peername))
self.transport = transport
def data_received(self, data):
message = data.decode()
print('Data received: {!r}'.format(message))
print('Send: {!r}'.format(message))
self.transport.write(data)
print('Close the client socket')
self.transport.close()
# TCP Client
class EchoClientProtocol(asyncio.Protocol):
def __init__(self, message, on_con_lost):
self.message = message
self.on_con_lost = on_con_lost
def connection_made(self, transport):
transport.write(self.message.encode())
print('Data sent: {!r}'.format(self.message))
def data_received(self, data):
print('Data received: {!r}'.format(data.decode()))
def connection_lost(self, exc):
print('The server closed the connection')
self.on_con_lost.set_result(True)```
This is the TCP shit I copied
brb I'm going for a cigarette, maybe relax the mind a little
if you message I'll back track
animation_task = asyncio.ensure_future(animation(screen, ball))
event_task = asyncio.ensure_future(handle_events(event_queue, ball)) ```
this is interesting
it'd be asyncio.create_task now instead of asyncio.ensure_future
and asyncio.to_thread instead of loop.run_in_executor
ahhhh okay thank you
so if I'm right, which I know I'm not. astncio.to_thread to keep pygame "paused" while asyncio.create_task to keep the TCP network running
then I have to translate the messages to what I want in pygame
to_thread is needed because pygame.event.wait() call is blocking
(thread waiting on pygame events can't do much else)
while True:
event = pygame.event.wait()
asyncio.run_coroutine_threadsafe(event_queue.put(event), loop=loop)```
time.time() probably isn't very right too
https://github.com/AlexElvers/pygame-with-asyncio/blob/master/main.py#L41
main.py line 41
last_time, current_time = current_time, time.time()```
in the game it should be time.monotonic() or time.perf_counter()
because time.time() can go backwards or very far forwards suddenly, which is not good here
I actually don't know if this is reliable
https://github.com/AlexElvers/pygame-with-asyncio/blob/master/main.py#L33
main.py line 33
asyncio.run_coroutine_threadsafe(event_queue.put(event), loop=loop)```
i.e. why I said .result() or something similar is needed
in very rare situations, tasks can get dropped by the event loop
which happens because of GC
therefore the program needs to hold onto the task until it's completed
another reason to wait for the run_coroutine_threadsafe to fully complete is to never schedule more than one task to push to the queue
because if the queue does fill up, the solution from the example would run out of memory
sure
I'll share my code in a sec, just debugging
pygame.init()
# Set the width and height of the screen [width, height]
size = (640, 480)
screen = pygame.display.set_mode(size)
screen.fill(WHITE)
pygame.display.set_caption("...My Game...")
# Loop until the user clicks the close button.
done = True
# Used to manage how fast the screen updates
clock = pygame.time.Clock()
#----------------------------------------------------------------------------------------------------------------#
#Objects
#------------------------------------------------------------------------------------------------------------------#
#------------------------------------------------------------------------------------------------------------------#
async def server_main():
# Get a reference to the event loop as we plan to use
# low-level APIs.
loop = asyncio.get_running_loop()
server = await loop.create_server(
lambda: EchoServerProtocol(),
'127.0.0.1', 8888)
async with server:
await server.serve_forever()
async def client_main():
# Get a reference to the event loop as we plan to use
# low-level APIs.
loop = asyncio.get_running_loop()
on_con_lost = loop.create_future()
message = 'Hello World!'
transport, protocol = await loop.create_connection(lambda: EchoClientProtocol(message, on_con_lost),'127.0.0.1', 8888)
# Wait until the protocol signals that the connection
# is lost and close the transport.
try:
await on_con_lost
finally:
transport.close()
#----------------------------------------------------------------------------
#Pygame async ques
#
#
def pygame_event_loop(loop, event_queue):
while True:
event = pygame.event.wait()
asyncio.run_coroutine_threadsafe(event_queue.put(event), loop=loop)
async def handle_events(event_queue):
while done:
event = await event_queue.get()
if event.type == pygame.QUIT:
done = False
break
loop = asyncio.get_event_loop()
event_queue = asyncio.Queue()
pygame_task = asyncio.to_thread(None, pygame_event_loop( loop, event_queue))
event_task = asyncio.create_task(handle_events(event_queue))
try:
loop.run_forever()
except KeyboardInterrupt:
pass
finally:
event_task.cancel()
pygame_task.close()
pygame.quit()```
hello guys im new to coding in python
hey
while True:
event = pygame.event.wait()
asyncio.run_coroutine_threadsafe(event_queue.put(event), loop=loop)```
I think theres something wrong here
the game wont close
pygame_task = asyncio.to_thread(pygame_event_loop, loop, event_queue)
1 sec
!d asyncio.to_thread
coroutine asyncio.to_thread(func, /, *args, **kwargs)```
Asynchronously run function *func* in a separate thread.
Any \*args and \*\*kwargs supplied for this function are directly passed to *func*. Also, the current [`contextvars.Context`](https://docs.python.org/3/library/contextvars.html#contextvars.Context) is propagated, allowing context variables from the event loop thread to be accessed in the separate thread.
Return a coroutine that can be awaited to get the eventual result of *func*.
This coroutine function is primarily intended to be used for executing IO-bound functions/methods that would otherwise block the event loop if they were run in the main thread. For example:
async def main()
loop = asyncio.get_running_loop()
event_queue = asyncio.Queue()
... # do task creation here
if __name__ == "__main__":
asyncio.run(amain())
create_task expects to be called from async context
aahhhhhhhhhhhhhhhh
I made that mistake before
1 sec
runs the game but doesn't close
1 sec I think I know the porblem
yo
black = 0, 0, 0
current_time = 0
while True:
last_time, current_time = current_time, time.time()
await asyncio.sleep(1 / FPS - (current_time - last_time)) # tick
ball.move()
screen.fill(black)
ball.draw(screen)
pygame.display.flip()```
I haven't done the updating XD
Hii @vocal basin
yo
Any good resources suggestion for dynamic programming?
I have not a clue what I'm doing when it comes to programming
what are you learning it for?
for problem solving
I'd expect codeforces after-the-round writeups to be quite useful
(people, often including authors of the problem, publish solutions with explanations)
and any resources for learning apart from practice?
I usually just look up things on case-by-case basis
(never really learned anything like this systematically)
Wikipedia is okay for learning about specific algorithms
(but not for comprehensive studying)
Okay Mate!
you can checkout leet code
Thanks Mate!
whats not working?
hello @warm jay
:incoming_envelope: :ok_hand: applied timeout to @warm jay until <t:1698250941:f> (10 minutes) (reason: newlines spam - sent 188 newlines).
The <@&831776746206265384> have been alerted for review.
what?
lol
that's honestly incredible
!unmute 879612178158714930
:incoming_envelope: :ok_hand: pardoned infraction timeout for @warm jay.
!paste
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.
because you pasted too much code
@warm jay this
well then just read this
#Main input function
while True:
scr.listen()
scr.onkey(q1, "q")
scr.onkey(w1, "w")
scr.onkey(e1, "e")
scr.onkey(r1, "r")
scr.onkey(t1, "t")
scr.onkey(y1, "y")
scr.onkey(u1, "u")
scr.onkey(i1, "i")
scr.onkey(o1, "o")
scr.onkey(p1, "p")
scr.onkey(a1, "a")
scr.onkey(s1, "s")
scr.onkey(d1, "d")
scr.onkey(f1, "f")
if scr.onkey(enter, "Return"):
break
sc1.write(logi, font=('arial-bold', 15, 'normal'))
q1~f1 should probably be dictionary items, not variables
is the program freezing or the whole system?
does the program have any UI?
just the tuertle screen
event handling should probably be in a separate thread
something like this?
https://paste.pythondiscord.com/ZHLA
onkey generally should be called only once, if I understand it correctly
not in a loop
@rugged root I've signed the contract
Rust job might finally pay money
the reason why turtle hangs is:
while True:and code inside it never yields control- event loop is not started properly yet
90% of the time just "reinventing the wheel" but at least I get to learn stuff
this doesnt work
i try to enter hello and get this
yes, because your original code didn't define h and l handlers either
slightly simplified version:
https://paste.pythondiscord.com/DTRQ
@rugged root project
one is done, another in progress
without having to declare a function per each letter
@vocal basin how is your experience with rust? I am planning to learn it
for me, easier to use than any other programming language
apart from compile times being eternity
i dont really get it but ok
just like functions can take other functions as arguments (like onkey method does),
functions can return new functions
borrow checker is almost never an issue, after some practice
there are ways to rarely ever have to deal with lifetimes
quite useful while getting familiar with the language
and then, later on when you decide to optimise it via references, you can relatively easily modify the code
scr.onkey(enter, "Return")
#Move turtle to password place
if ifq == True:
sc1.lt(90)
sc1.fd(50)
scr.listen()
turtle.done()
YAML
when i type up my thing and then display it
XML
my turtle doesnt move
YAML
YMAL
YMAC
YMCA
did you know that Erlang...
C...M...Y...K?
for docs
JSON not allowing trailing commas is painful
just as new JetBrains docs IDE does
but that also has Markdown integration
I also hear that rust doesn't have a Garbage collection.
you can build your own GC
Although I guess:
{ "nothing": "is"
, "stopping":
[ "me"
, "from"
, "writing"
, "a formatter"
, "like this"
]
}
do you know any good resource for gc
I exist π’
lol
lol
To date, still my favorite feature I added to the Python bot
I've somehow grown to tolerate XML config files
C# and Java are too tightly coupled to XML
It's remind me old days of using SOAP
just like Remy formats Rust
https://github.com/ClarkeRemy/kiku/blob/main/src/type_cia.rs
Not familiar with that one
"how hard would it be to rewrite rustfmt to do that?"
I would at least indent them π
That's what irks me about anti-indent folks
You indent anyways for readability???
As in devs who prefer brackets over whitespace sensitivity
That makes more sense
I was trying to figure out what SOUP was
Other than delicious
Seriously, no one programs like this
void a()
{
b();
c();
d();
}
ahh sorry π
put each token in its own column/row so it's easier to parse as a table
struct
Example
{
field
:
Vec
<
String
>
,
other_field
:
HashMap
<
String
,
String
>
,
}
Speaking of whitespace, I remember writing this π
I sometimes format Python like it's Lisp because that's funny
or whatever this is
sum(starmap(lshift,
map(itemgetter(slice(None, None, -1)),
enumerate(reversed(list(map(attrgetter('val'),
takewhile(bool,
accumulate(repeat("next"), getattr, initial=head)))))))))
))))))))) means funny
I haaaaaaate that
Honestly, I forget every once in a while that I can write LISP
Me too!
Granted, it's always cursed things like this:
(defun gotanda-toc-pairs (toc-entries)
(let ((prefix-list nil)
(result-list nil))
(dolist (toc-entry toc-entries)
(let ((level (car toc-entry))
(text (cadr toc-entry)))
(cond
((= level (length prefix-list))
(push (+ 1 (pop prefix-list)) prefix-list))
((> level (length prefix-list))
(while (/= level (length prefix-list))
(push 1 prefix-list)))
((< level (length prefix-list))
(while (/= level (length prefix-list))
(pop prefix-list))
(push (+ 1 (pop prefix-list)) prefix-list)))
(push (list (mapconcat #'int-to-string (reverse prefix-list) ".") text) result-list)))
(reverse result-list)))
(I don't remember writing this ever)
Hey there.
allegedly, it's a solution to this
https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer/
May I ask for tips and tricks?
s = str(input())
k = int(input())
if k >= 0:
print(s * k)
if k < 0:
# (1 / (k * (-1)))
else:
print("Undefined")
So the point of this code is to make a string power. Like 2^2 or root power of 2.
Example
abc^3 = abcabcabc
abc^0 =
abcabc^-1 = abcabc
abcabc^-2 = abc
abcabc^-3 = Undefined
If the part with positive power is simple, the part with root is confusing, any ideas how can I make it work? I tried to use len() function for the string but quickly realized that it does not work as I need.
(k * (-1)) can be replaced with -k
it also should probably be // not /
len(s) // -k then test for validity
@ebon mist you shouldn't
make it modular
reduce imports
it might be a "prelude"
but that's not pythonic
But does't // just devide but unlike % it doesn't leave any remainder?
@rugged root possible but sometimes unidiomatic
where it is normal, is to re-export from submodules into the outer
like how discord.py does
you generally shouldn't do it in a "binary" package, as far as I know
Hey Char
you can put a uniform abstraction around the dependencies
True
Rust's modules is great
to make sure the transitive dependencies work fine
Though I had to unlearn the notion of modules in Haskell
Since in Rust circular dependencies across modules are perfectly fine
can't Rust have that across crates somehow, theoretically?
given cargo can compile different crate versions at the same time
like, crate_a 2.0 depends on crate_b 1.0 which depends on crate_a 1.0
somehow
another reason why re-exports are important
It's kinda better than this, at least
stacked graph I like because I made it
(another commit activity visualisation)
I should publish it
but I'm too lazy
It's pretty at least
22 stage docker build
ab 1 ab
abc 0
abcd 3 abcdabcdabcd
xyzxyz -2 xyz
xyzxyz -3 undefined
xyzxyz -1 xyzxyz
Here is the my input output graph.
The number of unique symbols is not always 3, so len() might not fit as a solution
merge commits are pain for this
because it expects a linear history
I can just ask if s % k > 0, then mar as undefined.
Oh wait...
what is the criterion for valid output?
so I just drop as few changes as possible
hybrid_command
in discord.py
then it's synced
they're both on client and server to some extend
@rugged root iirc, there is a way but it's low-level
To impelment the slash stuff? So the default is just to use hybrid?
I remember this fork https://discord-py-slash-command.readthedocs.io/en/legacy/quickstart.html
i do
I think yes, but not sure
github has commit history
clone, then checkout
yeah you have to checkout
git clone https://github.com/example/example
git log --reverse # See the first one
git checkout <the first entry from git log>
can there be multiple first commits?
or does it always need some common one to merge?
I remember always having to rebase in such situations
click on the commit link you will get the commit history
I wonder how they specify decorator mark in docs
You can't sort the commit history from oldest to newest, though
based on dates you can
you can also best-effort sort topologically
but it will not be perfect, because merges
Decorators
~~~~~~~~~~~
.. autofunction:: discord.app_commands.command
:decorator:
@ebon mist logging probably has support for custom loggers
log in Rust does
and this specifically can be overriden to do network stuff, I guess
https://docs.python.org/3/library/logging.html#logging.Handler.emit
the only good singleton
globals everywhere but it Just Worksβ’οΈ
That reminds me, I should add tracing to my project
I'm gonna need it for performance tracking
!stream 360284932469293056
β @ebon mist can now stream until <t:1698257660:f>.
!stream 737321460435124285
β @flint hill can now stream until <t:1698258294:f>.
why not use interactions-py π¦
why does your ide have spell check on @flint hill lol
Be back on in a sec
Really cool, im sure you know of https://github.com/crate-ci/typos
gtg, catching zs
!stream 373121697957543946
β @wind raptor can now stream until <t:1698258815:f>.
!stream 737321460435124285
β @flint hill can now stream until <t:1698258836:f>.
@flint hill
for x in range(num_count)
compiler
#
# EXERCISE: In spacy_tokenizer, instead of returning the plain text,
# return the lemma_ attribute instead. How do the cosine similarity
# results differ? What if you filter out stop words as well?
#
def new_spacy_tokenizer(doc='', filter=lambda token: True):
return [token.lemma_ for token in nlp(doc) if filter(token)]
vec2 = CountVectorizer(tokenizer=new_spacy_tokenizer, lowercase=False, binary=True)
new_callback = new_spacy_tokenizer(filter=lambda token: not token.is_punct)
vec3 = CountVectorizer(tokenizer=new_callback, lowercase=False, binary=True)
# fit transform corpus
binary_bow2 = vec2.fit_transform(corpus)
sentance2 = vec2.transform(s)
binary_bow3 = vec3.fit_transform(corpus)
sentance3 = vec3.transform(s)
# cosine_similarity increases when we use lemma_
print(f'Using lemma form {cosine_similarity(sentance2, binary_bow2)}')
print(f'Using lemma and filtering out punctuation {cosine_similarity(sentance2, binary_bow3)}')
InvalidParameterError: The 'tokenizer' parameter of CountVectorizer must be a callable or None. Got [] instead.
Can you give the full error and traceback?
!e
from functools import partial
def multiply(x, y):
return x * y
double = partial(multiply, x=2)
print(double(4))
@rugged root :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 7, in <module>
003 | print(double(4))
004 | ^^^^^^^^^
005 | TypeError: multiply() got multiple values for argument 'x'
One sec, screwed it up
!e
from functools import partial
def multiply(x, y):
return x * y
double = partial(multiply, y=2)
print(double(4))
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
8
Double checking I'm thinking of these the right way again
Haven't used them in a hot minute
!e
from functools import partial
def multiply(x, y):
return x * y
double = partial(multiply, 2)
print(double(4))
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
8
@ebon mist try with the yield commented out
are you Steve?
cause you both doing compilers
no?
itertools, functools, collections
!pypi interactions-py
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.
guys look at this class ive been working on
https://paste.pythondiscord.com/UK3Q
do you have any suggestiosn to make it better?
i do programming as a hobyy
@ebon mist idk if its just me but i can barley understand you
@whole bear Yo
@rugged root Hey hey , sorry didn't answer i didn't know i have to voice verify lol
No worries!
Ohh okay okay thank you :>
Yeah it's kinda fun listening to people sometimes when u don't feel like talking but u wanna have company
For sure
/verfy
Got it lol
I wrote couple things asking people for what to do cuz i just started programming
still didn't get the answer i want :').
Just started programming in general or just started with Python?
!resources A Byte of Python
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
mods for what
I started Java in uni i am only first year second semester
And i took a udemy course for python
We've got a bunch of resources on our site. I typically recommend A Byte of Python for folks starting out
Yeah, Byte will be good
It'll help you kind of compare this to that with Java
(Java was also my first language, so I feel your pain)
Ahhh
Ikr it's pain to be ur first π
Aha
:ed29415f44d14b368728552dcaf476bf:
I wanna get a job while studying yk what i mean
For sure
So i asked a lot what should i do to get that but never got a answer
I'll talk to you guys later.
Honestly, I'm not sure about getting a job or making money on the side with programming.
I'm not a programmer by trade, I just do it as a hobby
@fallen laurel Yo
could you help me please
@whole bear what are you coding?
compiler
start: _a
_a: _b
// andop: _b "and" _b
// orop: _b "or" _b
_b: _c (add|sub)*
add: "+" _c
sub: "-" _c
_c: _atom (mul|div|mod)*
mul: "*" _atom
div: "/" _atom
mod: "%" _atom
_atom: NUMBER
so this is the grammar to parse
yes
so this creates a structure which is weird
because
you would expect the tree to look like
add(mul(1, 2), 3)
but because i had to structure the grammar this way to remove ambiuity
its
_a(1, mul(2), add(3))
yea so the underscores were the issue
They don't like the leading underscores?
it removes the intermediate node
previously my grammar was something like this
expr: add | sub | mul
add: expr "+" expr
sub: expr "-" expr
mul: expr "*" expr
which is how i want the tree to look like
but this is ambigious so the shape is random everytime i parse the file
1 + 2 + 3
might get parsed as
add(1, add(2, 3))
or
add(add(1,2),3)
so here we have additional rules
which basically enforce the associativity of the rules
so it makes it impossible for
1 * 2 + 3 to get parsed as mul(1,add(2,3))
because you cannot have a add after the *
according to the grammar
this is alright but the code i had to convert the tree into the compiled output
that will not work anymore as the shape of the tree is changed drastically
I have a terrible idea
non-strictly-ordered operator precedence
def add(self, args: list[Input]):
if type(args[0]) is str and type(args[1]) is str:
try:
return str(number(args[0]) + number(args[1]))
except ValueError:
pass
return Block.from_prototype(reporter_prototypes["add"], args)```
it was straight forward to just pass the two child nodes for this node to the function to compile
match args:
case str(), str():
...
case _:
...
Kaspersky had funny virus alert sound
the only virus i have is systemd
systemstd
the second one
lol
the common joke being "I'm not as afraid of viruses as of this sound"
dont worry child, there is a solution for it
systemv
systempy when
just manually start everything
time to go back to unix
?
but the administration controls when the heating is on
oh you werent the one talking lol
Yeah it's the American (me) being confused
since discord now has on-join soundboard...
@rugged root https://en.wikipedia.org/wiki/District_heating
District heating (also known as heat networks or teleheating) is a system for distributing heat generated in a centralized location through a system of insulated pipes for residential and commercial heating requirements such as space heating and water heating. The heat is often obtained from a cogeneration plant burning fossil fuels or biomass, ...
lol
the discussion has never been more intense
π΅π»
kk
Gotta go practice some πΉ. Cheers π
can i get permition for talking or for speaking in this channel vc
can i get permition for speaking
yes bro
but i cannot talk
i have no permition for talking
ya
ooooo
Hello There
π hey π
Ok, seems like I need to have 50 message to be able to talk
Ok
Is there a talking bot here?
Yeah, just talk your heart out and get involved in the python stuff
yea
Are you more into Java right now or do you keep using Python?
Oh great
Tell me about some projects on AI
Ok, then It bounds the objects
You can create categories for specific situations
Cool
cat
That reminds me of setting delays in Assembler
So, the goal is to set an interruption to the infinite loops where the code will be executed?
Ohhh, now I understand
Oh, so you do the thing frame by frame
Great
Yep, not complicate It that much
Ok
Today I was working on Adjacency matrixes
Yes sir
But I felt like I didn't understand how to use It in Python so I gave It a try
I used Scipy
Damn, I need to learn that
Mr ;
Yep
Dooby dooby doo bop bop
I'm planning on digging deeper into Sci-kit
What would you recommend me to learn first?
As of now, Machine Learning or Data Science
I'll try It
Well, then I'll focus first on Data Science
Ok, so making little predictions with Datasets
Well, If you have a channel share It
Well I have to go. But I will ask you some questions later
Can I send you a friend request?
Ok Numpy
yeah
@white dockπ
yes
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
oh okay
so i was thinking on a python code that can encode stuff
using check digit or smth like that
and like PGN
it will have create a instruction on how to decode it with the right steps
and the decoding method is percedually generated so each time its different
so without the correct decoding method no one can decode it
does that work or is it just too stupid for it to work?
security?
but like does it work?
the thing i was talking about
okay
why?
ohhhhhhhhhhhhhhh okay
does chatgpt help when it comes to this
wwwwwwwwwwwwwwwwwwwwwwwwwwwwww
ok
i see i see
wwwwwwwwwwww
so its just to be used as a guide and not as the main source of information
tbh i remember one time i tried to make it make a procedual generated land in c# aand it just make a inverted land that does nothing
it very complacated
and hard to comprehend
fun fact my pfp is made by perlin noise i created in unity
why?
ah i know
but they reversed their decision didn't they
well its kinda easy to learn there
but like aren't unity basically the only place that uses c#
wwwwwwwwwwwwwwwwwww
tbh is it better to use unreal engine
i see
alright imma go download unreal engine brb
@wooden harness π
Can I join
!voice π
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
π₯² not eligible to get verified for voice chat
This is the associated text channel for the voice chat 0.
So you can still take part.
@gaunt terrace π
Ru in here alot i feel like we've talked b4
Im a big cat guye so biased fs
gotta be spelt Lyte
Lolll
prob
peace decentcolors
whatchu up to rn @somber heath
ah
Im working on a website rn note i have no html css experience lol
Im assuming python is ur goto?
Anything in particular?
Lol nice
Im in a data analytics class where we like train models and stuff
Its pretty cool although i feel like i have nowhere near the amount of programming experience as most in this disc
makes sense
I just got voice verefied but i dont think i can unmtue
hello
just wanted to hear your asmr voice while i learn python
im very new so im trying physics exercices :c
the last one let me show you
`#Gravity Formula
#Fgrav = (Gm1m2)/d2
G=6.67*(10**-11) #Universal Gravitational Constant 6.673 x 10-11 Nm2/kg2[4]
M1=5.98*(1024) #Mass of the object
M2=104 #Mass of the planet
D=6.38*(106) #Distance between the two objects. Object/Center of the planet
Step1=round(M1M2)
Step2=round(Step1G)
Step3=round(D**2)
Step4=round(Step2/Step3)
print(Step4)`
my work doesnt let me practice often :c
i forgot almost 70% of what i learned
brb need to pee
@verbal ocean @tepid plinth π
βοΈ
GUTTENTAG
opps caps lock
nothing feels quite like it when you scream German at 7am in the morning ... and say day instead of morning ¬¬
@deft lodge π
@devout lily π
if ifq == True:
print('HEllo')
sc1.lt(90)
sc1.fd(50)
scr.listen()
turtle.done()
Maybe seeing more of the code will help is understand
ifq = False:
def some_func():
global ifq
ifq = True
def some_other_func():
if ifq == True:
print('HEllo')
sc1.lt(90)
sc1.fd(50)
scr.listen()
turtle.done()
written = False
ifq = False
def enter():
global written
global ifq
ifq = True
if not written:
sc1.write(logi, font=('arial-bold', 15, 'normal'))
written = True
Is that the whole code
not
Can i see all of it
!paste
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.
@whole bear π
π
@iron musk π
@somber heath hello
@umbral glade π
@somber heath hello what spoons??
Spoon theory.
ohj interrestting
@mortal hull π
!voiceπ
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
I get you
do you understand how to use measure.regionprops?
Im having an issue understanding how the function itself works
Scikit thing? No.
hey mate
hi
boys I was told its not only about the number of messages in the server to get voice role
hii
I know I have to be here for more than 3 days
Have you guys ever used fb prophet?
I am working on a trading algo. Probably won't work but it's a fun project.
you can use opencv to detect shapes in the image
https://www.geeksforgeeks.org/how-to-detect-shapes-in-images-in-python-using-opencv/
!e py my_list = [] for letter in 'abc': my_list.append(letter) print(my_list)
@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.
['a', 'b', 'c']
!e py my_list = [letter for letter in 'abc'] print(my_list)
@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.
['a', 'b', 'c']
!e py my_list = [] for letter in 'abc': for number in '123': my_list.append(letter + number) print(my_list)
@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.
['a1', 'a2', 'a3', 'b1', 'b2', 'b3', 'c1', 'c2', 'c3']
!e py my_list = [letter + number for letter in 'abc' for number in '123'] print(my_list)
@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.
['a1', 'a2', 'a3', 'b1', 'b2', 'b3', 'c1', 'c2', 'c3']
Hello Good Peoples!
properties = ['area', 'eccentricity', 'perimeter', 'intensity_mean']
for index in range(1, labels.max()):
label_i = shapes[index].label
contour = measure.find_contours(labels == label_i, 0.5)[0]
y, x = contour.T
hoverinfo = ''
for prop_name in properties:
hoverinfo += f'<b>{prop_name}: {getattr(shapes[index], prop_name):.2f}</b><br>'
fig.add_trace(go.Scatter(
x=x, y=y, name=label_i,
mode='lines', fill='toself', showlegend=False,
hovertemplate=hoverinfo, hoveron='points+fills'))
@mortal hull try above code
Its the same code in the doc
replace fig with y4
largest_area_shape = max([(shape['area'], shape) for shape in shapes])
drawContours takes 3 arguments
!stream 319593254674759681
β @mortal hull can now stream until <t:1698329215:f>.
The Vies Sea.
@violet edge Yo
Hello
Im a newbie and it looks so crazy and then you say "yeah its pretty simple" haha
Well
Bootstrap buttons are an easy asset to use
But understanding what's going on just comes with practice
Lots and lots of it
!pypi python-quickbooks
That was for me, I was just being lazy
Oh my god
Wait what's the file extension for them?
add(3, 2)!
add 3, 2!
(add (3, 2))!
add)3, 2(!
@slender sierra Yo
@dull bay Yo
don't have permission to talk :/
Check out the #voice-verification channel
That'll tell you what you need to know about the voice gate
@whole bear Yo
hi
How's it goin'
Eh, doing alright
how do i get unmuted i have a question
so im trying to run something and at first was there a trace back no modul named packing i pip installed that but now theres this
Traceback (most recent call last):
File "C:\Users\fadec\Downloads\Blank-Grabber-main (1)\Blank-Grabber-main\Blank Grabber\gui.py", line 14, in <module>
from pkg_resources import parse_version
ModuleNotFoundError: No module named 'pkg_resources'
its a error
when i ran it
...
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
..
i think u gto the wrong one
its 100% school projecvt
...
it is
no its not
@rugged root dw its not what u think it is
fr
ok i have a diff question
are u gonna help me with
that?
ye alr
don't blunder 3 mods 
Yeppers


2024mod4 is indeed 0
i dont see no run button
select a interpreter
@severe canyon Yo
its so nice that hemlock greets everyone!
Yoo
@ionic galleon Yo
mhm π€©
hi
Is this the hang out chat or is it for something else?
indeed it is
interesting
Confused when i first saw it lol
ham = [i for i in range(5)]
# that does the same thing as say
spam = []
for i in range(5):
spam.append(i)
more like one liners
Any way to break down the dic comp?
So is it just for loops or can other stuff go inside for list comp?
All good π
meats = ["spam", "pork", "beef"]
meat_dict = {meat: index for index, meat in enumerate(meats)}
# would do the same thing as:
for i, meat in enumerate(meats):
meat_dict[meat] = i
cya! gtg
Been working on a small dnd bot for discord. Kinda fun so far.
I'm not really experienced, only been learning for 3 months. Made it to classes finally. They are amazing
Ikr lol
I used to DM we have a sever setup but don't have time for it anymore. Gave it to my older brother. He just wanted some simple tools to kinds help along with down time stuff like
Hunting - all biomes
Crafting - all items and customs
Fishing - all biomes
Potion crafting - Homebrew
Herb/ Regents Collecting -Homebrew all biomes
Mine - metal all biomes
Chop - wood all biomes
Loot gen for quest Tiers - haven't started
Army Sim- haven't started yet
Town management- haven't started yet
Bout as much as he has planned and worked on so far.
Only been doing embeds no pics yet
π
Lmao
Give me homework teach!
Lol
Any projects you been working on lately?
Lol
How does that even go making a wrapper? Sounds hard
Ohhh
Time does fly when ur in it tbh
Me and my bud make jokes about it alot. Look up 5, work then look up again it's 8
Are u into dnd?
Dm or player?
Pathfinder?
Ohhh lol
Lol
How did ur last sesh play out with ur character
Dude... should get into again lol
You seem like someone who also played Planescape: Torment back in the day
It's on gog
I doubt I can buy games anywhere outside Steam
Lol
Quick quick summary, you wake up on a slab in a morgue with scars carved into your back. You cannot die. You simply wake back up after a while, however with fewer memories than you started with
The Planescape setting is just so great and vast
Interesting
Hope you like THAC0
Yeah lol
There's the older Neverwinter Nights (not the MMO) games and Knights of the Old Republic (again, not the MMO)
Yeah haven't tried that one either
TBH, Mr. Hemlock is the reason I keep coming back here.
They're mid to late 2000's so the graphics aren't amazing. NWN was 3.5ish. Mostly 3.0 rules
I'm glad to hear it
I grew up on those games, still think they are amazing
Not sure if u remember the awesome sword you can find in bg1, really OP. Imoen trying to runa way from her " Heya, it's me Imoen" on loop lol
Yeah yeah
Oh actually, the old Fallout games were very much like that as well
I'm in recovery for games.... My life became unmanageable .
I also have a compulsion to ssh into production. I'm in a group for that.
Yeah true! I have all of them on steam
That's amazing
@pulsar falcon Yo
@rugged root You get on chat regularly?
Also if you ever want to come play txt based dnd in discord let me know. Sandbox westmarch style
I'm usually only on here when I'm at work. When I'm home I focus on home
Only way I can stay sane
Dude I can barely manage this one
Oh no lol
but can hemlock run crysis
I can indeed run and cry, sis
Copythat
I'll catch you on the flip side when I see ya in here again. Feel free to send homework to me π
but can you run and cry, sis 2
Electric Boogaloo
new funky mode
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
@leaden garden
Join the challenge or watch the game here.
Join the challenge or watch the game here.