#off-topic-lounge-text
1 messages ยท Page 13 of 1
Then 
wht next
Nothing?
I made minecraft with everything crafting most importatn ores mining some structures health and hunger
sure buddy sure
IN C++
hi
hello
What are you sending???
This is a python chat room
Well i mean it is a lonely server
How to build a nether portal?
ive never seen this
๐๐ฎ๐ต๐ต๐ธ
Hi
!e ```python
""" select this option allows you to checkout """
option = 'info'
100 in 1000:
print("i made so bullshit")
:x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 3
002 | 100 in 1000:
003 | ^
004 | SyntaxError: invalid syntax
hello
!e
zero = 'X' if xState[0] else ('O' if yState[0] else 0)
one = 'X' if xState[1] else ('O' if yState[1] else 0)
two = 'X' if xState[2] else ('O' if yState[2] else 0)
three = 'X' if xState[3] else ('O' if yState[3] else 0)
four = 'X' if xState[4] else ('O' if yState[4] else 0)
fifth = 'X' if xState[5] else ('O' if yState[5] else 0)
sixth = 'X' if xState[6] else ('O' if yState[6] else 0)
seven = 'X' if xState[7] else ('O' if yState[7] else 0)
eight = 'X' if xState[8] else ('O' if yState[8] else 0)
print(f"{zero} | {one} | {two}")
print("--|---|---")
print(f"{three} | {four} | {fifth}")
print("--|---|---")
print(f"{sixth} | {seven} | {eight}")
def checkwin(state):
# All possible winning combinations
win_combinations = [
[0, 1, 2], [3, 4, 5], [6, 7, 8], # Rows
[0, 3, 6], [1, 4, 7], [2, 5, 8], # Columns
[0, 4, 8], [2, 4, 6] # Diagonals
]
# Check if any winning combination is satisfied
for combination in win_combinations:
if state[combination[0]] == 1 and state[combination[1]] == 1 and state[combination[2]] == 1:
return True # A win is found
return False # No winner yet
if __name__ == "__main__":
xState = [0, 0, 0, 0, 0, 0, 0, 0, 0]
yState = [0, 0, 0, 0, 0, 0, 0, 0, 0]
turn = 1 # 1 for X, 0 for O
print("Welcome to Tic Tac Toe!")
while True:
printBoard(xState, yState)
if turn == 1:
print("X's Chance")
else:
print("O's Chance")
try:
# Input from the user
value = int(input("Enter a position (0-8): "))
# Check if the input is valid
if value < 0 or value > 8:
print("Invalid input. Enter a number between 0 and 8.")
continue # Restart the loop
# Check if the position is already taken
if xState[value] or yState[value]:
print("Position already taken. Try another position.")
continue # Restart the loop
# Update the state
if turn == 1:
xState[value] = 1
# Check if X wins
if checkwin(xState):
printBoard(xState, yState)
print("X wins! ๐")
break
else:
yState[value] = 1
# Check if O wins
if checkwin(yState):
printBoard(xState, yState)
print("O wins! ๐")
break
# Switch the turn
turn = 1 - turn # Toggles between 1 (X) and 0 (O)
except ValueError:
print("Invalid input. Please enter a valid number.")
import turtle
import random
turtle.bgcolor('black')
turtle.colormode(255)
x=0
turtle.speed(10000000000)
for x in range(500):
r,b,g=random.randint(0,255),random.randint(0,255),random.randint(0,255)
turtle.pencolor(r,g,b)
turtle.fd(x+50)
turtle.rt(91)
turtle.exitonclick()
:incoming_envelope: :ok_hand: applied timeout to @small dragon until <t:1738015647:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
hello?
!e
amount_x += int(tile == "X")
amount_y += int(tile == "Y")
: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 | amount_x += int(tile == "X")
004 | ^^^^^^^^
005 | NameError: name 'amount_x' is not defined
!e
amount_x = 8
amount_y = 9
tile = "X"
amount_x += int(tile == "X")
amount_y += int(tile == "Y")
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e
amount_x = 8
amount_y = 9
tile = "X"
amount_x += int(tile == "X")
amount_y += int(tile == "Y")
print(amount_x, amount_y)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
9 9
Twst
!e
amount_x = 8
amount_y = 9
tile = "X"
amount_x += int(tile == "X")
amount_y += int(tile == "Y")
print(amount_x, amount_y)
:incoming_envelope: :ok_hand: applied timeout to @radiant ore until <t:1738093777:f> (10 minutes) (reason: emoji spam - sent 27 emojis).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @fair flume until <t:1738094503:f> (10 minutes) (reason: emoji spam - sent 27 emojis).
The <@&831776746206265384> have been alerted for review.
@mellow solar to me just sounds like random noise, not a consistent view of that sort
anyway
back to listening to pain music
for ~300th time
hi there
@mellow solar , I am sorry to hear this. But also, I am very happy to see you thriving and striving.
Two devs that I look up to for are :
https://www.linkedin.com/in/dorota-kozlowska/
https://www.linkedin.com/in/georgiaweidman/
If you like me, has no access to speech. You interact with voice channels with the chats that are under the same name.
siiiiiick
@rich moss is shredding some code in the live-coding chat in a project's been working on.
You can also read it on the github page. It can be definitely be used for games.
ooh that's cool
and my name is actually matthew not kurt lolz
stream i paused
the other letter
haha
idk man i only kknow python
That one is easy, Fortran or Common Lisp.
@twilit quarry React+WASM+Python for peak complexity
u can see my pfp
what can python not do
OS kernels python cannot do
for in-browser you need JS either way
even with WASM, there's still a giant JS compat layer
@fresh sail LLVM rather than target arch assembly directly
ooh good question
WordPress is in a weird state right now
@fresh sail
that's their main product
like I don't remember any other one that associates with DDoS protection as much
that's Lambda alternative
not VPS
as it should be
welp im gonna go now, enjoy your day everyone ๐ ๐ซก
last time I tried calculating Lambda prices for something, the result was:
$0.00
Heroku is hell of a PaaS
and when I removed the free tier, it was $0.02
per month
@twilit quarry not Angular
do not Angular
, would be the advice a few years ago
nowadays they seem to be moving towards modernity they initially pioneered
@twilit quarry just as you say that, I receive a notification because someone is spamming Trump coin scam in telegram...
Imma head out. have a nice one y'all.
Why not import queue but rather deque
deque is short for double-ended queue
whereas queue module is for working with threading
it's unfortunate that it's queue.Queue, it really should've been threading.Queue by analogy with asyncio.Queue and multiprocessing.Queue
!pypi terminal_dungeon
Thatโs means should b threading whereas deque
you can pop and append from both ends
that's why it's named double-ended queue
Ohk thanks a lot ๐
pain
top but h
hraphical
idk
it's colourful version of top
it's not in the container
node casually requesting almost 22G of memory
I need to spam my service with requests to fill up the db
so I also decided to also look at CPU usage
(unrelated to 22G thing)
why does it ever need to page anything out
:incoming_envelope: :ok_hand: applied timeout to @mortal onyx until <t:1738183538:f> (10 minutes) (reason: emoji spam - sent 27 emojis).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @vernal python until <t:1738184872:f> (10 minutes) (reason: emoji spam - sent 27 emojis).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @plain tiger until <t:1738185444:f> (10 minutes) (reason: emoji spam - sent 27 emojis).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @weak robin until <t:1738189269:f> (10 minutes) (reason: emoji spam - sent 27 emojis).
The <@&831776746206265384> have been alerted for review.
and i also didnt know how to how connect the buttons and things to a function
but i made a function that calls two different methods and gave a button that function. Now the first method is supposed to be a toplevelwindow and has a progressbar so its like a loading screen. The second method is just predictions made by AI. But the problem im having is that after the AI finishes all of its predictions does the first method work.
idk why its not starting at the same time
@jagged swallow
become my savior
alright
let me remove some texts since its personal info
also
how do i do that
!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.
do i just paste the link?
alright
thanks
youve developed a game?
thats life
hehe
my bad
huh
damn
can i use english as my second language as an excuse
though i didnt realise i spelled it wrong
though this is also why i wanted to do it by hand
i wanted to learn and actually understand what is going on on screen
i can't share I'm afraid
The button_click4 method performs intensive tasks (like loading a model and processing images) on the main thread, which blocks the GUI. As a result, the progress bar may not update or display correctly.
Use threading to run the processing in a separate thread, allowing the GUI (including the progress bar) to remain responsive.
you lost me
lol sorry
hold on let me search
ohh
portuguese
what four languages
i also speak four
you just gotta expose yourself to the language
damn
@jagged swallow question, so im reading w3schools about threading. Can i just leave button_click4 and bar like they are and put them in the thread? Or do i need to move them outside the class and put them in separate threads. And the threads go in the button_click4 event?
something like this
import threading
def func(self):
threading.Thread(target=self.run_sorting).start()
def run_sorting(self):
self.bar()
self.button_click4()
self.done = "finished"```
customtkinter (ctk.CTk) is built on top of tkinter, and creating multiple Tk instances can lead to unexpected behavior. Using Tk().withdraw() creates a new hidden Tkinter root window every time a folder selection is made.
Instead of creating a new Tk instance, use the already existing CTk instance for file dialogs.
ohhh
optimisation
wait
so i just need to remove the Tk().withdraw() no?
i think i understood
i changed Tk() to self making it self.withdraw()
yep we start with python
and its advertised like that as well
im back
my internet died
@jagged swallow could you explain in a bit more detail what the already existing CTk instance for filedialogs is? i looked it up and i found "filedialog.askopenfilename()", but i didnt quite understand with what i should replace "Tk().withdraw()"
it should look like this
def button_click1(self):
Tk().withdraw()
self.test_folder = filedialog.askdirectory()```
yeah? did that get it in order?
there's still some issues here and there
it's probably not going to 100% function the way you were intending
yep the threading helped
did you also do something like this
def button_click1(self):
self.test_folder = filedialog.askdirectory(master=self)
def button_click2(self):
self.deer_folder = filedialog.askdirectory(master=self)
def button_click3(self):
self.nodeer_folder = filedialog.askdirectory(master=self)```
true but im happy my hardwork helped
ah no. The way you showed before was how i had it
sorry, this is the way it should look
now i just need to add finishing touches and my gorup project is done
Ensure that the progress bar is stopped once processing is complete. This ties back into using threading to allow the GUI to remain responsive.
nah
so where i live we use the dutch education system
in the last year you get a profielwerkstuk
which is just a project done in groups that take up the whole year basically and you choose one of the subjects
my groups chose tech and biology
so we decided to make an AI that recognizes deer
i made a 2d platformer for mine
ah so thats what they are called
thats insane
what inspiration was behind it
i was 18 the judges loved it
hell yeah
my inspiration was "make a game"
i had no idea what i was doing, my game was trash lmao
haha
but it was impressive to the judges
i explained how the code worked and they understood it so they were like ok this guy knows what he's doing
ohh
i dont know if people are gonna understand python
here
though we get to invite people for our presentation
and we intend to enter the national contest(?) from the netherlands
hopefully make it into the top 10
thought there are insane things people have build
re your code: Hardcoding file paths can lead to issues if the path is incorrect or if the code is run on a different machine or operating system.
are you talking about the yolo file?
yep
i plan on making this into an executable and putting the file with it
But you need to reference it using a relative path
i'm sure you can solve that part on your own pretty easily
./[insert filename]
without the brackets
Make sure that the detect_objects function is properly indented within button_click4. Improper indentation can lead to IndentationError or logical errors.
in command prompt?
alright
ill double check
If the user hasn't selected all required folders (test_folder, deer_folder, nodeer_folder), the button_click4 method might fail. Add checks to ensure that all necessary folders are selected before processing begins.
ah yep
forgot about that
i tried that before but i ran into an issue
idk remember what it was
Using shutil.move without checking if the target file already exists can lead to data loss. Handle potential filename conflicts.
hello
The update method is not being called; it's just referenced. This means it won't execute. Add parentheses to call the method.
indeed
@jagged swallow did you go to uni or college?
and did you do computer science
si la computadora
ah
hahah
no codes were hurt
in the making of this gentleman
only thing that was hurt was my ego
ah shit
haha
i dont understand why people take philosophy
i dont understand what the study aims to
think about thinking
i talk to myself sometimes
in my head
to understand the nature of humanity and morality and ethics and the human condition
i see
its like the parental effect of seeing your child get your gift
kryszstof sounds russian or somewhere around ther
you have kids?
i see
dman
damn
you sound wise
fools used to laugh at kings without repercussions
i understand why
thought
though
its more like you
they want to experience something at least once
of ocurse
there are reasons why its not commun
comun
?
how do i spell comun
common
that reminds me of a person i know
alright you guys have any interesting hobbies
running = True
while running
#inster game logic
#insert game over condition
running = False```
@olive swallow
https://youtu.be/FLykV17tILs?si=iBp2NrTxW8JJc87O&t=93
Here I explain how to eke out an easy win in 5D Chess with Multiverse Time Travel
here i explain a finishing move in 5D Chess with Multiverse Time Travel
this looks goofy
i prefer to retain my sanity at the end of tonight
alright
mindbendingly frustrating and terribly fun for my poor brain who can't visualize pieces moving through time and space
why does it look like they are driving the car like they would riding a horse
wait you cant like
imagine things?
well i do have aphantasia but i mean just predicting a move and where a piece will land
if u watch the video it kind of explains what i mean
This is demo video of "The Epic of Goat"
Game made in a week in python using arcade library
by team Pastafobia
Download game (exe)
https://s3.eu-west-2.amazonaws.com/media.pyweek.org/33/meme_py123/v1.1_bin.7z
Pyweek page
https://pyweek.org/e/meme_py123/
Game website
https://mrtanoshii.github.io/PyWeek-33-Metro/#download
my Internet died again
but I think imma leave it like this and go
thanks a lot @jagged swallow for the help
no problem at all my friend
I got help from God
it's all about perspective my friend
:incoming_envelope: :ok_hand: applied timeout to @plucky flower until <t:1738320017:f> (10 minutes) (reason: emoji spam - sent 24 emojis).
The <@&831776746206265384> have been alerted for review.
:ok_hand: applied timeout to @hollow copper until <t:1738387532:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
@hollow copper You will be unable to voice verify for the next 2 weeks because of this spamming.
what he playing
ููุง ุดุจุงุจ
.
.-
-.
?
Lets make a ship toghether!
-------------------
--------__--------_-___-
--____------_--------------------_____-----____
did you like it?
whats this chat for?
hello
:incoming_envelope: :ok_hand: applied timeout to @primal bison until <t:1738979068:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @primal bison until <t:1739065860:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
ููุง
Hi
Here ๐
ok so the main thread is mainly to got user events and updating the ui from like states and stuff, everything else should be on the other threads ?
@buoyant kestrel Down to hang for a bit sir?
@night lily Could you be my rubber ducky for a few moments?
I'm about to leave for dinner.
When I get back?
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.
QUBIT_KEYS = frozenset([
"qubit_index", "control_index", "target_index", "first_qubit_index",
"second_qubit_index", "first_target_index", "second_target_index"
])
QUBIT_LIST_KEYS = frozenset(["qubit_indices", "control_indices", "target_indices"])
ALL_QUBIT_KEYS = QUBIT_KEYS.union(QUBIT_LIST_KEYS)
all fixed
@neon portal Sorted?
Yo
@night lily which looks better?
one only shows the buttons when you hover over it and one shows them all
Oh, from a design perspective. I thought you were referring to the file size.
The righthand.
@night lily show all colors or just when you hover over the specific button does it show the color?
You needn't have the intermediate background behind the icon at all, as a third option.
you mean the shadow?
I mean the shadow.
oh no in the second image the button is being hovered over
As in lefthand and just that.
so this?
I'm not.
I recognise it as a moral failing, but it's one that I grew up with and find delicious.
So I'm at peace with it.
I know.
Left.
so all colors no shadow?
Maybe.
Left.
are you talking about the grey background?
The surrounding intermediary grey. It's square.
ah that
Try removing it and having it as just that.
so dont have a background behind the button when im hovering over it?
I'm looking for projects to do.
!kindling
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
My suggestion is to think of your interests (any fields that you like/are good at) and then come up with a project. The project would then be implemented as a SDK/package which you can publish on pypi.
someone know how to move in terminal linx?
If you need help in projects come
phone_map = {'g': 'ษก', 'สค': 'dอกส', 'สง': 'tอกส'}```
Hey, i've got this problem when i have number that does not match the length of 4 i need to add 0s before it, example input = 1, 12, 132 output = 0004, 0012, 0132 i know there's a str method in python< but i forgot which one solves this issue
ah, it's zfill i remembered
always nice to find a shortcut , efficient piece of code @oak heath
!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.
@craggy rapids Put your code inside the pastebin link.
Nice
@rich moss
[tool.setuptools.package-data]
"batgrl" = ["py.typed"]
@arctic crypt why on earth are you opening your cam with your character on it
Type annotations and runtime checking for shape and dtype of JAX/NumPy/PyTorch/etc. arrays. https://docs.kidger.site/jaxtyping/ - patrick-kidger/jaxtyping
the elasticity of the pixel groups is cool @rich moss
can anyone
:incoming_envelope: :ok_hand: applied timeout to @supple gorge until <t:1740168242:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
@shy geode ๐

