#voice-chat-text-0
1 messages Β· Page 346 of 1
LOL
men ngl
i just wanna
touch em toes
NAH
baegel
bae
bagel
NOT BAG
BAGEL
haggle for a baggle?
when the 2 g's?
bagel
or am i dumb?
ngl if yall want
a strong bagel
both π
u see
NOpe
NGL best variabel to use
ez to understand u know
Variable.
π
tnx for the correction π
ye
YEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
i used ctrl + c
me at night
oh nah
i was chill with it
i didnt mind tbh
NAHHHHHHHHHHHH
SHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
BOI STOP
π
@somber heath help me with this
@acoustic storm π
#coinflip
#
import random
Coin = True
TF =True
Sides =["heads", "tails"]
#Randomness
AI = random.choice(Sides)
AI = AI.lower()
#guesses
guess = input("Heads or Tails \n")
guess = guess.lower()
#checking answer
if guess == AI:
print("AYE!! You where correct.")
elif guess != AI:
print("Sadly you where wrong.")
#again?
while TF == True:
check = input("would you like to try again? (yes or no): ").lower()
if check == "yes":
TF = False
elif check == "no":
print ("Np let I (lotus.AI) termiate the code.")
exit()
else:
print ("invalid syntax, try again")
Lotus = AI
del AI
#game loop
while Coin == True:
AI = random.choice(Sides)
AI = AI.lower()
guess = input("Heads or Tails \n")
guess = guess.lower()
if guess == AI:
print("AYE!! You where correct.")
else:
print("Sadly you where wrong.")
check = input("would you like to try again? (yes or no): ").lower()
if check == "yes":
continue
elif check == "no":
print ("Np let I (lotus.AI) termiate the code.")
exit()
else:
print ("invalid syntax, try again")
Lotus = AI
del AI
print("ight!")
is it good
or nah
@primal shadow what funny huh
ight
Just thinking it was a combination of both prior comments. I quite love autoformatters
and the problem list from the extensions to clean up the nits
where -> were
ummmm
like
def main():
ye
i have
but
i gave it up
i tried
using it in another code
whats going on?
just chilling
and coding
stuff
@peak depot welcome back
@somber heath ye id also wipe it all away
yes sit
sir*
ight bet
ima re write it
back
this is good?
oh
tnx man
true
true
!code
@errant laurel π
@pine token hiy
contrasiv learning?
#media-processing message @whole bear
huh
Need 50 chats to unmute
import random
sides = ["heads", "tails"]
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("You win!")
else:
print("You lose!")
choice = input("Would you like to play again? (yes or no) \n").lower()
while True:
ai = random.choice(sides)
guess = input("Pick Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
else:
while choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
else:
break
Restructuring can also be done by python?
is the code correct?
Destructuring rather
I've been enjoying Arc
!e
ab = 1, 2
print(ab)
a, b = ab
print(a, b)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | (1, 2)
002 | 1 2
yo
@somber heath i finished the code
import random
sides = ["heads", "tails"]
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("You win! the answer was "+ai)
else:
print("You lose! the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
while True:
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
if choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
if choice in ["no", "yes"]:
continue
still long
ight
lemme try
AHHHHHHHHHHHH
dang
tnx man
true
lol
import random
sides = ["heads", "tails"]
ai = random.choice(sides)
while True:
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
if choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
break
if choice in ["no", "yes"]:
continue
damn code looks smaller
@somber heath tnx man
one while loop ow
damn
also @somber heath quick question is there anyway for me to do the
if choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
break
if choice in ["no", "yes"]:
continue
its in the while loop
i should make another?
@somber heath so smthing like dis?
import random
sides = ["heads", "tails"]
ai = random.choice(sides)
while True:
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
while choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
break
π
say it again
oh
EXPLAINS
import random
sides = ["heads", "tails"]
ai = random.choice(sides)
while True:
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
while choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
break
if choice == "no":
break
```py
i think ik the fix tho
@somber heath
what about this?
import random
while True:
sides = ["heads", " tails"]
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
while choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
else:
break
choice = input("Would you like to play again? (yes or no) \n").lower()
while choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
break
if choice == "no":
break
get rid of that space before tails
tnx
alright
i made another adjustment
import random
while True:
sides = ["heads", " tails"]
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
while choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
if choice == "yes":
continue
elif choice == "no":
break
idk
if this will work
but it looks like it should tho
ight
oh
what if i put exit()?
for elif choice=="no"?
use else instead of if here ig and remove the choice == "yes" part
import random
def heads_or_tails():
sides = ["heads", "tails"]
ai = random.choice(sides)
while True:
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
while guess not in sides:
print("there seem to be a mistake pls type heads or tails")
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
while choice not in ["no", "yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower
if choice == "no":
return
heads_or_tails()
Bye @somber heath π
import random
play_again_prompt = False
sides = ["heads", " tails"]
while True:
if play_again_prompt:
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
elif choice == "yes":
play_again_prompt = False
else:
print ("there seem to be a mistake pls type yes or no")
else:
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
play_again_prompt = True
BACK
"there seem to be a mistake pls type yes or no" - evil
can you show your code now?
aight
give me a sec
import random
while True:
sides = ["heads", " tails"]
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
if choice not in["no" or"yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
else:
continue
ight back
still tails have space in start
oops
bruhe
import random
while True:
sides = ["heads", "tails"]
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
if choice not in["no","yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
else:
continue
there current code
can someone do smhting man?
how to share screen?
you can ask mindful dev for permission
@wind raptor hi can i pls have share screen perms?
import random
while True:
sides = ["heads", "tails"]
ai = random.choice(sides)
guess = input("Heads or Tails: ").lower()
if guess == ai:
print("you win the answer was", ai)
else:
print("you lose the answer was", ai)
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
break
if choice == "yes":
continue
while choice not in["no","yes"]:
print ("there seem to be a mistake pls type yes or no")
choice = input("Would you like to play again? (yes or no) \n").lower()
if choice == "no":
exit()
elif choice == "yes":
continue
fixed the code π
nah
College/University.
High school
!stream 890643057274396772
β @pine token can now stream until <t:1724513980:f>.
YESSSSSSSSSSSSSSSSSS
HEHEHE
i will use this power very responsibly
@upper basin you are still streaming btw
It's temporary. Just remember you are responsible for everything that appears on your stream.
yes sir
i understand
and will be very careful
DAMN
in the next minute i can no longer stream
that stings
@undone bane Damn thats college knowledge π
for 1 minute huh
@wind raptor The calculator I made was hard coded. Now I want to change the code so it's not hard coded but I don't know how can I do that? Can you give me a idea?
okay.
@pine token can't stream, dw.
wut did u think when i came to the vc?
i was trying to use that ! stream command
got no prompt from the bot.
only admins can give
@undone bane damn same here
You should leave it and do your work because you will not understand the code
this is the output if you want to see
Brb.
Yep
dng bro how long u been coding btw?
That's what I thought before doing this
dang
2-3 months
can u recommend me stufff
?
to be better at pyhton?
@undone bane yee
u didnt responed
to ONE
np
I am not good at python not that good
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
I think you mean 6.0001.
damn π
6.0001 Introduction to Computer Science and Programming in Python is intended for students with little or no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems and to help students, regardless of their major, feel justifiably confident of their ability to write small p...
Try this one.
Sorry, I missed that. What do you mean it's hard-coded?
6.0002 is the continuation with focus on some applications of python.
I'd also suggest having a look at any 6 courses (6 prefix is for EECS department).
Greetings LX.
send links PLS
I did.
I remember berkeley took down some of their lectures due to accessibility requirements or something
i saw
Above.
https://paste.pythondiscord.com/37IQ Look you will understand what I mean
Ok, you're not talking to me. My bad.
i am
i checked it
ive alr like
covered that
or no
im gonna check it again
tnx @upper basin
@undone bane u havent answered the question what can python do ? like what can u make ?
Everything
@undone bane so can i make websites and apps with python?
damn
question
html css and js > python ?
in web dev?
can u show me an example of a python app?
ill brb
I have a question i have a class in a dir core.error_handling.error_logger but when i add it to main with this line from error_handling.error_logger import ErrorHandling im getting the error that its not there but when i click for example on error_logger or ErrorHandler i co to the class how is that possible im using VSCode
true
π
np
i will π
sadk?
mhh
Chicken ~_~
dc servers arent good
c
vc in particular
based?
oh me
im strasburg
You're not from Australia though, right?
strasburg france
I see.
@upper basin wbu?
Earth.
Shouldn't be.
Rotterdam is the middle ground.
@undone bane Did you do your bachelors in US?
Did you move to US for your bachelors or were you there before that?
Didn't hear that at all. It was all lag.
You came to US when you were 5?
Oh nice.
So, basically grew up the american way?
How much did your bachelors cost by the way? I've been a bit terrified of the costs over there.
Masters around 60k mostly.
Nice.
Wow.
120K annual income is not low.
It's higher than avg in fact.
Wow.
Which university is that if you don't mind me asking.
looks like ill be attending free
I may apply to it. Is the policy same for international students too? Probably not.
Ohh I see.
my dream college
What was your HS like then? You made me curious hehe.
Did you do any olympiads, tournaments, etc?
AIME I remember.
What would you say were the highlight of your application?
Olympiad ?
Academic tournament on a national or international level.
Mostly national.
import gleam/http/request
import gleam/httpc
import gleam/result
pub fn get_product_info(slug: String) {
let assert Ok(req) =
request.to("https://www.wholefoodsmarket.com/api/product/" <> slug)
use resp <- result.try(httpc.send(req))
Ok(resp)
}
yo
here look at my code
# ClickArrowDraw.py
import turtle
t = turtle.Pen()
t.speed(0)
t.turtlesize(2,2,2)
turtle.bgcolor("black")
t.pencolor("yellow")
def up():
t.forward(50)
def left():
t.left(45)
def right():
t.right(45)
def move(x,y):
t.penup()
t.setpos(x,y)
t.pendown()
def thicker():
t.width( t.width() + 2 )
def thinner():
t.width( t.width() - 2 )
turtle.onkeypress(up, "w")
turtle.onkeypress(left, "a")
turtle.onkeypress(right, "d")
turtle.onkeypress(thicker, "e")
turtle.onkeypress(thinner, "q")
turtle.listen()
turtle.onscreenclick(move)
i aint random
i left to go buy pizza π
wut do u want me to do?
ask youtube?
YES @undone frost
I'm gonna hop off. It's late. Wish everyone a blessed weekend.
pub fn get_product_info(slug: String) -> Result(http.Response, httpc.Error) {
let req_result = request.to("https://www.wholefoodsmarket.com/api/product/" <> slug)
case req_result {
Ok(req) ->
result.try(httpc.send(req))
Error(err) ->
Error(err)
}
}
wsp
Good hbu?
Hey @somber heath, while explaining the problem we were discussing earlier, specifically while explaining that the threading method did not work since the inspect.stack() call simply returned the stack for that thread instead of the complete program, I had the idea of reading the stack in the global scope of the module and then reading from that stack inside of the thread instead of calling the inspect.stack() method directly inside of the thread. Naturally, this worked
import inspect
import time
import os
from threading import Thread
class AutoStart: pass
stacks = inspect.stack()
def test():
global stacks
time.sleep(1)
for frame in stacks:
if os.path.basename(__file__) in frame.filename:
# exclude occurrences of AutoStart in this file (stack)
continue
if "AutoStart" in frame.frame.f_globals.keys():
if frame.frame.f_globals["AutoStart"] is AutoStart:
# there seems to be 2 stacks with the same globals,
# so in my case the code here gets run twice
print("Auto starting...")
return
Thread(target=test).start()
True love's kiss.
Something to remember for later.
Absolutely
First time I'm having to check if __name__ != "__main__" haha
I guess I don't really need to since I already exclude occurrences in itself though...
I made some very weird CSS thing
(and it's probably wrong)
@wind raptor idk if my discord is broken, but I can't hear anything
I needed to fill a div with many square divs
seems like it worked
idk if there's a proper way to do this
the difficulty there is that it's mathematically non-trivial
so ig that's why browser doesn't provide a built-in way to do that
afaik
JS is less instant in how it applies sometimes
yes
otherwise it looks bad
I need a grid to show statuses (single colour) of instances of processes/services/whatever
this was taken from some stackoverflow answer
@property --100vw {
syntax: "<length>";
initial-value: 0px;
inherits: false;
}
@property --100vh {
syntax: "<length>";
initial-value: 0px;
inherits: false;
}
and this is weird maths stuff
||```css
.container {
display: grid;
--100vw: 100vw;
--100vh: 100vh;
--r: tan(atan2(var(--100vh), var(--100vw)));
--x1: round(up, sqrt(var(--n) / var(--r)));
--d: max(0, round(up, round(up, var(--n) / var(--x1)) - var(--x1) * var(--r)));
--x2: var(--x1) + var(--d); /* sometimes x1 is off by one */
grid-template-columns: repeat(calc(var(--x2)), 1fr);
}
(those two used together)
thing referenced in the comment is purely empirical, idk the underlying reason
I think I did that same derivation a long time ago
but I don't remember what for
task: fill thing like this given fixed number of cells and fixed outer bounds
(maximise used space with cells of same size)
that bit can stay
so, rather, for easier version just have it filled horizontally on all rows except last
and maximise the number of rows
fitting either horizontally or vertically depending on what fits more is more difficult
Is there no divmod equivalent in the language?
round(down, x / y)
the subtask is to find how many columns there are
to shove into grid-template-columns
there, proportions are expected to closer to this
i.e. filled-in fully along the smaller side
otherwise it'll look very not okay
the math is quite straightforward
the only "smart" part is +1 hack
I was considering making 32-levels-deep or whatever approximation, effectively doing a binary search, but found a simpler way
also calc has no if which makes binary search a bit harder
(only a bit, lack of if only means no short-circuit; after-the-computations switching works just fine)
and there's also an option to do that with @media
And I want to make some improvements.
what about flux @wind raptor
you were talking about which image generation model to use right?
Ohh I see
also you got the invite right?
IM BACK BABAY
THANK U
quick question
import random
def country():
c_score = 0
print("Welcome to country quiz")
letter = []
for x in range(3):
country = input("alrighty name 3 countries that start with the letter 'C' (one at a time) \n").lower()
letter.append(country)
print(letter)
if country [0] != "c":
print ("Wrong")
else:
print ("correct")
c_score += 1
print("your score for country quiz is: \n", c_score)
def math():
m_score = 0
print("Welcome to math quiz")
questions = ["What is the square root of 100\n", "What is 2 + 3 x 4\n ", "what is 9 x 9\n"]
answers = ["10", "14", "81"]
for i , questions in enumerate(questions):
print(questions)
answer = input("answer: ")
if answer == answers[i]:
print("correct")
m_score += 1
else:
print ("wrong")
print ("your score for math quiz is:", m_score)
choice = input("Welcome to the ultimate quiz platform choose between(math and country) (if both type m and c , or c and m): ").lower()
while True :
if choice == "math":
m_score = math()
break
elif choice == "country":
c_score = country()
break
elif choice == "m and c" or "c and m":
m_score = math()
c_score = country()
print ("your total score is the addition of both")
break
else:
print("invalid choice")
exit()
is this correcr?
Can someone help me with pyperclip
i installed it normally. pip install pyperclip
then i use import pyperclip
but Module not found
According to their https://pypi.org/project/pyperclip/#description
Otherwise restart the active window and see if that resolves the import issue
ive restarted already four times
ive tried to install it via powershell and moved to the appdata directory with cd
iv etried to run powershell as an admin
Traceback (most recent call last):
File "L:\pycharmprojects\PasswordManagerGUI\main.py", line 4, in <module>
import pyperclip
ModuleNotFoundError: No module named 'pyperclip'
pip install pyperclip
i ve installed it
can try this but i think the issue is related to the python directories you may have set up
pip install --user pyperclip
Hmm
i tried to use python3.8(using.12 usually)
omg idk why but i had to install it in the intepreter settings too :dumbmeeee:
You're using a virtual environment?
hello, this doesnt work because any word starting with a C will be considered correct, you have to make a dictionary of all the countries, and then when the players enter their, guess compare against all countries that start with a C(you will have to add more error detection, for example typos and stuff)
also you should separate the quizzes into classes, for neater and easier implementation of more complex quizzes
Yo would any one have an idea about 3d rendering
Iβm new to Python just came from the cs50 introduction
Uh
dont use python for 3d rendering, lol
is it imposable
cus im trying to study
i thoght it would be a good test
you'll need to use bindings to libraries written in C/whatever else
so technically possible
anything is possible, i mean there are better frameworks on other languages to make 3d renders which you should probably use
yo I figured out how to get access to the MIT fundamentals of programming class
nah i wrote a 3d engine in python using pygame lol
yeh tru
however the actual 3d rendering part i wrote myself in python, but id still recommend using JS or C++ for that
go to https://py.mit.edu/spring18/labs/lab1
you can click at the top labs-> lab # to access the hw
lotta the links are broken but play around with changing the link between /spring#/ and /fall#/ of various years to see what's you can still access
EDIT: looks like spring 19 works better (https://py.mit.edu/spring19/)
what im trying to do is actuly make a game of some sorts where i make every thing
i thoght start with the 3D render
is good
then try three.js and html/css or use OpenGL or vulkan or some sort of library for c++ but dont use python for that
im trying to study python
three.js gotta be the easiest way to make a 3d game without a game engine(imo)
then make a 2d game in pygame
or turtle if you dare
whats turtle
!d turtle
a built in python gui library
Source code: Lib/turtle.py
is it good
its gud at what it does
built in aswell, so no need to install anything
if i where to make a game engine where do i start
cus i thoght about the renderer it would need a space to read right
LANG DEV TIME
you should start with Java/JS/C++/C/OpenGL
i think hes a troll
you can also try with something like WebGL first
because digging directly into GPU is going to give you a few BSODs
WebGL is cool, but like i wouldnt make a full fledged game in it, its not performant enough(atleast for my needs)
then use that experience for native stuff
might as well just make the engine target both WebGL and OpenGL
since Engine an abstraction anyway
so can abstract away multiple underlying implementations
its not that its hard per say, it just not smth you should do
ask chatgpt
okay
its only supported in chrome as of now, and i use firefox, otherwise, it looks cool tho
also didnt mean to reply to you, meant to reply to mesaq, but i miss click, im sorry for that
meant to reply to this message !1277358413705117860
hmm
valid reason
didn't, like, Firefox have some early thing similar to WebGL
when they ported Unreal (the game) or whatever it was
if i were to make a game tho(using a webGL api) it would be in WebXR
nvm, it was the engine not just the game
10 years ago
idk, i dont rlly watch the web side of game dev
ahhh okee
also isnt unreal an engine, and not a game?
both
Unreal is a game
Unreal Engine is an engine
same company
same logo
i havent heard of unreal, ima go look at it
nothing comes up other than unreal physics?
Unreal is a series of first-person shooter video games developed by Epic Games. The series is known for its exhibition of the namesake Unreal Engine that powers the games and is available for other developers to license.
Publishing rights for the series have changed hands several times. GT Interactive was the original publisher and would be late...
ohh cool
and thank you
Full Changelog: https://github.com/supergamer66000/VideoSplit/commits/0.1
Simple Video Splitter
This is a program that will split a directory or file of videos into there frames
This Program will t...
if you happen to be a fan of big formal documents:
https://semver.org/spec/v2.0.0.html
otherwise,
use X.Y.Z versions only to avoid such issues
-alpha.0 and similar prefixes for pre-releases
so like
tag 0.1.0
then update
tag 0.1.1
ya i just implide the "0" at the end
up to 256 different chars
@wind raptor hi
My partner broke up with me around 2.5 seconds after I disconnected from the call. Atleast my lexer is working π
I am 13
nah
but now I dont have a partner so its ok
or any friends
online/real life
and they are gone lol
a3456789123123
btw I was trying to code a lexer just now
and instead of increasing the for loop iteration value
I was increasing the pointer... there fore the memory address
so every iteration I would have the pointer point to a different memory location
yeah
anyways how are you doing?
what is it?
is there a github?
I made a pr to a project like a few months ago and its still not aproved
and the repo has a few thousand stars
and no commits for years, no prs for years and the owner is not active since 2022
yes
they said yes
and I said I created one
and nothing...
@wind raptor
Could you please explain how I go from lexed tokens to stuff being done?
cause I got a lexer
but nothing to handle the tokens
@wind raptor
Its 1 Am I need to go to bed, good night! and good luck with your discord project!
@wind raptor I'm shoving my messages about that CSS thing into the AI
I have no idea what it means by colour
at least this aligns
but with a nuance
I planned to do that in CSS only
@wind raptor
@wind raptor
@wind raptor
I am getting doxed
rn
some kid got my address and is therening me
and full name and shit
That's a police thing. Can't really do much on here. Is it from a user on the server?
no
I just didnt know who to msg
but I felt its important to msg someone
it was my ex
sooo not a big suprise there
Ahh I see
I told him that I got A BUNCH of stuff on him and then I sent him the high ground star wars gif and blocked him on that note lol
@wind raptor
I got addresses and more but I just want him to be a bit worried
anyways
he got my address worng
its not even close
Anyways
Gn
Good night
Fuck
I cant sleep
so instead I added flag recognition to my lexer
Now I added command name
You look so chill
like chiller than anyone here
like the coolest chillest guy ever
like
If I didnt know anything
I would want you to teach me
don't recommend doxing people
sorry!!!
It's all good
Mindful GPT, what it 2+2?
22
Mindful GPT, Why is my lexer 506 lines without the GUI and parser and like a proper arg handler
Β―_(γ)_/Β―
Anyways
Imma try to sleep for the 10th time
its 3 am
I got to get up at 8:30
I got 5 and a half hours of time before i got to get up
but I want to read my 912 page C++ book and the 200 page Microsoft winAPI docs for wstrings
and the 400 page quantum mechanics book
and watch a entire wan show
and finish 2 seasons of my show
@wind raptor How does one sleep!?
I dont have any
ok
Imma go then
bye!!
you too bye
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
is @stark river online
β
I don't have mic access yet
You are not allowed to use that command here. Please use the #bot-commands channel instead.
Where are you from?
Yes, just checked...
I'm at 24 msgs
I thought I had talked a lot more, but I guess not
What are you working on with python?
I've learned python quite recently (basics), I started doing projects like library management system and coffee machine simulator.
Are you using a data base?
I'm pretty new as well, but just learning about databases. I have a project I'm going to need one for
no i don't but I watched some videos about the topic, (but forgot everything)
Ha, of course
like that happened when I finished a login system using databases
In this Python tuturial we talk all about connecting to SQL Databases with Python and Pandas. Python is the swiss army knife of data anaylsis, and relational databases are the most common way data is stored at small and large companies. Learning how to best connect the two is an essential skill for any data professional.
Timeline:
00:00 Intro
0...
I just watched this one. Pretty inspiring
like when you study for an exam and after it your brain just do a quick format
Ya, I feel the same... I just need more real work experience
If I can get voice approved, I might do some coding in the chat tomorrow morning
It's 9pm here, so we're 12 hours off
It's be around 9am my time, 9pm yours if you're awake
btw im trying to get voice approved while i dont have a mic
i will use my laptop i guess
and btw don't worry for the time difference
cuz i wake up at 5am everyday
so it will be 5pm for you
See ya later
public static void main(String[] args) {
use proc_macros::DatabaseEntity;
use crate::database::DatabaseEntity;
#[derive(DatabaseEntity)]
#[entity(entity_name = "customers", primary_column_name = "id")]
pub struct CustomersDatabaseView {
rows: Vec<CustomersDatabaseViewRow>,
}
// impl DatabaseEntity for CustomersDatabaseView {
// type Row = CustomersDatabaseViewRow;
// const ENTITY_NAME: &str = "customers_view";
// const PRIMARY_COLUMN_NAME: &str = "id";
// fn with_rows(rows: Vec<Self::Row>) -> Self {
// Self { rows }
// }
// fn take_rows(self) -> Vec<Self::Row> {
// self.rows
// }
// fn rows(&self) -> &[Self::Row] {
// &self.rows
// }
// }
#[derive(sqlx::FromRow, Clone)]
pub struct CustomersDatabaseViewRow {
pub id: i32,
pub name: String,
pub email_address: Option<String>,
pub phone_number: Option<String>,
pub street_address: Option<String>,
}
macro_rules! synerror {
( $span_ident:ident, $message:literal ) => {
return SynError::new($span_ident.span(), $message)
.into_compile_error()
.into()
};
}
#[derive(ExtractAttributes)]
#[deluxe(attributes(entity))]
struct DatabaseEntityAttributes {
schema_name: Option<String>,
entity_name: String,
primary_column: String,
}
#[proc_macro_derive(DatabaseEntity, attributes(entity))]
pub fn derive_database_entity(input: TokenStream) -> TokenStream {
let mut input: DeriveInput = parse_macro_input!(input);
let type_name = input.ident.clone();
let Data::Struct(_) = input.data else {
synerror!(
type_name,
"cannot derive `DatabaseEntity` for non-struct types"
)
};
// TODO: Handle missing attributes
let row_type_name = Ident::new(&format!("{}Row", type_name), type_name.span());
let DatabaseEntityAttributes {
schema_name,
entity_name,
primary_column,
} = deluxe::extract_attributes(&mut input).unwrap();
let optional_schema_definition = schema_name.map(|schema_name| {
quote! {
const SCHEMA_NAME: &str = #schema_name;
}
});
quote! {
impl DatabaseEntity for #type_name {
type Row = #row_type_name;
#optional_schema_definition
const ENTITY_NAME: &str = #entity_name;
const PRIMARY_COLUMN_NAME: &str = #primary_column;
fn with_rows(rows: Vec<Self::Row>) -> Self {
Self { rows }
}
fn take_rows(self) -> Vec<Self::Row> {
self.rows
}
fn rows(&self) -> &[Self::Row] {
&self.rows
}
}
}
.into()
}
@versed heath
gg
:incoming_envelope: :ok_hand: applied timeout to @daring totem until <t:1724657859:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
<@&831776746206265384> yolo srry I did that cuz it said to VC i needed to sent like 50 messages so I wanted to do it fast bc no one is ever on. π¦ don`t ban me π¦
@daring totem In the #voice-verification channel, what is the first instruction given?
idk
Absent any other circumstance to which I am unaware, you may have either no further action taken against you or you may have your ability to voice verify suspended for an extra 14 days.
Well, go to the channel and have a look.
You're still welcome to hang out and listen and chat via text, unless there's some other consideration which would change that.
!stream 732291998274420828
β @sour imp can now stream until <t:1724679265:f>.
@sour imp
@wind raptor hey
Hi
@wind raptor Could I get screen share perms to continue working on my lexer/parser?
@upper basin We're getting a lot of echo from your mic
literally, only 1 position lol
And the will hire @upper basin way before me coz it is quantum
!stream 1028671867785068574
β @whole bear can now stream until <t:1724682586:f>.
Hehe...oh, you're serious.
I am a nogo applicant. Tough nationality, and outside US at the moment. And don't have a MSc or PhD.
How
yo wsg tream
lol yes I am. I also have weak passport, and out of US as well
If you published 1st author paper at top venue, I don't think anybody care about phd anymore.
Oh, they do. Big time.
really? why?
publications trump phd anyday imo.
:white_check_mark: Your 3.12 eval job has completed with return code 0.
2 + 2 is 22.
for key, value in self.get_counts(num_shots=1).items():
if value == 1:
# Check if the value of the measurement matches the specified value
condition = int(key[clbit_index]) == clbit_value
break
Better way of doing this?
https://en.wikipedia.org/wiki/Friendster @whole bear
Friendster is a social network originally based in Mountain View, California, founded by Jonathan Abrams and launched in March 2003. Before Friendster was redesigned, the service allowed users to contact other members, maintain those contacts, and share online content and media with those contacts. The website was also used for dating and discov...
How to make this into case sth?
elif match_pattern(gate_type, "x"):
match var:
case 1:
something
case _:
default (called when no other cases worked)
@upper basin
def process_gate(gate_type):
match gate_type:
case "x":
# Code to handle the "x" case
handle_x_gate()
case "y":
# Code to handle the "y" case
handle_y_gate()
case "z":
# Code to handle the "z" case
handle_z_gate()
case _:
# Default case if needed
handle_unknown_gate()
def handle_x_gate():
print("Handling x gate")
def handle_y_gate():
print("Handling y gate")
def handle_z_gate():
print("Handling z gate")
def handle_unknown_gate():
print("Unknown gate type")
# Example usage
process_gate("x")
process_gate("y")
process_gate("a")
!stream 732291998274420828
β @sour imp can now stream until <t:1724686081:f>.
hello
!stream 104903148853833728
β @sly jolt can now stream until <t:1724687422:f>.
Hello
The last calculator was hard-coded, I want to change that and make some improvements like in windows calculator the equation or something is not on main screen only the answer is
@verbal zenith
Did you understand?
no
But I don't know how can I change the hard-coded part
let me give you
Okay.
!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.
https://paste.pythondiscord.com/XK6Q This is the hard-coded part
What I want to do is that I want to store the value the user typed and then show the answer or error if it is not valid if this makes sense
I didn't understand
Okay.
Thanks.
Check if the expression is not empty and the last character is not an operator π
yeah thats a silly bug
its why I made a whole state machine
a bunch of if statements to manage state or one field that dictates it
elif button_text == '+':
# Check if the expression is not empty and the last character is not an operator
if self.expression and self.expression[-1] not in '+-*/':
self.expression += '+'
Thanks
!paste
g++ CPP-Dev/Orion-Shell/src/main.cpp CPP-Dev/Orion-Shell/src/cpp/utils.cpp CPP-Dev/Orion-Shell/src/cpp/lexer.cpp -o C:/coding-projects/CPP-Dev/Orion-Shell/build/Orion-Shell-Main-Build-ORS-A01 -lgdi32 -luser32 -lshell32 -w
whats your go to compiler?
@whole bear What are you doing?
Why are you making a lexer?
like why we need a lexer?
Why we need a lexer?
@whole bear @verbal zenith need to work on getting perms to speak in here
?
i cant talk unless i get my activity up
the bot in here
its annoying
@whole bear
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@verbal zenith make comments AI-linted: if AI can generate a similar enough comment, it automatically deletes them
(getting non-reasoning comments right is a very rare thing, which AI happily avoids even trying to do)
-= is defined separately in Rust
SubAssign iirc
hello
there;
I
am
bob;
hello there;
I am bob
pub fn get_line_info(filename: &'static str, start: usize) -> (usize, usize) {
get_source(filename).unwrap()[..start].char_indices().fold(
(1usize, 1usize),
|(line, column), (i, c)| {
if c == '\n' {
(line + 1, 1)
} else {
(line, column + 1)
}
},
)
}
or unimplemented!
if you have a message, they're both same as panic!
the difference is just in ctr-f'ing it across the codebase
there's certain line between todo and unimplemented
first means "will implement", second means "may implement"
stricter rule is: never commit todo!s
when is line_start used?
1qwer5678
clear
i need help with something
when i use string.lower it throws my program off and states game over.
so i got rid of the lower()
let me pastebin this shit
it is being weird
my idea would be something like this (might have some off-by-one errors)
let (last_ix, last_line) = source[..start].lines().enumerate().last().unwrap();
let line = last_ix + 1;
let column = last_line.len() + 1;
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@verbal zenith you know format_args!, right?
i got it working
is this python?
no wonder why i couldnt recognize it
non-alloc version of format!
generates something Displayable
Arguments<'_> specifically
you will run into weird issues if you overuse it
in implementations of Display you'd normally just write!(f, ...)
and whatever else you do with format! -- just wrap that in something implementing Display
sometimes the right approach
and sometimes doesn't work
stackoverflow can't Rust
stringify just turns tokens into &'static str iirc
(procedural) derive macro
or just use Zig where you get to have reflection
what context do you need the names in?
@verbal zenith https://crates.io/crates/name-variant
if you want to just use it instead of re-inventing
https://docs.rs/name-variant/latest/src/name_variant/lib.rs.html#3-109
does discord have a way of compiling your code in chat?
that may be really stupid question
no
cool beans
and Python generally can be quite easily compiled
afaik compile call is relatively fast
it doesnt have to be compiled
and secure-ish
assuming we're interested in theoretical ability to compile a certain language
C compilation, without preprocessor, is quite simple too
when it comes to C++, it becomes quite messy because of templates
those can go exponential in complexity
same with Rust/Haskell, but there it's because of different (though adjacent) reasons
is it possible to compile those without serious risk to whatever host compiles them? probably yes
is it easy? probably no
@verbal zenith you seen match and let changes that are getting stabilised in current nightly/next beta?
it used to require Err(e) => match e {}
well, still does
won't be stable until 1.82
rust is getting another exhaustiveness change, so total performance cost is shared between the two
https://github.com/rust-lang/rust/pull/128034
depends on the size
measure
if it gets faster and uses less memory, do the change
I'd expect so
what ide is this
with a nuance
systems programming
and WASM
and maybe something else
in cases where high performance, high level of control and high safety are required
have to do my daily indeed search
@verbal zenith no Sized requirement
: Sized is implied by default
@verbal zenith precedence
@verbal zenith move empty to be first
hmm
@verbal zenith semicolon between rules is required
a hypothetically better solution:
make a Writeable wrapper around f, which adds indents after each newline if a non-space character is written afterwards
just so you don't have to create new macros
and then just write! to that wrapper
let f = self.indent(f);
struct Indent<F> {
f: F,
indent: usize,
stored_space: usize,
}
when you see a newline, write the a newline and set stored_space to indent
when you see a space, increment stored_space
when you see any other space, unimplemented!
when you see non-space, write std::take::(&mut self.stored_space) spaces then that character
do not use str::repeat, it allocates
this also eliminates trailing spaces, as it should
@whole bear
I can fluently speak english, german, russian and swedish
and a bit of dutch and ukranian
I should learn Ukrainian more systematically
idk if this is considered stealing but the other way lol
https://parrrate.github.io/exercises/exercises/rcchars.html
(me using part of rattlescript as an example solution for the thing)
anyway
I tried putting that set of easy challenges into AI again
no success so far
even worse than ever before
that's bash
hmm
inputString
InputString
input_string
doesn't allow in env though
_snailcaSe
have y'all seen what ALGOL allowed
spaces in identifiers
it's the top answer
+53
ALGOL 68 specifically
ah, wait, no, some others allow too
ALGOL 60 allows too allegedly
idk if they do the same as fortran (just remove the space)
@whole bear just a reminder that Oracle exists
way worse than Microsoft
Linux doesn't have viruses, it has vulnerabilities
ALT Linux only, all the way
++rep for prefix notation
@verbal zenith you used two different Writes?
that doesn't seem right
Text Extractor my beloved:
'.va.sql.β’;
Nain
pβ’uc
Stat
stat iC
static
Static
String
String
β’SOL β’ ;
β’ 0.0. i β’
β’August
AopOr
AppCM.th
tβ’β’ Creates a
pβ’uc Stat i'
Systo.oet β’ β’ β’ β’ β’srSnAvthoe:
t' .ptScreenSLteO;
"what an amazing tool"
"""totally works"""
yeah, screenshots for code are problematic
@sour imp sounds normal for me
if the person doesn't know how to write/read to/from a file, they can't tell if discord bots are too advanced for them
discord.py represents slash commands with less magic, at a cost of putting that effort onto the developers
@verbal zenith I'll try writing that thing
!user
You are not allowed to use that command here. Please use the #bot-commands channel instead.
first time I joined was in early 2020 or even late 2019; I left quite a lot of times
@verbal zenith I got it working, now making it more convenient
impl<F: std::fmt::Write> std::fmt::Write for Indent<F> {
fn write_str(&mut self, s: &str) -> std::fmt::Result {
for c in s.chars() {
self.write_char(c)?;
}
Ok(())
}
fn write_char(&mut self, c: char) -> std::fmt::Result {
match c {
'\n' => {
self.f.write_char('\n')?;
self.stored_space = self.indent;
}
' ' => {
self.stored_space += 1;
}
_ if c.is_whitespace() => {
unimplemented!("unusual space characters aren't allowed");
}
_ => {
for _ in 0..std::mem::take(&mut self.stored_space) {
self.f.write_char(' ')?;
}
self.f.write_char(c)?;
}
}
Ok(())
}
}
impl<F: std::fmt::Write> Indent<F> {
fn write_fmt(&mut self, args: std::fmt::Arguments<'_>) -> std::fmt::Result {
std::fmt::Write::write_fmt(self, args)
}
}
why would I ever need an IDE for that
reminder what the struct looks like
struct Indent<F> {
f: F,
indent: usize,
stored_space: usize,
}
also
now I need to make an extension trait
takes the value and sets to 0
drains all spaces it needs to push
it accumulates them
to stored_space
when you encounter non-space, you write those
trait IndentExt {
fn indent(&mut self, n: usize) -> Indent<&mut Self> {
Indent {
f: self,
indent: n,
stored_space: n,
}
}
}
impl<F: ?Sized + std::fmt::Write> IndentExt for F {}
I'm going to commit a type system crime
wait, no, I remembered the mutabilities don't match
oh
oh
I can do it
trait IndentExt: Sized {
fn indent(self, n: usize) -> Indent<Self> {
Indent {
f: self,
indent: n,
stored_space: n,
}
}
}
impl<F: std::fmt::Write> IndentExt for F {}
hmm
idk if this is worse or better
I think worse
not like it's going to stop me
@verbal zenith btw this has implications on formatting specifiers
so don't just replace whatever you have with it
type system crime in question (don't do this)
trait IndentExt: Sized {
fn indent(self, n: usize) -> Indent<Self> {
Indent {
f: self,
indent: n,
stored_space: n,
}
}
}
impl<F: ?Sized + std::fmt::Write> IndentExt for &mut F {}
impl<F: ?Sized + std::fmt::Display> IndentExt for &F {}
impl<F: std::fmt::Display> std::fmt::Display for Indent<F> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f.indent(self.indent), "{}", self.f)
}
}
specifically, it erases them all, afaik