#voice-chat-text-0
1 messages ยท Page 193 of 1
I think it could be related to my valorant account being hacked and the people using aimbot and wall hacks on it
The reason for that protection is not likely to last forever.
This the blockage will also be likely to be withdrawn in time.
yea ill try again in an hour or so hopefully its fixed by then
It's likely not targeting you, specifically.
You may simply be in the same IP block as an attacker.
what do you mean?
There may have been an attack launched from many different computers in your region.
So Cloudflare goes "Okay, this region gets restrictions."
You'd know.
yea
For Cloudflare, specifically, to get cranky, you wouldn't be "Was it that? Was it this? I don't know."
You'd know.
yea
You'd have been getting up to some deliberate shit, like launching a ddos.
yea Im always careful with that stuff
I doubt Cloudflare gives a shit about aimbots.
It's more concerned about maintaining the road rules, rather than what you get up to at the local sports club.
yea I feel like if I can use my phone it's just a mistake or smth
It won't be a mistake.
what I mean is it wasn't intended for me personally
Yah.
Like the police stopping traffic on a highway and maybe letting some cars through.
That blocked thing is happening to me too ๐ฆ
well at least we know it's definitely now personal
hey where are all the vc nerds
btw block is on non-mobile discord clients and it's cloudflare issue. just update discord and you'll be fine
ayo who got the bamya up in here
Has anyone any tips for how they go about navigating library documentation? When I am trying to find out how a module/library works, I am overwhelmed by both the language they use and how long the documentation usually is. Do you have any ways to speed up the process and find what you're looking for quickly?
I think you're looking for an another channel. This channel only has general talk.
k
# import the pygame module, so you can use it
import pygame
# define a main function
def main():
# initialize the pygame module
pygame.init()
pygame.display.set_caption("minimal program")
# create a surface on screen that has the size of 240 x 180
screen = pygame.display.set_mode((240,180))
# define a variable to control the main loop
running = True
# main loop
while running:
# event handling, gets all event from the event queue
for event in pygame.event.get():
# only do something if the event is of type QUIT
if event.type == pygame.QUIT:
# change the value to False, to exit the main loop
running = False
# run the main function only if this module is executed as the main script
# (if you import this as a module then nothing is executed)
if __name__ == "__main__":
# call the main function
main()
@ebon mist
Not my code
I hade same issue, kill discord using task manager and start it again, it should work
Just gets you set up
thanks
@pale pulsar ๐ณ๏ธโ๐๐
no
๐
๐คจ
Attempt to circumvent filter detected. Moderator team has been alerted.
gg
!e
print("hello")
@robust swift :white_check_mark: Your 3.11 eval job has completed with return code 0.
hello
if x < 0 or x > 10 or y < 0 or y > 0
!e ```py
def clamp(value, lower, upper):
return min(max(lower, value), upper)
for i in range(-5, 6):
print(clamp(i, -3, 3))```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | -3
002 | -3
003 | -3
004 | -2
005 | -1
006 | 0
007 | 1
008 | 2
009 | 3
010 | 3
011 | 3
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/SRP2UBFTRQ43NEBGL3GUTDBHPQ
They have been dealt with ๐
!d numpy.clip
numpy.clip(a, a_min, a_max, out=None, **kwargs)```
Clip (limit) the values in an array.
Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of `[0, 1]` is specified, values smaller than 0 become 0, and values larger than 1 become 1.
Equivalent to but faster than `np.minimum(a_max, np.maximum(a, a_min))`.
No check is performed to ensure `a_min < a_max`.
!e py import numpy as np arr = np.arange(10) print(arr) arr = np.clip(arr, 3, 6) print(arr)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [0 1 2 3 4 5 6 7 8 9]
002 | [3 3 3 3 4 5 6 6 6 6]
1012,300
Here but can't talk
Sup nerds
Yo
Taking wife to the doc
So I'm just sitting here in the waiting room
It might not be looking at the venv install
@oblique ridge bad
Bad yoon
Go to your corner
Fancy
Coding using PowerPoint
I saw the bluetongue and possum face, today.
Daww
Still solo pigeon.
That's sad
Maybe.
Well sad because they're both not like what's up
Yes. There may be eggs/chicks incoming.
Oh, no...
Fuzzywuzzy baked into the interpreter.
Spelled the variable, keyword or filename incorrectly? Who cares?! Our intelligent error-tolerance system gets what you meant!
Dyslexia approved
It doesn't actually correct it in the file.
@crystal fox sup gurl
Bisk in the house!
Classic waiting room
board = [[0 for _ in range(10)] for _ in range(20)]
non-stick pan my ass
hi , where can i code python in this server?
What does that look like to you?
buns of steel
!e py print('You can do this sort of thing in most rooms.')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
You can do this sort of thing in most rooms.
There's streaming opportunities.
!e print(8/2*(2+2))
@reef badger :white_check_mark: Your 3.11 eval job has completed with return code 0.
16.0
what do you guys think of the raspberry pi 5's power button
just unplug it lmao
And if you want to wake it if it's off?
You would deny the magic packet?
Rude
you plug it in lol
Can't if you're in a different state
An intricate and lengthy account of several different computer chess topics from my SIGBOVIK 2019 papers. We conduct a tournament of fools with a pile of different weird chess algorithms, ostensibly to quantify how well my other weird program to play color- and piece-blind chess performs. On the way we "learn" about mirrors, arithmetic encoding,...
nah too lazy
somewhere on the board
wait
ill pull up an image
What do you mean by "code python in this server" ?
IMHO, it's a convenience, but unnecessary
yup
^
normally it will be in a case anyhow
if you geogussr my house you win
it's sitting on the part that should lock the two windows together, but that lock doesn't function
Reaction Time Test: The simple, accurate online reaction time tester.
suggestions on really tiny monitors or screens or anything
New to the channel? Start here: https://www.youtube.com/playlist?list=PLqs5ohhass_STBfubAdle9dsyWrqu6G6r
Special Thanks to:
Mark Govea, Thomas J Miller Jr MD, dedla , Robert Kunz, Saki Comandao, hcblue , John Buchan, Andres Villacres, Christian Cooper, Michael Little, PervertedThomas , Nevin Spoljaric, rictic , Ian , Faust Fairbrook, Jason Le...
I can sell you some bikes maybe
noam are u taking to me
listen so
im learing javascript now
i wanna learn python
i have basics fo python
of
im still learning python too
are u advanced
nah
im pretty good at java script and react
can u share ur course ?
an account
aaaaannnn
im computer science
student btw
second year
aaaaaaaan
im 22
HHHHHHHHHH
its good maaan
but i give uadviceee
learn react and next js
alone
its so easyy
javascipt
is almost like
pythonn
samething almost
about objects and variables
its pretty the same
wish i learned coding
sincee i was 14
u make gameees
with pytthon
Why there are restrictions on voice channel?
@alpine crow
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.11 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.11 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
@whole bear :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | https://paste.pythondiscord.com/HIFIBCOXEWIJR2JQE72EYBUGPY
003 | ^^
004 | SyntaxError: invalid syntax
@wet schooner ๐
was recently experimenting with translating parts of this into Python
https://postcard.jamesmunns.com/wire-format
(some primitive binary format)
varint is what puts it quite far from numpy
all numbers except for u8/i8 are encoded with variable length
(by default)
because it expects small numbers to be more frequent
usize/isize is where numbers are almost always orders of magnitude smaller than the limit
given that on common modern systems it's u64/i64
and that it, when serialized, normally represents count of something
(though that'd still not be enough to count some, even human-made, things)
now I have a question that I doubt I'll find an answer to
"what's the second most produced thing after transistors"
estimates of how many transistors have been produced historically are almost 1000 times what u64 can contain, afaik
so, I only managed to find information on production in Japan:
(annual)
fixed chip resistors: 100~160 billion
fixed ceramic capacitors: 800~1400 billlion
compared to that, transistors are at 20'000 billion
but per second instead of annually
this is also likely influenced by numbers of elements on a die not being that public apart from transistors count
though those are mostly just transistors and diodes
resistors and capacitors might also be useless at that scale, I guess
hey so im trynna work on a code where the /print("example") could come out like letter by letter is there anyway to do that
!d print
print(*objects, sep=' ', end='\n', file=None, flush=False)```
Print *objects* to the text stream *file*, separated by *sep* and followed by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as keyword arguments.
All non-keyword arguments are converted to strings like [`str()`](https://docs.python.org/3/library/stdtypes.html#str) does and written to the stream, separated by *sep* and followed by *end*. Both *sep* and *end* must be strings; they can also be `None`, which means to use the default values. If no *objects* are given, [`print()`](https://docs.python.org/3/library/functions.html#print) will just write *end*.
The *file* argument must be an object with a `write(string)` method; if it is not present or `None`, [`sys.stdout`](https://docs.python.org/3/library/sys.html#sys.stdout) will be used. Since printed arguments are converted to text strings, [`print()`](https://docs.python.org/3/library/functions.html#print) cannot be used with binary mode file objects. For these, use `file.write(...)` instead.
there are many ways to have it printed letter-by-letter even without a loop
how would the letters be separated?
by space? by linebreak? by time delay?
by time delay
i think
like i want to have the window pop up and it would say welcome example and like someone is typing it
are you using any UI frameworks?
@ruby crest ๐
opal and the mutes
kinda like this
like it types it self out
instead of it opening it self at once
heres a better example i guess
drop-in replacement for print
def slow_print(*args, sep=' ', end='\n', file=None, flush=False):
def print_then_wait(c):
print(end=c, file=file, flush=flush)
time.sleep(0.05)
_sep = ''
for arg in args:
print_then_wait(_sep)
_sep = sep
for char in str(arg):
print_then_wait(char)
print_then_wait(end)
Where would you run those 'print'?
i have a window open i can send in the code if you like to see it
sadly, !e can't show the output dynamically
(I was testing in Jupyter where it half-works)
ok ill see if i can fix it
So you want to run in the terminal of your framework?
@vocal basin i kinda fixed the code your were missing the imput
import time
def slow_print(*args, sep=' ', end='\n', file=None, flush=False):
def print_then_wait(c):
print(end=c, file=file, flush=flush)
time.sleep(0.05)
_sep = ''
for arg in args:
print_then_wait(_sep)
_sep = sep
for char in str(arg):
print_then_wait(char)
print_then_wait(end)
ok
(in test case)
ok
even normal print doesn't normally show everything instantly
which is source of some problems, especially in a non-TTY environment
@woeful basalt ๐
Yes
Nice
Ok
So Do You Plan on Making Something on Python
Yes
No Just Asking
I Just Want to Know
Ok
I Want to Start a Project Soon
Ok
I Mean You Don't Need to Write Anything I Just Asked
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Oh hi
I know the criteria I just dont have 50 messages
so Im gonna spam some nonsense
ig
lol
@umbral cape What Program Do You use?
Python
!e py rule = str.maketrans({'a': 'ab', 'b': 'ba'}) text = 'a' for _ in range(8): text = text.translate(rule) print(text)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaababbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababba
@whole bear ๐
๐
YouTuber Corey Schafer. Playlist for Python Beginners.
ignore that message i was trynna see what it is
can't talk yet I have less than 50 messages lol
any channel to mass spam so I can speak
yeah I have been for well over 3 days
Does Anyone Use the Kivy Package in Pycharm?
just bloat some channels then
oh my bad
didn't even know it was possible to install that on windows lol
Yes it Is
You Mean me?
Ok
is there any possible way to to have a pagraph of words to have under slow print
bc i have only two words to use
i get u \
When i Pasted the Code @somber heath I Could not Find the Run Button in Pycharm
Idk Why?
hold on @woeful basalt ill see if i can help
Ok
kivy was the thing for apps right
yeah that would really come in handy for me now
kind enough to drop a link on a tutorial of how to install that
like a youtube video or something
or is it on the ide library
im very new to configuring the interpreter and that type of mechanics
@woeful basalt how long have u been working on python for
oh ok what are your plans to code for
To Make Apps
oh ok im actually working on secrutiy system sort of
Ok Interesting
so if you want to colab lmk
No Need i will watch Tutorials
ok what type of apps are u trying to make
ok
so you would need to build sort of a base of what its suppose to look like so that way python can help
Ok
now I can talk
honestly i dont think python can cover all of things youll need to make an app
wooooo
Maybe with the Package Kivy
maybe like i said im in the region sort of
Ok
Tutorial for Begginers:https://www.youtube.com/watch?v=b093aqAZiPU
In this step-by-step Python for beginners tutorial, learn how you can get started programming in Python. In this video, I assume that you are completely new to programming. We'll walk through how to get Python, how to run your first code, and how to get an IDE (Integrated Development Environment) to help you code faster. You'll also learn about ...
the python video that i used to start learing from is this one
This Python tutorial for beginners show how to get started with Python quickly. Learn to code in 1 hour! Watch this tutorial get started!
๐ฅ Want to master Python? Get my Python mastery course: http://bit.ly/35BLHHP
๐ Subscribe for more Python tutorials like this: https://goo.gl/6PYaGF
๐ Get my FREE Python cheat sheet: http://bit.ly/2Gp80s6
C...
umm @woeful basalt before u go
Yes
aslo if your not chatgpt does help i wouldnt use it for every code incase ur in a bad spot
Ok
!e ```py
class MyInt(int):
def eq(self, _):
return True
v = MyInt(5)
print(v)
print(v == 9001)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 5
002 | True
!e
code
Anyways I am Leaving Now Bye
@timber ore ๐
Welcome@loit
Tks
ok
@jagged hinge ๐
@umbral cape #media-processing message
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
hi
why idont have permission to talk guys
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
yes
cool
were u all from ?
don't mind
cool
i'm brasilian
its like 4 am here
going to sleep in a bit
that's cool
@barren lagoon ๐
i miss python
hii
i'm working with ts, node.js
hey @stark cosmos
lol
hey @formal meteor
hahahhaa
I'm going to sleep guys, see ya
@solar kelp ๐
@obsidian island ๐
๐
import random
import string
def generate_password(length=25):
# Define characters to use in the password (letters and numbers)
characters = string.ascii_letters + string.digits
# Generate a random password with the specified length
password = ''.join(random.choice(characters) for _ in range(length))
return password
Example usage: Generate a random 25-character password with letters and numbers
random_password = generate_password()
print("Random Password:", random_password)
hi @half iris
See: random.choices.
plz help
what happen
Ok
@timber ore
it's been a year daddy
I really really miss you
Mommy said you went to the store to get the milk
anyways
I'm failing all my classes
and Mommy hits me very frequently
and she changed my name too tickle Timpson
anyways Daddy I forgive u for abusing me
pls come back
old is gold for coding
a= int (input())
b= int (input())
c= int (input())
d= a+b+c
e= abc
f=d/e
print (f)
Nevermind
file_output = []
with open('path_and _name_file_input', 'r') as file:
for line in file:
file_output.append(line.strip())
with open('path_and_file_name_output', 'w') as file:
file.writelines(file_output)
i think like this, BUT you need to change the path_and_name_file_input/output
to the name of the input and output file
also the output file must exist before running
check out my answer above
if u do this a lot u can also use out_list = file.read().splitlines()
!doc str.splitlines
str.splitlines(keepends=False)```
Return a list of the lines in the string, breaking at line boundaries. Line breaks are not included in the resulting list unless *keepends* is given and true.
This method splits on the following line boundaries. In particular, the boundaries are a superset of [universal newlines](https://docs.python.org/3/glossary.html#term-universal-newlines)...
its still just a for loop in the background either way
!d shutil.copy
shutil.copy(src, dst, *, follow_symlinks=True)```
Copies the file *src* to the file or directory *dst*. *src* and *dst* should be [path-like objects](https://docs.python.org/3/glossary.html#term-path-like-object) or strings. If *dst* specifies a directory, the file will be copied into *dst* using the base filename from *src*. If *dst* specifies a file that already exists, it will be replaced. Returns the path to the newly created file.
If *follow\_symlinks* is false, and *src* is a symbolic link, *dst* will be created as a symbolic link. If *follow\_symlinks* is true and *src* is a symbolic link, *dst* will be a copy of the file *src* refers to.
[`copy()`](https://docs.python.org/3/library/shutil.html#shutil.copy) copies the file data and the fileโs permission mode (see [`os.chmod()`](https://docs.python.org/3/library/os.html#os.chmod)). Other metadata, like the fileโs creation and modification times, is not preserved. To preserve all file metadata from the original, use [`copy2()`](https://docs.python.org/3/library/shutil.html#shutil.copy2) instead.
I think re-implementing anything like this is generally unnecessary
- there is no need to store lines in a list
if you're doing line-by-line buffering, might as well just write into the output
with open("input.txt", "r") as ifile, open("output.txt", "w") as ofile:
ofile.writelines(ifile)
if for some reason you don't want to use shutil
for small files (where full-file buffering isn't a concern)
opath.write_text(ipath.read_text())
@somber heath
@static rain ๐
hi
@daring swift ๐
๐๐ผ
voiceverify
!voiceverify
@somber heath
help
i cant verify
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
oh okay ty
thank u
oh
yes i will be interesting
i made my own python game, idk if its good its text based. Can you try it?
@golden dragon ๐
@alpine quartz ๐๐ผ
This isn't a meme/video dump channel. ๐
@daring swift hello
can sm help me
I cant speak
can sm help me instlal pygame
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
ok thank you ๐
!pypi pygame
python -m pip install pygame```or a variation thereupon
hru today
I am good hbu?
i am good too, I am currently working on a python game (its text based)
i started python today
nice
noice
so what modules you two know?
or did u guys not touch those yet?
yes
@gleaming dirge hello
๐๐ผ
hi
@somber heath I shall take ur job (am not ai)
is that pygame
yo u from india?
hello, Please give me permission to speak in the voice chat, I cant
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
hi
Okay, I am new to discord to little difficult to understand it all.
Can anyone here help me to get started with Open Source?
yes but i am unable to contribute even though i am good in python
how to get started
youtube videeos are also not helping
Oh!!! No problem.
@karmic obsidian ๐๐ผ
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
hey hi @daring swift
hi
I hv question to y'll
does anyone has any idea about the company called bright data?
it's a company which provides web scraping services
I wanna know how is that legal?
depends on the type of data they arre taking i think
they freakin' hv categories to scrap from
real - estate
e-com
Idk how they are doing it
@crystal summit ๐
so you mean as long as the company doesn't harm the company that it is scraping from...
untill then it's good to go ?
is that what you meant?
Hello brother i am python fascinator and i resenty started programing in python but i am stuckdin logic building can u help me
start with pattern printing
@somber heath thanks Sir.
for your explaination
@wild gull ๐
yeah it's really interesting to see these companies like bright data and oxylabs
openly provide web scraping
services
Yeah I get it
Actually I was thinking of starting something like bright data...
Where ppl could scrap anything ๐
Yeah but with in limits as u said
I hv published a python module to by pass CAPTCHAs and cloud flare
i just use headers idk it works? like for me yes
Actually I was scraping a website which had cloud flare ... So I had to figure it out
Nah i was just doing it for fun...
Then later told the website owner about the bug
Let's see if he rewards me with bounty ๐
Actually it was g2.com
Where ppl write reviews about different software products
yo
@whole bear ๐
@whole bear py import random while True: win_lose = random.choice(['win', 'lose', 'tied']) input('Rock, Paper or Scissors? >') print(f'You {win_lose}!')
A different way of approaching the problem, to be sure.
yeah i didnt know it could be that simple
but
how does it know that rock beats paper etc.
ohh it just knows it already?
wow i actually had to write all these if
yeah indeed.

yeah smarter not harder
i need to fix this mic problem
how did it sound?
missing 'tie'/'draw'
how do i enable it
could you explain more?
rock=0
paper=1
scissors=2
and also
tie=0
win_1=1
win_2=2
given result=choice_1-choice_2
paper-rock=1-0=1=win_1
scissors-rock=1-2=2=win_2
I think
(win_1 and win_2 might be swapped if I made an error)
@still olive ๐
Hello , sadly I dont have the permission to speak yet
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
the problem is that inputs and outputs should be of different types
Yes I need those 50 message but I dont type a lot
but anyway
Anyone working on sth interesting?
well that aint python XD
So I have sth interesting anyone interesting a potential bitshift binary puzzle?
It is something for my uniwork I am hoping to find a pattern in sth but so far no success meaning I just need to use a dict
So I am a physics student( I work as a data scientist in my job but that isnt relevant)
The experiment I am automating is the van der pauw experiment
This means I need to set bit setting of a van der pauwbox which has 10 bits that can be on or off and those make some settings
The van der pauw experiment connects 2 ends together for example R_ac_bd means 1 is connecte with C and 2 with 4
the bits are basically a bitwise or of the 2 resulting bit settings when you turn the bits off or on by the schema in the image
The teacher is a poor programmer so he kinda just assumes you hard code this and loop through the settings manually , well outside of just making a dict of these settings and do a bitwise or to make it already better I hoped to find some logic for example if I encode the letter liek A: 00 , B 01 C 10 D 11 and the resulting settings
I already trained a super easy neural network, hoping to see if that was able to generalize and proof there was a pattern but to not avail , so I am not sure, the settings are limited anyway but you never know :)
anyway if anyone sees a nice pattern to use it might be more interesting to loop through settings that way
I am afraid it is completely arbitrary
so, just labels
Those are the bits you turn of or on
so a setting would be
0 1 0 1 0 0 0 0 0 0 making a complete setting for example RA_C D_C be the bitwise or of that one
As I said it might end being completely arbitrary and there isnt a pattern you can create
2 and 4 are enable din this case, right?
or are those values something else?
I have this so far , meaning right now it is just a dict wich works fine
and yes correct
and yes it is matlab
Sadly I am not allowed to use python
๐
@terse needle Any reason for you to be doing this in C? like you trying to learn this for sth?
something went wrong
I forgot it starts with 1 not 0
!e
data = {
"A": (10, "A", (9, "B", "C")),
"B": (7, (8, "B", "C"), (6, "A", "D")),
"C": (4, (5, "D", "A"), (3, "C", "B")),
"D": (1, (2, "C", "B"), "D"),
}
processed = {}
def process(left: str, value, *, bits=0):
match value:
case str() as right:
processed[left + right] = bits
case int() as index, _ as f, _ as t:
process(left, f, bits=bits)
process(left, t, bits=bits | (1 << (index - 1)))
case _:
raise TypeError
for left, value in data.items():
process(left, value)
for key, bits in processed.items():
print(key, f'{bits:010b}'[::-1])
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | AA 0000000000
002 | AB 0000000001
003 | AC 0000000011
004 | BB 0000000000
005 | BC 0000000100
006 | BA 0000001000
007 | BD 0000011000
008 | CD 0000000000
009 | CA 0000100000
010 | CC 0001000000
011 | CB 0011000000
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/J4WSORGD3X6L6KR42BHEQCJ6DY
I'd do something like this to auto-generate the bitsets per connection
Yes that is so much nicer
Especially cause you encode the logic of the tree instead of just making this dict
Meaning if there are changes to the tree logic you dont need to start manually doing random stuff
to add to the dict
Lemme try and see what you do here
one moment
this can actually be done without mutability in Python, I think
!e
data = {
"A": (10, "A", (9, "B", "C")),
"B": (7, (8, "B", "C"), (6, "A", "D")),
"C": (4, (5, "D", "A"), (3, "C", "B")),
"D": (1, (2, "C", "B"), "D"),
}
def process(left: str, value, *, bits=0):
match value:
case str() as right:
yield left + right, bits
case int() as index, _ as f, _ as t:
yield from process(left, f, bits=bits)
yield from process(left, t, bits=bits | (1 << (index - 1)))
case _:
raise TypeError
def process_all():
for left, value in data.items():
yield from process(left, value)
processed = dict(process_all())
for key, bits in processed.items():
print(key, f'{bits:010b}'[::-1])
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | AA 0000000000
002 | AB 0000000001
003 | AC 0000000011
004 | BB 0000000000
005 | BC 0000000100
006 | BA 0000001000
007 | BD 0000011000
008 | CD 0000000000
009 | CA 0000100000
010 | CC 0001000000
011 | CB 0011000000
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/VCXKP2Q4VOXBJ2ZIBWDKMFIM3E
I do have to use this in matlab in the end , (SADLY cause uni gets money from these fuckers to keep indoctrinating people that matlab is good)
yes I have matlab hate also mostly cause I am just more comfortablel in python and like VS code
BUT
Matlab is slowly allowing VS code support so heey
Anyway yes it should
"software development all across the world has been halted"
translating the first one should be possible as containers.map appears to allow insertion
data.A = {10, 'A', {9, 'B', 'C'}};
data.B = {7, {8, 'B', 'C'}, {6, 'A', 'D'}};
data.C = {4, {5, 'D', 'A'}, {3, 'C', 'B'}};
data.D = {1, {2, 'C', 'B'}, 'D'};
processed = containers.Map;
fields = fieldnames(data);
for i = 1:numel(fields)
field = fields{i};
process(field, data.(field), 0);
end
keys = processed.keys;
for i = 1:numel(keys)
key = keys{i};
bits = processed(key);
disp([key, ' ', dec2bin(bits)]);
end
function process(left, value, bits)
if iscell(value) && length(value) == 3
% It is a cell array of three elements, recurse with updated bits.
index = value{1};
f = value{2};
t = value{3};
process(left, f, bits);
process(left, t, bitset(bits, index));
elseif ischar(value)
% It is a string, process and add to processed.
key = [left, value];
processed(key) = bits;
else
error('Unsupported type');
end
end
This is the chatgpt version seeing if it could directly translate, trying to read in what chatgpt did
function process(left, value, bits)
if iscell(value) && length(value) == 3
index = value{1};
f = value{2};
t = value{3};
process(left, f, bits);
process(left, t, bitset(bits, index));
elseif ischar(value)
key = strcat(left, value);
processed(key) = bits;
else
error('Unsupported type');
end
end
I think it should be strcat because in the original it was str.__add__
dec2bin part is slightly wrong too
data.A = {10, 'A', {9, 'B', 'C'}};
data.B = {7, {8, 'B', 'C'}, {6, 'A', 'D'}};
data.C = {4, {5, 'D', 'A'}, {3, 'C', 'B'}};
data.D = {1, {2, 'C', 'B'}, 'D'};
global processed;
processed = containers.Map;
fields = fieldnames(data);
for i = 1:numel(fields)
field = fields{i};
process(field, data.(field), 0);
end
keys = processed.keys;
for i = 1:numel(keys)
key = keys{i};
bits = processed(key);
disp([key, ' ', dec2bin(bits, 10)]); % ensure 10 bits are displayed
end
function process(left, value, bits)
global processed;
if iscell(value) && length(value) == 3
index = value{1};
f = value{2};
t = value{3};
process(left, f, bits);
bits = bitset(bits, 11 - index, 1); % adjust the index here
process(left, t, bits);
elseif ischar(value)
key = [left, value];
processed(key) = bits;
else
error('Unsupported type');
end
end```
This worked for me so far
does [a, b] concatenate strings too?
The output is:
AA 0000000000
AB 0000000001
AC 0000000011
BA 0000001000
BB 0000000000
BC 0000000100
BD 0000011000
CA 0000100000
CB 0011000000
CC 0001000000
CD 0000000000
DB 0100000000
DC 0000000000
DD 1000000000
Seems so yes
I am a python user so my matlab isnt to the same level
matlab is likely closer to how wolfram works
Okay I got it like this now I guess time if it can be refactored if you see anything that can potentially be done more efficient let me know but already tnx a lot
Much nicer tbf
wolfram is slightly more accessible
sadly, seems to be less widely adopted
https://github.com/WolframResearch/WolframClientForPython
The problem with hard coded dicts is that they are hard to adapt if sth new is made but this is just encoded the tree and traverse
the only thing I am thinking is , can we adapt it so it doesnt actually create a dict still but does the traversal once you give it the settings, not sure if that is a nice idea tho what are your thoughts?
the recursive function can be given a callback argument which does whatever it wants with the left-right-bits record
I'd expect matlab to support higher-order functions
(in programming sense higher-order)
i.e taking functions as arguments
def process(left: str, value, callback, *, bits=0):
match value:
case str() as right:
callback(left, right, bits)
case int() as index, _ as f, _ as t:
process(left, f, callback, bits=bits)
process(left, t, callback, bits=bits | (1 << (index - 1)))
case _:
raise TypeError
Ye I now am at this point:
classdef ExperimentController
properties
calibrator
adc_dac_object
arduino_obj
van_der_pauw_map
end
methods
function obj = ExperimentController(calibrator,adc_dac_object,arduino_obj)
% Constructor to initialize the Calibrator object
obj.calibrator = calibrator;
obj.adc_dac_object = adc_dac_object;
obj.arduino_obj = arduino_obj;
obj.van_der_pauw_map = obj.create_van_der_pauw_map();
end
function obj = set_magnet_field(obj, target)
% This function sets a magnetic field
% The target parameter is in mT
% % The function uses the Calibrator to set the corresponding DAC voltage
dac_voltage = obj.calibrator.gauss_to_dac(target);
obj.adc_dac_object.writeDAC(dac_voltage,1);
end
function obj = set_sample_current(obj,target)
disp("Not implemented yet")
end
function obj = set_van_der_pauw_settings(obj,from_settings,to_settings)
binary_array_from = obj.van_der_pauw_map(from_settings);
binary_array_to = obj.van_der_pauw_map(to_settings);
binary_both = binary_array_from | binary_array_to; %Bitwise OR -> results in the settings for both
disp(binary_both)
binary_list = num2cell(binary_both);
disp(binary_list)
%CaDPiPECommon.CaDPiPE.setPauwChannels(obj.arduino_obj, binary_list{:});
%obj.call_method(binary_both)
end
function van_der_pauw_map = create_van_der_pauw_map(obj)
data.A = {10, 'A', {9, 'B', 'C'}};
data.B = {7, {8, 'B', 'C'}, {6, 'A', 'D'}};
data.C = {4, {5, 'D', 'A'}, {3, 'C', 'B'}};
data.D = {1, {2, 'C', 'B'}, 'D'};
processed = containers.Map;
fields = fieldnames(data);
for i = 1:numel(fields)
field = fields{i};
processed = obj.process(field, data.(field), 0, processed);
end
van_der_pauw_map = processed;
end
function processed = process(obj, left, value, bits, processed)
if iscell(value) && length(value) == 3
index = value{1};
f = value{2};
t = value{3};
processed = obj.process(left, f, bits, processed);
bits = bitset(bits, 11 - index, 1);
processed = obj.process(left, t, bits, processed);
elseif ischar(value)
key = [left, value];
binary_str = dec2bin(bits, 10);
binary_array = binary_str - '0';
processed(key) = binary_array;
else
error('Unsupported type');
end
end
end
end
right now it is pretty nice I needed to do some padding
But ye , this is pretty nice
!e ```python
import random
consonants = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','z']
vowels = ['a','e','i','o','u','y']
word = ''
for i in range(random.randrange(1,10)):
for j in range(random.randrange(1,10)):
word += consonants[random.randrange(len(consonants))]
word += vowels[random.randrange(len(vowels))]
word += ' '
print(word)
@reef badger :white_check_mark: Your 3.11 eval job has completed with return code 0.
hiraqydawuqe vyxe civonomijeroqa lyrefelikoticoleze nenyqejunibuvyvebi
!e ```python
from gpt4all import GPT4All
model = GPT4All("orca-mini-3b.ggmlv3.q4_0.bin")
output = model.generate("The capital of France is ", max_tokens=3)
print(output)
@reef badger :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | from gpt4all import GPT4All
004 | ModuleNotFoundError: No module named 'gpt4all'
@karmic obsidian what the module name
@random talon
<@&831776746206265384> @random talon made extremly racist remarks in vc
Seconded, not a joke.
lliteralllly they are ttrying to get me muted for nothing
now is making homophobic remarks ๐
Again, seconded, not a joke.
@whole bear ๐
@rustic kraken ๐
@onyx wave ๐
@random talon shame
!voice @whole bear
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
im not even listening im just providing context to a conversation im not listening to
i know
i havnt been here for 3+ days
i was on my old account, @unborn sable
@somber heath think you could ask jake for me if force voice verification is a thing? lol
@somber heath Howdy hope your day is going well, I am not in VC
assuming theres a temporary video permission role, is there a temporary speaking.. function? im not sure how to word that
or at least streaming permissions ๐ญ i have code id like opinions on :p
Alex is typing...
How long have you been programming in Python for @tardy sedge?
I'm sure people won't judge your code here ๐
People will sometimes stream here to teach each other stuff.
Oh right nice
Anyway, I just wanted to check in to see what was happening. Gtg ๐
@gilded rose ๐
@whole bear ๐
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@solemn storm ๐
!code
!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.
!or gotcha
When checking if something is equal to one thing or another, you might think that this is possible:
# Incorrect...
if favorite_fruit == 'grapefruit' or 'lemon':
print("That's a weird favorite fruit to have.")
While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.
So, if you want to check if something is equal to one thing or another, there are two common ways:
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")
https://paste.pythondiscord.com/AZ3Q first calculator that ive made
https://paste.pythondiscord.com/A4JQ the update of the first one
https://paste.pythondiscord.com/SLRA current one
@somber heath
where
try:
...
except ValueError:
...```
yea but its my first time ever coding
try:
...
except (ValueError, TypeError):
...```
i went to the university federaation of espirito santo and i learned int str bool float and the mathematical operations
( i live in brasil btw)
and i liked coding so i was so focused i entered their discprd and wanted help with wrong parts of codes
and a guy came to help it was one that made a robot that is a writer and drawer
and then things o=got out of control and it turned to minecraft
but while doing what he said, i learned:
else elif if ifn not and the rest thats in the code im to lazy to list them all
if not condition:
pass
else:
...```instead, consider```py
if condition:
...```
i tried and it didnt work i think
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
abc
if numbers == "leave" or "Leave":
option = input("Do you want to leave?\nY)Yes\nN)No\nY/N:")
if option == "y":
print ("Bye Bye, And Thanks for using my Calculator")
menu = False
if option == "n":
continue ```
btw i need help
when i type in " " (aka nothing) it redirects me to the leave menu
!e py print(True or 'abc')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
!e py if '': print('A')``````py if 'abc': print('B')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
B
!e py if True or 'abc': print('A') if False or 'abc': print('B')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | A
002 | B
why did it do that
@nimble heart ๐
# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
print("That's a weird favorite fruit to have.")
# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
print("That's a weird favorite fruit to have.")```
nooooooow i get it
!e py print(True or 'abc') print(False or 'abc') if True: print('A') if 'abc': print('B')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | True
002 | abc
003 | A
004 | B
ste
@hollow perch ๐
steals ur knowledge KTHXBAIIII runs away
!e
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.11 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
!e
code
stealing my emojis ๐ก
:incoming_envelope: :ok_hand: applied timeout to @solemn igloo until <t:1696128856:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
bru
CodeWarr1or: haha subspace tripmine
o7
hi
@hollow perch :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 8, in <module>
003 | process = subprocess.Popen(['curl', url], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/lang/python/default/lib/python3.11/subprocess.py", line 1026, in __init__
006 | self._execute_child(args, executable, preexec_fn, close_fds,
007 | File "/lang/python/default/lib/python3.11/subprocess.py", line 1950, in _execute_child
008 | raise child_exception_type(errno_num, err_msg, err_filename)
009 | FileNotFoundError: [Errno 2] No such file or directory: 'curl'
!e 3.10 echo "hey"
@hollow perch :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | 3.10 echo "hey"
003 | ^^^^
004 | SyntaxError: invalid syntax
!e 3.20 '' '' ' ' echo "hey"
@hollow perch :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | 3.20 '' '' ' ' echo "hey"
003 | ^^
004 | SyntaxError: invalid syntax
!e 3.9 print("gl")
@hollow perch :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | 3.9 print("gl")
003 | ^^^^^
004 | SyntaxError: invalid syntax
can sm help me
!e 3.9
import socket
def get_webpage(host, port=80, path='/'):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((host, port)) request = f"GET {path} HTTP/1.1\r\nHost: {host}\r\n\r\n" s.send(request.encode()) buffer = [] while True: data = s.recv(1024) if not data: break buffer.append(data) response = b''.join(buffer) print(response.decode(errors='ignore'))get_webpage('www.cheat.sh')
@hollow perch :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | > import socket
003 | ^
004 | SyntaxError: invalid syntax

what
ok
partner pub trade ?
like we pub our server
pub exchange
ih55 members
what is your server theme
okay if you want but i dont have very active users
thats fine i just need a partnership
okay ill add you
k
!d discord.Client.change_presence
await change_presence(*, activity=None, status=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Changes the clientโs presence.
Example
```py
game = discord.Game("with the API")
await client.change_presence(status=discord.Status.idle, activity=game)
``` Changed in version 2.0: Removed the `afk` keyword-only parameter...
yay Rust
yo
@solemn igloo @whole bear u can sell the source code ?
like you sell the bot not hosting
!rule 9 just in case
oh no i dont request to buy we talking about how we can sell discord bots
!rule 1
1. Follow the Python Discord Code of Conduct.
2. Follow the Discord Community Guidelines and Terms of Service.
!rules
The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.
!penis
@whole bear
WHAT!
conv is here
!rule 3
nerd
!rule 30
:x: Invalid rule indices: 30
@solemn igloo !rule
!rules @whole bear
The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.
!rule 3
@somber heath Hey
can you tell me how should i try to learn new modules
like I'm new
to python kinda of jus learnt OOP
@somber heath
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
<@&831776746206265384> deleted messages. Sorry in advance.
need module help
what??
Don't give me that. You know exactly what.
huh
jus block em
bro @whole bear sent them to infront mod no ban so ye
I feel like there is about to be a battle between the VCs
!ban 1126365470166110228 inappropriate gifs.
:incoming_envelope: :ok_hand: applied ban to @solemn igloo permanently.
?
lnkfazfnazlfn
i didnt send him nothing i just met him
@somber heathi did try reading docs tho but still it's hard to comprehand
nice
lmao i didn't notice
no
i think i am
im lame
ok so im not lame
nuts ๐ฆ ๐ฆ ๐ฆ
why?
๐
just thetanos
idk if its same name in english
and idk dont needed the covid vaccin
i think its the same i just understood that because its called the same in hebrew
ohh okay its the same
noice
but instead of writing it like this thetanos we say tetanoos
hey
I am Gonna Finally Voice Verify
!e py for letter in 'abc': print(letter)
@somber heath :white_check_mark: Your 3.11 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)```
!e py for i in range(5): print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
!e py my_set = set('abbccc') for letter in my_set: print(letter) my_set[0]
@somber heath :x: Your 3.11 eval job has completed with return code 1.
001 | c
002 | a
003 | b
004 | Traceback (most recent call last):
005 | File "/home/main.py", line 4, in <module>
006 | my_set[0]
007 | ~~~~~~^^^
008 | TypeError: 'set' object is not subscriptable
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.