hi guys ๐
@agile portal Wanna hang?
i need some help detecting tetronimos im not sure how
Guys some one can help me decompile file?
post
let me try
If really interested in learning cybersecurity Dm
for counter in reversed(range(1, 11)):
print(counter)
time.sleep(1) # wait for 1 second
print("HAPPY NEW YEAR!!!")```
Mini project I just did ๐
Hey guys, so I want to create a hashing algorithm in python. Here's the idea:
It takes a string of characters and then adds 25 characters in between each letter. It could be letters, numbers, or special characters, then it would add that to the output.
Could anyone help me with this and how I could implement this?
maybe use ACSII (and random library if you want it to be random) and function chr()
I am doing something wild and could use a pythonic take
It
Dao approach in python and rust
but I am unsure if I should be building crypto on python whatsoever.
i need a little help from anyone who can code anything please!
sure, what's the problem?
what is the problem?
Please react with โ
to upload your file(s) to our paste bin, which is more accessible for some users.
it is saying unexpected indent
hmmm
I am looking
Hi, I have fixed your code @long wyvern
i also added bg color if you want
Wht up with dut name
?
oh i have a youtube channel under that name
Okayy that's cool
can someone help plz #1347253421358452819 message
Thank may God Bless you :>
Ur Welcome
i tried this a lot of times.
import random
prime_in_lst = []
while True:
to = 1000
randoms = sorted(set([random.randint(0,to) for ran in range(to)]))
def is_prime(num):
if num <= 1:
return False
for i in range(2, int(num ** 0.5) + 1):
if num % i == 0:
return False
return True
i = 0
for ran in randoms:
if is_prime(ran):
i = i + 1
prime_in_lst.append(i)
print(f'{sum(prime_in_lst)/len(prime_in_lst)}/1000')
its always between 105 106 can some one explain why
its test
installing 3.13.2
the output is always arround 106 because the avg number of prime numbers 0-1000 is approximatly 106 ๐
what percent of android phones globally run on android 10 and lower vs android 10 and higher
not just the us and eu
hey hello friends how to get voice permission
:x: Your 3.13 free threaded eval job has completed with return code 1.
001 | File [35m"/home/main.py"[0m, line [35m9[0m
002 | case s if aint.fullmatch(s) [1;31mas[0m m:
003 | [1;31m^^[0m
004 | [1;35mSyntaxError[0m: [35minvalid syntax[0m
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Test
this code just converts my 200k book dataset to 132 books. Is there anything wrong?
Click here to see this code in our pastebin.
def main():
preface()
paycheckfunc()
phonebill()
totalbal()
def totalbal():
Inc = (paycheck)
Exp = (pbillw)
tbal = (Inc - Exp)
print("This is your total balance")
def preface():
print("This will help you calculate your weekly budget")
print("Please use whole numbers, thank you")
#would like to change this but don't know how
print()
def paycheckfunc():
hrs = int(input("How many hours did you work this week?\n"))
mphr = int(input("How much do you get paid per hour?\n"))
paycheck = ((balance + (hrs * mphr)) * .79)
print()
print()
#defeinetly has to be a better way than this to skip lines lol
print("Below is your paycheck for this week")
print()
print(paycheck)
def phonebill():
pbill = int(input("How much is your phone bill on a monthly basis?\n"))
pbillw = print(pbill * .25)
print(pbillw)
main()```
@night lily working on this on the plane of a trip
No need to fix just showing you
It doesn't work currently but I am about to have a 10hr flight of sleep and coding so I think I should be able to fix
man I hate cmake
want to see what i made?
unoptmized code very bad
theres smt called:
if __name__ == "__main__":
it replaces your main function
just do
if __name__ == "__main__":
preface()
paycheckfunc()
phonebill()
totalbal()
in which way is it "unoptimised"?
it isnt c++
what metric are you suggesting to optimise for?
basically it checks on script start if the name is main, because __main__ is the first thing getting called in a py script so it runs that first
__main__ isn't "getting called" when running a script, __main__ is the name the main module gets assigned
@dull anvil do you know what magic methods are?
__main__
is like the main function in rust
its on run
thank you for calling them magic methods and not dunder methods
no
yes
guys is there any better way to log hello world???
b = '////////[|////[|//|///|///|/ยฐยฐยฐยฐยณ]|/|/|ยณ||/[ยฐ]ยฐยณ]||`|ยณยณยณ`///////``///`||`ยฐยณ`ยฐ`///`ยณยณยณยณยณยณ`ยณยณยณยณยณยณยณยณ`||/`|//`'; a:input=input
def outp(x): print(chr(x), end='');
(lambda b, d, inp, outp:(lambda f: f(f, 0, 0))
(lambda f, ip, dp: None if ip < 0 or ip >= len(b) else
f(f, ip + 1, dp + 1) if b[ip] == '|' else
f(f, ip + 1, dp - 1) if b[ip] == 'ยฐ' else
(d.__setitem__(dp, (d[dp] + 1) % 256) and 0) or f(f, ip + 1, dp) if b[ip] == '/' else
(d.__setitem__(dp, d[dp] - 1 if d[dp] > 0 else 255) and 0) or f(f, ip + 1, dp) if b[ip] == 'ยณ' else
(outp(d[dp]) and 0) or f(f, ip + 1, dp) if b[ip] == '`' else
(d.__setitem__(dp, (lambda x: x if 0<=x<=255 else 0)(inp())) and 0) or f(f, ip + 1, dp) if b[ip] == '' else
f(f, (lambda f: f(f, 1, ip + 1))
( lambda f, h, ip: f(f, h + 1, ip + 1) if b[ip] == '[' and h else
f(f, h - 1, ip + 1) if b[ip] == ']' and h else
ip if not h else f(f, h, ip + 1) ),dp) if b[ip] == '[' and d[dp] == 0 else
f(f, (lambda f: f(f, 1, ip - 1))
( lambda f, h, ip: ip if h==1 and b[ip - 1] == '[' else
f(f, h + 1, ip - 1) if b[ip] == '[' else
f(f, h - 1, ip - 1) if b[ip] == ']' else
f(f, h, ip - 1) ),dp) if b[ip] == ']' and d[dp] != 0 else
f(f, ip + 1, dp))) (b, [0] * 30000, lambda: a(''), outp)
are you talking about the __main__ module or things under if __name__ == "__main__":?
main module
ah, I misunderstood that you've changed what you're talking about
did you guys see that chatgpt has its own website type ide
lol
ewww skid
i thought it was cool
ewwwww
thats what they all say
I shall not do the unreasonably elaborate demo of the latter not being first
with __init_subclass__ because that'd be funny
ok
(see the "metric" question)
@frail cloak that is obviously not appropriate
what?
the GIF you had sent
uh?
is this appropriate?
guys why wont it work?
tl;dr: a if b else c
nice
guys does the id() function give me a legal document, so im no immegrant anymore
!warn 1058766073568174231 sending a GIF that directly references suicide and uses homophobic language and then pretending as if you did not do it is not appropriate
:incoming_envelope: :ok_hand: applied warning to @frail cloak.
!d id
id(object)```
Return the โidentityโ of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same [`id()`](https://docs.python.org/3/library/functions.html#id) value.
**CPython implementation detail:** This is the address of the object in memory.
Raises an [auditing event](https://docs.python.org/3/library/sys.html#auditing) `builtins.id` with argument `id`.
f slur is obviously homophobic
fuck?
fuck is not a slur
fingering?
@dull anvil does this work:
print("hello".reverse())
[::-1]
alrighty good job
hi everyone
"I'm scared of where this quiz is going, who knows might be the next question would be Rust-Python integration"
๐ญ
im just checking if u know ur stuff
shit code ๐ญ
what is the purpose of this code?
Respectfully, calling other people code shit is not nice.
@craggy token @frail cloak whoever of you two reacted to the bot's message with the reaction other than checkbox, what was that for?
not me??
hsw "reverse"
I dont know what exactly mean by that?
โโHiโฃโขโคโโโโขโขโโโคโขโขโกโโกโโกโโกโโกโขโโขโโฃโกโโขโโโกโโโโโโโคโกโโขโโคโโขโฃโคโโโโโโขโกโขโโขโโกโโโโโขโกโขโกโโขโโโโขโกโขโกโโขโโโขโโขโขโกโ
Wow coolโขโกโโขโโขโโขโฃโขโกโโกโโกโโโโขโกโขโคโโโโกโขโกโฃโโกโโคโกโขโคโขโขโโขโกโคโโกโโขโกโโคโคโโกโโขโขโโโขโโกโกโขโโขโกโกโโขโโกโโขโกโกโโโขโขโกโโขโโกโกโคโกโคโขโฃโฃโโกโขโโขโขโขโขโกโขโโกโกโขโฃโโกโโขโ
I'm quite sure this is not allowed by the ToS of the captcha service, so please delete this code
โขโโโฃโขโคโขโโคโคโฃโกโขโโโกโขโโโโกโขโกโขโขโขโโกโฃโกโขโขโขโโขโกโโขโขโคโขโกโโขโโขโโคโโโโขโกโโกโฃโโฃโโกโขโกโขโโโโโขโขโโโโขโขโคโโฃโโโโคโโคโกโโคโก
its for educational purposes
this topic is out of scope of this server
thats some type shit
just tryna learn ๐
sir what if i send a mobile reversed yelp credit card logging checker?
(idk who you're talking to, I'm not a sir)
@dull anvil solve this quizz
line 18293
why is there Lisp
lisp or list?
Lisp, as in the family of programming languages
wasm...
thats wasm if your tiny brain couldnt process
ah right
๐ญ
that doesn't answer the question though why is WASM Lisp
!ban 1349815578143100978 I think two GIFs with references to cutting one's wrists is enough
Could not convert "user" into UnambiguousMember or UnambiguousUser.
User "1349815578143100978" not found.
NOOO
lmao
๐
!ban 1058766073568174231 I think two GIFs with references to cutting one's wrists is enough
๐
:incoming_envelope: :ok_hand: applied ban to @frail cloak permanently.
haha
thanks for deleting it so I don't have to ๐
I'm litterally 2 months in as a hobby
how ill do live coding if i cant stream ๐ญ
don't worry about their comment, they were trolling
what...
Can you unmute me @buoyant kestrel
Hello everyone
no
How do fun with Python
Make mini games
Most fun to do Is RPG text based option game
Fundamental are same but you can also practice writing skills
:incoming_envelope: :ok_hand: applied timeout to @copper moon until <t:1742416536:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Is this possible?? Can I make game from python??
How ?? Kindly explain that .
And How I can do if a want to ?
hey man, it is possible, you only have to study. First, learn the basics to have a solid knowledge about the language itself. After that, search about Godot. I am sure that, after u have a basic and solid knowledge about python, u can make incredible games
Yes I know basics of python.. what type of game am I going to build ??
what would you like to make?
The HyperX Cloud Stinger 2 Core is the essential entry-level headset at an affordable price. Featuring 2 years of DTS Headphone:X Spatial Audio, the Cloud Stinger 2 Core delivers great, immersive sound, comfort, and convenience; all the basic things you want from a gaming headset. With audio cont...
@unborn sorrel Do you hear the feedback?
Please respond and text because I can't make a thing of what you're saying due to the feedback loop I'm getting closer
def main():
preface()
paycheckfunc()
phonebill()
totalbal(paycheck)
def preface():
print("This will help you calculate your weekly budget")
print("Please use whole numbers, thank you")
# would like to change this but don't know how
print()
def paycheckfunc():
hrs = int(input("How many hours did you work this week?\n"))
mphr = int(input("How much do you get paid per hour?\n"))
global paycheck
paycheck = round(((balance + (hrs * mphr)) * .79), 2)
print()
print()
# defeinetly has to be a better way than this to skip lines lol
print("Below is your paycheck for this week")
print()
print(paycheck)
def phonebill():
pbill = int(input("How much is your phone bill on a monthly basis?\n"))
print("This is your phone bill on a weekly basis")
pbillw = pbill * .25
print(pbillw)
def totalbal(paycheck):
Inc = (paycheck)
Exp = (pbillw)
tbal = (Inc - Exp)
print("This is your total balance")
main()```
I HAVE NO IDEA WTF I AM DOING AHHHHHHHHHHHHHH
DAMN that looks goodd
bro do you need help?
oh
you ask it in #1035199133436354600
okay lol
apprecatite it
uhm
Yeah it's a pain microphone won't work and it has an echo
BRUH
include <iostream>
#include <vector>
#include <string>
class ModMenu {
public:
void displayMenu() {
std::cout << "Gorilla Tag Mod Menu" << std::endl;
for (const auto& item : menuItems) {
std::cout << item << std::endl;
}
}
void addItem(const std::string& item) {
menuItems.push_back(item);
}
private:
std::vectorstd::string menuItems;
};
int main() {
ModMenu modMenu;
modMenu.addItem("Infinite Jump");
modMenu.addItem("Speed Boost");
modMenu.addItem("No Clip");
modMenu.addItem("Teleportation");
modMenu.addItem("Change Color");
modMenu.addItem("Wall Climb");
modMenu.displayMenu();
return 0;
}
is this for native app
hi does anyone know how i can format python
in discord
Please don't spam your question across multiple channels.
!code
Hi. What do you think about requirements.txt. Is this an outdated approach? It's better yo use something else to make the project look better?
i didn't know that we can use something else
poetry is an alternative.
I made a picture
sup guys
:incoming_envelope: :ok_hand: applied timeout to @raw nimbus until <t:1742906394:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Hello
i like requirements.txt because it feels like package.json which i am very used to
yeah me 2
but i still don't know how to do npm install, or i guess pip install would work
pyproject.toml is closer to package.json than requirements.txt
are the packages automatically written on it?
if you use uv, it's enough to just run, for example, uv add numpy
it adds numpy with its version to pyproject.toml and the whole dependency tree to uv.lock
and installs the package to the venv
creates a venv if it doesn't exist yet
understood, thanks for the clear explanation
DT is a tiny float
dt is time since last frame
DT is literally the delta in the time since hte last run
time_since_last_frame likely needs a += dt
and then check when time_since_last_frame hits the time that you want between frames
then reset it when you swap frames
@neon portal
I imagine FPS is gonna be a high hnumber
so that's not what we want
@neon portal
@neon portal What is the value of FPS
FPS is gonna be a big number, don't want that
30/60
it'll take 30/60 seconds to change the frame that way
1/60
FPS is 1/60?
frames per second
is .016666?
Frames PER second?
you want it to be 1/FPS
Oh, FPS is .01666
odd
that's not correct at all
we want 30 or 60
Frames Per Second
is a value that shoudl mean that
Not Seconds per Frame
If you want it to be 1/60 then call it SPF
half a frame per frame
FPS here I use as in the time per frame.
I was gonna use dt, but you said dt be reserved for update_animation.
if you want to use preferred_frame_duration then do that
but FPS is a thing with a meaning
and you are taking the reciprical of that, and that can cause you issues
if you use this "FPS" where actual FPS are expected
things will be bad
Able to?
Do what?
Collaborative coding.
uh
Hi
kinda
I'm gonna go sleep. I'll cya tomorrow. I wish you a blessed rest of your day good sir.
Take care.
:incoming_envelope: :ok_hand: applied timeout to @hot tundra until <t:1743102720:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Guys as a developer, I need to make sure my backend is powerfull and can handle multiple users at a time
deploying the app with uwsgi will go a long way to ensure worker processes are recycled or respawned and memory usage is capped.
if the user actions are long-lived, using a job/task queue can help alleviate slow response times.
my 2 cents on this.
multiple users at a time -- are you persisting connections? websocket?
or just many requests => high throughput?
:incoming_envelope: :ok_hand: applied timeout to @grizzled radish until <t:1743129952:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
!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.
:incoming_envelope: :ok_hand: applied timeout to @shrewd tartan until <t:1743185011:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
When requesting assistance from other people, it's often good form to begin by explaining what you need help with. #โ๏ฝhow-to-get-help
def bubble_sort(dataList):
lst = dataList.copy() # Avoid modifying the original list
for i in range(len(lst) - 1):
swapped = False # Optimization flag
for j in range(len(lst) - 1 - i):
# Only swap if current element is greater than next
if lst[j] > lst[j + 1]:
lst[j], lst[j + 1] = lst[j + 1], lst[j]
swapped = True
I was looking for a fct that take time but give me a real value so I create the sort on permutation. It will always give me the right answer in O(1) to O(n!) iterations.
py ```
from itertools import permutations
from random import shuffle
def vsortperm(v):
def isSorted(v):
for x,y in zip(v, v[1:]):
if x > y: return False
return True
vc = v[:]
shuffle(vc)
vp = permutations(vc)
for x,xx in enumerate(vp,1):
if isSorted(xx):
return((xx,x,math.factorial(len(vc))))
aa = list(range(5))
a,ax,amax = vsortperm(aa)
print(a)
print(ax)
print(amax)
lol
be aware n! can be a really really big number !
:incoming_envelope: :ok_hand: applied timeout to @sterile furnace until <t:1743363764:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @warm lantern until <t:1743391269:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @warm lantern until <t:1743449333:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @elfin zephyr until <t:1743459813:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @misty niche until <t:1743522530:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
As a developer I have to make sure I get paid enough to do so!
:incoming_envelope: :ok_hand: applied timeout to @thick zealot until <t:1743615313:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @quick solar until <t:1743617369:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @molten saffron until <t:1743709178:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
I do not get paid enough but hey im still "building the resume"
:incoming_envelope: :ok_hand: applied timeout to @primal bison until <t:1743964414:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @boreal ridge until <t:1743970485:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:ok_hand: applied timeout to @slender sonnet until <t:1743970740:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:ok_hand: applied timeout to @coarse arrow until <t:1743970997:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @gilded garnet until <t:1743971408:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @worthy plover until <t:1743971659:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @primal bison until <t:1743971696:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Damn wtf is happening
:incoming_envelope: :ok_hand: applied timeout to @slow oak until <t:1744020047:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
!stream 723163530987044876
โ @cold swan can now stream until <t:1744041792:f>.
is anyone good with linux
for some reason my ubuntu server's wifi netplan is being annoying
the error is something about inconsitant indentation, i cant really install network manager or something else to make the process easier becuse i dont have wifi at all to install those packages
Wait, inconsistent indentation... Is this a python script?
What is the exact error?
then the arrow under the :
check whether you're using tabs or spaces
you should be using two-space indentation without tabs at all
i used spaces i put the stanza manually
another possible reason:
things aren't aligned
can you send the file?
(remove all sensitive info before that)
Make sure everything is aligned and uses 2 space indentation.
wait lemme send it
il show u what i mena
Best picture i can get
Its saying the : on password is wrong
where you have "", it should be "whatever the ssid":
ik
@obtuse canopy Yo
i removed it
oh
access-points:
"ssid":
password: "password"
- add
:after"ssid" acess-pointsaccess-points
il try that
hamSandwich
ham_sandwich
@neon portal Nim, the game, is solved with XOR iirc?
It's still really inconsistent spacing
like you need to keep the XOR of all pile counts at 0
all of this should be 2 or at least stay consistent with 4
ooohh its working
uh its just leaving the terminal input blank
do i reboot it or just wait
interface?
I have the game to be solved by a bot on my TODO fun list (I'm doing Banjo and Raycasting now). My brain has completely garbage collected all data about this.
network interface
i think
I only know the game theory one
with piles of stuff
where if you can't make a move you lose
i really dont know if its worked or not becuse my packages STILL DONT INSTALL
: tell to use vim instead of nano
: tell to use ed instead of nano
does ping work?
if it's available
@neon portal that thing about contravariance coercion was purely about typing not runtime
I understand why all-nighters can be bad now
run ping 1.1.1.1
also during the netplan apply it said a dependicy job didnt work out
I remember, that's for more generic than required one.
learn what contravariance is first
that word combination is not a term
it's just the fact that functions can be coerced
or rather, specifically, function pointers
check logs
did netplan apply again
@buoyant kestrel memory leaks can happen in any language if it allows allocations and lingering pointers
didnt show the error but didnt fix shit
Python, JS, Java, Rust, etc.
maybe idk
You did hear about studying, ye
Mouse wheel?
command history?
Let's not use retarded in that way, please
i mean to see the logs
find a file where it writes them to
I've been doing a lot of work at evening+night for the last ~11 days
(normally it's either evening or night, not consecutively both)
but I didn't really have to learn anything
or design anything
which is also why writing on average 1 line of code per minute (including sleep and eating time) was possible
very straightforward code
just a lot of it
did not work ๐ฅ
made it worse
๐
thankfully I don't have to deal with configuring wi-fi clients at work
@toxic sapphire did you install the OS recently? or a long time ago?
it normally asks you to connect during the installation
did you skip that step?
if you want a pre-configured environment upon installation, then NixOS is unironically a good option;
however I doubt you'd want to have to deal with that
@neon portal in Rust there is normally no Java-like variance (subclassing with distinct types)
instead it's almost exclusively lifetime-related
I see.
coercions of dyn Trait are very recent
So you would subtype sth based on its lifetime in rust?
& 'static T is a subtype of all &'a Ts
I've tested, trait variance does not extend to contravariance when objects are inputs
i.e. it's not really variance
... which is expected kind of
since it's more of a re-unsizing
not variance
Oh no, I just found another weird thing regarding the styling/naming
All of these are the same:
hamSandwich
ham_sandwich
hamsandwich
hAMSANDWICH
haMSanDwICh
It's only the first character that is significant in this case
Sentence_case
curseder_Case
jusT_whY
you can reflect them out
FastAPI
it's amazing how axum achieves similar levels of usability without reflection
sure, it's more explicit, but imo that's better
@mellow solar git reflog
#[derive(TypedPath, Deserialize)]
#[typed_path("/echo/{funny}")]
struct Echo {
funny: String,
}
async fn echo(
Echo { funny }: Echo,
Json(map): Json<BTreeMap<String, String>>,
) -> impl IntoResponse {
(
[("X-Funny-header", funny)],
Json(map),
)
}
and then just .typed_post(echo) on the router
@north pine yo
Hey
typed paths are great when you need multiple methods per path
@leaden pier Also yo
GET POST PUT PATCH DELETE usually
I don't think others commonly make sense implementing
@violet kiln that is very vague
not entirely sure what you even need to do
how does networking/whatever mentioned even relate to cloud there
big part of the cloud is that you don't have to deal with networking/routers/etc.
I guess, Iโm a Spookycake,
Layered in shadows, baked in the ache,
Wonder, what that tastes likeโ
A hint of fear with a dash of spite?
Donโt care, I'm not my chef,
Just the recipe I was left,
Frosted in whispers, sprinkles of doubt,
Served on a platter of what lifeโs about.
Slice me open, see the mess,
But take a bite, Iโll confess,
Iโm just a Spookycake, after all,
Sweet, bitter, and bound to fall.
im looking
wget <url> just downloads the page/file
im going to test it
it doesnt work
hi
what kind of file are you downloading?
.rar
when i use my script it downlaod a 5ko file but mine is 2go
Hi guys!
I searched extensively for my idea but couldn't find anything to write about on YouTube.
So I created a similar idea. I want you to give me the correct way to do it.
For your information, the code works fine and has no errors.
Like i want to get a binary from the internet and run it directly to my pc using python
import ast, requests, os, tempfile, subprocess
from tqdm import tqdm
url = "https://drive.usercontent.google.com/uc?id=1PNJO07Qn5VPupSLik7rysLolqx2B80VJ&authuser=1&export=download"
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
content = b""
with tqdm(total=total_size, unit='B', unit_scale=True, desc="systeminformer installer") as pbar:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
content += chunk
pbar.update(len(chunk))
text_data = content.decode().strip()
binary_data = ast.literal_eval(text_data)
exe_path = os.path.join(tempfile.gettempdir(), "temp_payload.exe")
with open(exe_path, "wb") as f:
f.write(binary_data)
subprocess.Popen([exe_path], shell=True)
Like i want to get a binary from the internet and run it directly to my pc using python
why?
also seems like you should be downloading it from GitHub releases if it is systeminformer indeed
or sourceforge
systeminformer was just an example.
my idea is to update a program from my side
Windows itself has tools for managing software packages nowadays
winget install --id=WinsiderSS.SystemInformer -e
!d io.BytesIO
class io.BytesIO(initial_bytes=b'')```
A binary stream using an in-memory bytes buffer. It inherits from [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase). The buffer is discarded when the [`close()`](https://docs.python.org/3/library/io.html#io.IOBase.close) method is called.
The optional argument *initial\_bytes* is a [bytes-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object) that contains initial data.
[`BytesIO`](https://docs.python.org/3/library/io.html#io.BytesIO) provides or overrides these methods in addition to those from [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase) and [`IOBase`](https://docs.python.org/3/library/io.html#io.IOBase):
using this instead of += on bytes is generally recommended if you ever do tqdm + requests like that
System Informer was just an example, I have another project and I want to update it for users at any time. I don't know what the best way to do this is so I'm wondering
https://cdn.discordapp.com/attachments/1130602202919088158/1358935877723619479/Recording_2025-04-07_154335.mp4?ex=67f5a729&is=67f455a9&hm=e7a429c8cb635d03ccec8971a0baae526eaf4a7a9cdd29a93bac83a0cad6c970&
the first and most important thing: do not use Google Drive for this
if the project is opensource and maintained by someone else, they likely have a GitHub or somewhere else page that hosts binaries
if you want to upload a project you made, then consider using something like GitHub too for hosting binaries, especially if the project is open-source
this also allows you fetch by version
what that provides:
- can check if there are any new versions (and not re-download if it's already the latest version)
- warn on breaking changes (assuming the project follow semver)
- display the changelog (normally part of the release message)
... or just run winget
I made a mod menu for a game and I want to update the functions inside the menu for the users, not downloading files from the internet (I'm sorry I'm bad at explaining)
So you want update automation?
Just make a version.txt to keep track of the latest GitHub release. On startup copy your GitHub repository,you should have the version.txt in that as well, if the version.txt has a different number/hash/whatever from your current version.txt replace your running directory with the repository, else delete temporary repository.
:incoming_envelope: :ok_hand: applied timeout to @uneven grove until <t:1744214410:f> (9 minutes and 59 seconds) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
:incoming_envelope: :ok_hand: applied timeout to @tribal meadow until <t:1744232489:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
@neon portal what is the difference between those two ints?
@neon portal what are we indexing into?
@neon portal third item of the tuple?
@neon portal is anything outside the specified range used?
@neon portal consider using numpy arrays with objects as items and just pass those around
@neon portal marshalling/unmarshalling?
@neon portal marshalling is very specifically involving references not just values (as opposed to serialisation)
so you can apply similar techniques
i.e. instead of storing the reference, store the index in the flatten structure
so you need to somehow reverse-engineer the tag generation, right?
@neon portal I'm going to the other VC
Thank you so much, you gave me an idea to do it a bit more elegantly.
@dull anvil Finished. Thank you again.
@dull anvil I did it like this.
circuit = qtn.Circuit(N=mps.num_sites)
gate_tracker: list[str] = []
for i, unitary_layer in enumerate(unitary_layers):
for j, (start_index, end_index, unitary_block) in enumerate(unitary_layer):
for index in range(start_index, end_index + 1):
unitary = unitary_block[index].data
# MSB convention
if index == end_index:
circuit.apply_gate_raw(
unitary.reshape(2, 2),
where=[index]
)
else:
circuit.apply_gate_raw(
unitary.reshape(2, 2, 2, 2),
where=[index, index + 1]
)
# Add the gate to the tracker
gate_tracker.append(f"{i}_{j}_{index}")
tensor_network = qtn.TensorNetwork(circuit.psi)
# We do not want to include the qubits, so we will
# excplitily control the iteration index
gate_index = 0
for gate in tensor_network:
# We only update the gates, not the qubits
if "PSI0" in gate.tags:
continue
# Remove existing tags from the gate
gate.drop_tags(tags=gate.tags)
# Marshal the gate with the gate tracker
# This is needed to ensure the gates are properly tagged
# for updating the unitary layers
gate.add_tag(gate_tracker[gate_index])
gate_index += 1
:incoming_envelope: :ok_hand: applied timeout to @rugged canyon until <t:1744391545:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
@night lily
def preface():
print("This program will ask you some basic questions")
print("Please use whole numbers, thank you\n")
def paycheck1():
hrs = float(input("How many hours did you work this week?\n"))
mphr = float(input("How much do you get paid per hour?\n"))
gross_pay = hrs * mphr
net_pay = round((gross_pay * .79), 2)
return net_pay
def main():
preface()
paycheck = paycheck1()
print("Below is your paycheck for this week:\n",paycheck, sep="")
main()```
got something working
took a long time because I have been working nonstop
I am going to go back and add phone bill and other things to it but it's WORKING !!!!
Also I asked chat gpt for help and it did but it ended giving me a bug lol
had to figure that out
Hello
:incoming_envelope: :ok_hand: applied timeout to @wild wadi until <t:1744465107:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.