#voice-chat-text-1
1 messages Β· Page 39 of 1
:white_check_mark: Your 3.12 eval job has completed with return code 0.
asdf
!e
for i in range(4):
for j in range(i+1):
print(j+1, end='')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 0 1
002 | 1 1
003 | 1 2
004 | 2 1
005 | 2 2
006 | 2 3
007 | 3 1
008 | 3 2
009 | 3 3
010 | 3 4
!e
for i in range(4):
for j in range(i+1):
print(j+1, end='')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
1121231234
!e
for i in range(4):
for j in range(i+1):
print(j+1, end='')
print(' ')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1
002 | 1
003 | 2
004 | 1
005 | 2
006 | 3
007 | 1
008 | 2
009 | 3
010 | 4
!e
for i in range(4):
for j in range(i+1):
print(j+1, end='')
print(' ')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1
002 | 12
003 | 123
004 | 1234
!e
for i in range(4):
for j in range(i+1):
print('a', j+1, end='b')
print('c')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | a 1bc
002 | a 1ba 2bc
003 | a 1ba 2ba 3bc
004 | a 1ba 2ba 3ba 4bc
!e
for i in range(4):
for j in range(i+1):
print('a'+str(j+1), end='b')
print('c')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | a1bc
002 | a1ba2bc
003 | a1ba2ba3bc
004 | a1ba2ba3ba4bc
for i in range(4)
I-0
I+1- 1
1
I-1
I+1- 2
1
2
I-2
I+1- 3
1
2
3
I-3
I+1- 4
1
2
3
4
' c '
0c0
<@&831776746206265384> sup mods, can you give @quaint dome streaming rite?
!stream 980961294528176170
β @quaint dome can now stream until <t:1724262147:f>.
" i and j"
@radiant juniper
I cannot hear you buddy.
@runic knoll
If you could not hear me, thank you for your effort. I wanted to listen to your explanation too.
But everyone was so enthusiastic in helping me.
: D
Hi
I am fine
and u?
You are developer too?
I am developer.
I can do APP, WEB3,Python, WEB and etc
and u?
Web3? Is that really a thing these days? Thought it was just part of the blockchain hype?
@haughty cape broo u really can do python
I would generally be of a mind to not mind, but telling me to not mind kinda makes me feel like I want to mind.
"I hope you don't mind that I deleted that." Now there's an opening line.
hi
this is my first time using python it looks cool but I need help
my dream was to make a antivirus and minigames bc they look cool
I suspect that a lower-level language, such as something from the C family might be better suited to antivirus projects. Minigames, Python should do you fine. There's a popular game-making framework called PyGame (Community Edition, as distinct from the base version).
Generally, I suggest to people to concentrate on learning the basic, foundational stuff of the language before jumping into frameworks, but some people dive in and do fine.
thank you very much OpalMist
offtopic: #ot0-psvmβs-eternal-disapproval #ot1-perplexing-regexing #ot2-never-nesterβs-nightmare
python general: #python-discussion
thank youuu
preciate it
I know advertising isent allowed in the server, but would looking for hackathon partners be advertising?
I dont wanna break any rules
libsql
@raw wren SQLite has always been for production
unlike postgres and others it really cares about correctness
under very rare circumstances, SSD can be faster than DRAM
filesystem caches exist
that's why
you need redis for processed data
something you actually compute not just copy off disk
redis has a whole two persistence models
which you can mix
go channels are terrible in some of their nuances
but generally okay
"goroutines and defer are enough excitement on their own"
all four "channel axioms" are wrong
send to nil blocks forever,
receive from nil blocks forever,
receive from closed returns nil immediately,
send to closed panics (this one is okay-ish)
contact the email provide
r
@umbral rose greeting in Russian
first two you kind of just avoid
third can be mediated (there is an indication of closing)
and fourth is kind of "you own it, you send to it, you close it, no one else can do that"
which lack of sharing being an implied assumption
I have learn the basic of python
How can I built my logics in python?
I have done basics of python question now facing problems in the logics one?
Can anybody help or something
I might've been there
hmm
time to check
you can also just spawn a Go suprocess and pipe data in and out of it
(not recommended)
@kindred rapids @raw wren
iirc there are ways to route all traffic of a docker container through a proxy, but I don't remember how to do it
or whether it's actually real
import discord
from discord.ext import commands
from aiohttp_socks import ProxyConnector
SOCKS5_PROXY_URL = 'socks5://your-proxy-url:port'
connector = ProxyConnector.from_url(SOCKS5_PROXY_URL)
session = aiohttp.ClientSession(connector=connector)
bot = commands.Bot(command_prefix="!", intents=discord.Intents.default(), session=session)
pip install aiohttp-socks
uh
I might be misremembering
I thought there was something with a custom network for the container
along those lines
@kindred rapids ssh tunnelling specifically, right?
yeah
you can forward ports both ways and beyond that
!stream 217691138696413187
β @kindred rapids can now stream until <t:1724465194:f>.
@fervent surge @past remnant π
hey man, how are you
@stuck bluff How are you, I am new to the channel. looking to make some friends who can help me learn programming
@stuck bluff I remembered I've sent the same sound but without noise before
#voice-chat-text-1 message
(somewhat lower though)
Well, that's what the server is for. π
alien noises
I am in the begining stage yet. I want to learn python and get comfortable with solving problems.
@stuck bluff
PS C:\Users\cutek\Desktop\Misc Code\FRTAnnouncements> & "C:/Program Files/Python312/python.exe" "c:/Users/cutek/Desktop/Misc Code/FRTAnnouncements/main.py"
Traceback (most recent call last):
File "c:\Users\cutek\Desktop\Misc Code\FRTAnnouncements\main.py", line 14, in <module>
connector = ProxyConnector.from_url("socks5://127.0.0.1:8080")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cutek\AppData\Roaming\Python\Python312\site-packages\aiohttp_socks\connector.py", line 123, in from_url
return cls(
^^^^
File "C:\Users\cutek\AppData\Roaming\Python\Python312\site-packages\aiohttp_socks\connector.py", line 57, in __init__
super().__init__(**kwargs)
File "C:\Users\cutek\AppData\Roaming\Python\Python312\site-packages\aiohttp\connector.py", line 805, in __init__
super().__init__(
File "C:\Users\cutek\AppData\Roaming\Python\Python312\site-packages\aiohttp\connector.py", line 252, in __init__
loop = loop or asyncio.get_running_loop()
^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop
PS C:\Users\cutek\Desktop\Misc Code\FRTAnnouncements>
do it inside async def main
then don't use plain bot.run, instead use the async equivalent
Hm. Is there a particular kind of problem you would like to tackle now?
import aiohttp
from aiohttp_socks import ProxyConnector
import discord
from discord.ext import commands
TOKEN = 'Mblahblahdohsoifhseoihfoies'
ANNOUNCEMENTS_CHANNEL_ID = 42069 # Replace with your #announcements channel ID
# Set up the SOCKS5 proxy server (comment out these two lines if not using in China)
connector = ProxyConnector.from_url("socks5://127.0.0.1:8080")
session = aiohttp.ClientSession(connector=connector)
intents = discord.Intents.default()
intents.members = True # Required to fetch member roles
bot = commands.Bot(command_prefix='fa!', intents=intents, session=session)
@bot.event
async def on_ready():
print(f'Logged in as {bot.user}')
@bot.event
async def on_message(message):
if isinstance(message.channel, discord.DMChannel):
print(f'Received DM from {message.author}: {message.content}') # Debug print
guild = discord.utils.get(bot.guilds) # Assumes the bot is in only one server
member = guild.get_member(message.author.id)
role = discord.utils.get(guild.roles, name="Announcer")
if role in member.roles:
announcements_channel = bot.get_channel(ANNOUNCEMENTS_CHANNEL_ID)
await announcements_channel.send(message.content)
print(f'Message sent to #announcements: {message.content}') # Debug print
else:
await message.channel.send("You do not have permission to send announcements.")
print(f'Permission denied for user {message.author}') # Debug print
bot.run(TOKEN)
Nothing as of now. Looking to get some suggestions on how and where to start.
Okay, well, there's Corey Schafer, a YouTuber with a lot of tutorial videos.
with some omissions,
async def main():
connector = ProxyConnector.from_url("socks5://127.0.0.1:8080")
session = aiohttp.ClientSession(connector=connector)
bot = commands.Bot(session=session)
discord.utils.setup_logging()
await bot.login(token)
await bot.connect()
asyncio.run(main())
I also recommend people use the documentation available from python.org.
(just a general idea)
There's a web-based version of the documentation and a few downloadable versions.
isn't there an option to set the session after construction?
like bot.session = ...
idk if this will work
async def main():
connector = ProxyConnector.from_url("socks5://127.0.0.1:8080")
session = aiohttp.ClientSession(connector=connector)
bot.session = session
await bot.login(token)
await bot.connect()
asyncio.run(main())
thankyou
!intents
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.
There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.
Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.
@kindred rapids no?
you only need bot, right?
it's separate
like
completely
what you're checking is what you allow the application to do with your account
or whoever adds it
what bot can do is limited by roles instead
@kindred rapids you don't need oauth2 if you're making a bot
generally
oauth2 is for getting users' information/actions/whatever
for this you need intents specifically
there are three toggles
content, members and something else, iirc
@kindred rapids in oauth2 there's a separate thing for bot which isn't real oauth2
(scopes must be exactly only "bot")
turn what off
Hello!
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
im sorry
currently fixing my brainded mic
π
yes?
sorry
nah np
im not even gonna turn it on again
π
what are you writing? a circuit simulator?
@frigid geyser π
They there voice peoples
I can throw it in a notebook and see for shits and gigles
Btw, Whts difference between python dev and DevOps Eng
Who is more needed for projects
Welp i ran it from commandline
tried to input the words seen in your dict and list of words
it kept returning "im not sure i understand"
So there is something wrong with your logic
Typing bye does not exit either.
Howdy
Say something (or type bye to quit): bye
bye
PS C:\Users\qdsdf\Documents\Python>
Output ^^
its ok i found the issue thx tho
Getting this output atm
Sorry I'm not sure to understand...
Give me one word related to what you said !bye
bye
Living Things:
Animals:
Mammals:
- Dog
- Cat
- Elephant
Birds:
- Sparrow
- Eagle
- Penguin
Fish:
- Salmon
- Shark
- Goldfish
Reptiles:
- Snake
- Lizard
- Turtle
Insects:
- Ant
- Bee
- Butterfly
Sorry I'm not sure to understand...
Give me one word related to what you said !Bye
Bye
Living Things:
Animals:
Mammals:
- Dog
- Cat
- Elephant
Birds:
- Sparrow
- Eagle
- Penguin
Fish:
- Salmon
- Shark
- Goldfish
Reptiles:
- Snake
- Lizard
- Turtle
Insects:
- Ant
- Bee
- Butterfly
Sorry I'm not sure to understand...
Give me one word related to what you said !```
But hope all is well!
@proper ridge Oh my... 1000 + lines π
Can anyone Please help me
We're in here @red sage
wrong chat LOL
is this correct GANG?
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()
So country country country wins the country test?
Does it run?
just summon the bingbot for the legwork
If it errors, then no.
Anyone please help me
There's a lot of repetition of code. You can make it in a way that you just have one quiz function that takes in a quiz type and a data structure containing questions and answers
Right so:
2 quiz functions
a game loop
And a score setup (id suggest making this its own function or something which takes in result )
can u show?
what circuit are you working on? and how does it relate to the python code?
He seems pretty deep in the "circuit" code atm
i have some business to do π
just googled some of the keywords in the code. i thought you guys were doing fpga stuff
Seeing the 1000 + lines made me look this up instead
You still there?
Please help me with this coding
This looks like an ongoing test/exam
Yeah lol
We can't help with that here
Use stackoverflow
then see how many rude comments you would get
If you're getting rude comments you're using SO wrong, I've used it for over a decade and never gotten a rude comment...
though I never crated an account either
Back in a bit
I have some PyTorch Exercises i need to get back to π
Okay
@umbral rose Hi!
Good. How about you?
#voice-chat-text-0 message You understood what I meant by Hard-coded?
@proper ridge not running tests through VSCode test panel just because terminal is more convenient?
Yeah, used to running from terminal.
Also can choose what module to run testers for.
the only thing, that I found VSCode-specific run options to be useful for, was cmake (C/C++)
I see.
I'm also trying to learn to use terminal more since it's sth I lack familiarity with quite severely.
Like trying to slowly get in the habit of pushing, pulling, etc. from terminal too instead of GitHub Desktop which I normally use.
this is crazy
I think I haven't
to me Git commands are more intuitive than VS proper's Git UI
and after learning Git, IntelliJ Git UI feels a bit weird
because it's more loose about staging
I like GitHub Desktop because I can see the files I changed, and lines I changed which helps when I write commit summary.
It's comfortable, but it's caused me to neglect the Git commands skill.
when I was using VS proper, I only used GitHub Desktop and commands
because the alternative (in the IDE) was bad
I see.
and likely still is
Hehehe
I got ben and jerries Brownie in mah freezer @proper ridge
it's going to be suboptimal for me to have ice-cream rn
(coughing)
for three weeks so far
Ill take your cold you can have my bad knee
Hmm imagine a python game which emulates the creation of ice cream
when I was making something with pygame, I encountered this during research
for learning I suggest codewars instead
leetcode is like a weaker codeforces without rating
not structured for learning
codewars has a wider range of difficulties
though towards higher levels it sometimes means inherent complexity rather than challenge
these two have different complexity but the same rating
https://www.codewars.com/kata/5a331ea7ee1aae8f24000175
https://www.codewars.com/kata/52a78825cdfc2cfc87000005
(second can easily be solved in C, you just need to spend a lot of time)
def _controlled_qubit_gate(self,
gate: Literal["X", "Y", "Z", "H", "S", "Sdg", "T", "Tdg", "RX", "RY", "RZ"],
control_indices: int | Sequence[int],
target_indices: int | Sequence[int],
angle: float=0) -> None:
control_indices = [control_indices] if isinstance(control_indices, int) else control_indices
target_indices = [target_indices] if isinstance(target_indices, int) else target_indices
# Define the gate mapping for the non-parameterized controlled gates
gate_mapping = {
"X": cirq.ControlledGate(sub_gate=X, num_controls=len(control_indices)),
"Y": cirq.ControlledGate(sub_gate=Y, num_controls=len(control_indices)),
"Z": cirq.ControlledGate(sub_gate=Z, num_controls=len(control_indices)),
"H": cirq.ControlledGate(sub_gate=H, num_controls=len(control_indices)),
"S": cirq.ControlledGate(sub_gate=S, num_controls=len(control_indices)),
"Sdg": cirq.ControlledGate(sub_gate=S**-1, num_controls=len(control_indices)),
"T": cirq.ControlledGate(sub_gate=T, num_controls=len(control_indices)),
"Tdg": cirq.ControlledGate(sub_gate=T**-1, num_controls=len(control_indices)),
"RX": cirq.ControlledGate(sub_gate=Rx(rads=angle), num_controls=len(control_indices)),
"RY": cirq.ControlledGate(sub_gate=Ry(rads=angle), num_controls=len(control_indices)),
"RZ": cirq.ControlledGate(sub_gate=Rz(rads=angle), num_controls=len(control_indices))
}
# Apply the controlled gate controlled by all control indices to each target index
for target_index in target_indices:
self.circuit.append(
gate_mapping[gate](*map(self.qr.__getitem__, control_indices), self.qr[target_index])
)
use (make) a language which magically optimises this for you
def _controlled_qubit_gate(self,
gate: Literal["X", "Y", "Z", "H", "S", "Sdg", "T", "Tdg", "RX", "RY", "RZ"],
control_indices: int | Sequence[int],
target_indices: int | Sequence[int],
angle: float=0) -> None:
control_indices = [control_indices] if isinstance(control_indices, int) else control_indices
target_indices = [target_indices] if isinstance(target_indices, int) else target_indices
# Define the gate mapping for the non-parameterized controlled gates
# gate_mapping = {
# "X": QControlBox(Op.create(OpType.X), len(control_indices)),
# "Y": QControlBox(Op.create(OpType.Y), len(control_indices)),
# "Z": QControlBox(Op.create(OpType.Z), len(control_indices)),
# "H": QControlBox(Op.create(OpType.H), len(control_indices)),
# "S": QControlBox(Op.create(OpType.S), len(control_indices)),
# "Sdg": QControlBox(Op.create(OpType.Sdg), len(control_indices)),
# "T": QControlBox(Op.create(OpType.T), len(control_indices)),
# "Tdg": QControlBox(Op.create(OpType.Tdg), len(control_indices)),
# "RX": QControlBox(Op.create(OpType.Rx, angle/np.pi), len(control_indices)),
# "RY": QControlBox(Op.create(OpType.Ry, angle/np.pi), len(control_indices)),
# "RZ": QControlBox(Op.create(OpType.Rz, angle/np.pi), len(control_indices))
# }
match gate:
case "X":
mcx = QControlBox(Op.create(OpType.X), len(control_indices))
for target_index in target_indices:
self.circuit.add_qcontrolbox(mcx, [*control_indices[:], target_index])
(I didn't hear; was gaming)
TLDR; trying to avoid making unnecessary instances when the key is not used, but the approach with match case had similar (even as far as same) performance.
Which feels odd.
math is faster than memory lookup
"less than 30GB used by the browsers??"
WHAT
okay right now it's not so bad

ig Cursor will have to wait until that bug is removed
I just looked up Cursor editor
is this a good place to get a quick scan at some really basic stuff for anyone proficient? im teaching myself python with a course... i came up with an alternative method than the course suggested and just want to know if my logic is correct
I once had ~45GB total used by VSC
across one client and two servers
if you're wondering what that looks like
context switching goes insane on that one
im on data structures, and finding a random entry within a list... they suggested random.choice function to find a random person from a list which they hadn't taught yet... i did this
friends = ["Alice", "Bob", "Charlie", "David", "Emanuel"]
randomnum = random.randint(1,5)
person = friends[randomnum]
print(person)
is this valid is my logic good?
missing -1?
-1?
!e
import random
print(*(random.randint(1,5) for _ in range(20)))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
1 4 5 4 2 3 5 1 1 5 2 2 2 4 1 2 5 3 4 1
ohhh
!e
friends = ["Alice", "Bob", "Charlie", "David", "Emanuel"]
print(friends[1])
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Bob
so its not choosing one of the 5 because of the rand choice
!e
friends = ["Alisa", "Bob", "Charlie", "David", "Emanuel"]
print(friends[0])
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Alisa
!e
friends = ["Alisa", "Bob", "Charlie", "David", "Emanuel"]
print(friends[5])
:x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(friends[5])
004 | ~~~~~~~^^^
005 | IndexError: list index out of range
alice is 0 is what you are saying? so theyll never be picked?
$1B for nothing: "that's called NFTs"
yeah
and would crash sometimes
when 5 is rolled
I meant just the offset
oh so 0,5 will be fine
[0,5)
perfect
thank you!
!e
import random
friends = ["Alisa", "Bob", "Charlie", "David", "Emanuel"]
print(*(random.randrange(len(friends)) for _ in range(20)))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
3 4 3 3 4 3 2 2 1 2 0 1 2 2 0 3 2 3 0 3
LOL
whoever said that lol
read me bedtime stories π
right peace peace ty again!
@umbral rose I have an idea on how to make that CSS challenge more difficult
code needs to be AI-generated
How would you tell?
only use online models which allow sharing logs
Hehehe
I remember there was this research on implementing an invisible marker for AI generated content. Don't know what happened with that.
probably many do
To tell if sth is AI generated or not.
too late for that
returning to the topic of RAM,
I once had something that used ~112GB
people, whom I haven't told that to, may try guessing
the answer is boring
I remember sth vaguely.
I would be down to chip in to host a big model with a few of you guys.
(I tried and failed)
That's a first. Gotta document this moment.
(well, AI failed, I just didn't bother retrying)
/opt/random-garbage
/usr/local seems more sane than /bin indeed
I put my stuff in /home.
I don't remember why but I have ~/.local/bin in $PATH, but I put some stuff there now
@quasi widget for modern de-novo software, it's recommended to go with C++
@misty sinew no, there are things C can that C++ can't
those are corner cases
but at times important
well yes
ofcorse but it mainly works
and for the few parts that dont work I can get work arounds
oh, it's because of pip
might've just linked the whole section
C++ over C unless you have compiler restrictions,
Zig over C unless you need stableβ’οΈ language,
Rust over C++ unless you need to use specific exception-heavy C++ libraries
(that's how I pick among those four)
for ABI, only C
C++ having an ABI is a myth, do not believe it
@polar radish AI can't Rust
general observation
stackoverflow can't Rust either
you're going to get poorly structured C++ disguised as Rust
I'm gonna go sleep. Blessed day to everyone.
whereas there you'll just get "don't do that"
oh, might be it's a suboptimal idea to start an AI model locally when I have only 1 GB VRAM free
wait when did Discord grow to 86GB allocated VRAM
allocated not used
@umbral rose do you think Firefox allocating 3.4TB of VRAM is normal
uhhh
JVM is good allegedly
including, allegedly, that it now has green threads
making Kotlin's async-await less useful
(or whatever Kotlin calls it)
Kotlin is still less ugly though
@ornate cobalt
@ornate cobalt no
@ornate cobalt it's ABI and system dependent
LLVM got i128 passing wrong
!e
x = 0.0
for _ in range(20):
x *= 10
x += 9
print(x)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
1.0000000000000002e+20
!e
x = 0.0
for _ in range(10):
x *= 10
x += 9
print(x)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
9999999999.0
!e
x = 0.0
for _ in range(16):
x *= 10
x += 9
print(x)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
1e+16
:white_check_mark: Your 3.12 eval job has completed with return code 0.
1.0000000000000001e+18
!e
x = 0.0
for _ in range(17):
x *= 10
x += 9
print(x)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
1.0000000000000002e+17
rounds even higher
I, unfortunately, need to close the game to try that AI thing
what game?
!stream 1028671867785068574
β @misty sinew can now stream until <t:1724614612:f>.
last played on steam profile
without logging in I can see only three
@umbral rose one of two main characters is also named Yu
@ornate cobalt if by puzzle you mean Π¨Π, that is a nightmare of a game
I can't get past level 1
split
uh
okay now I have 4GB VRAM
might be enough
looks fine
at least visually
@ornate cobalt if you want unreadable code which I wrote way after learning how not to do that
https://github.com/afeistel/timotheyca.github.io/blob/main/index.html
(I didn't have an IDE when writing that nightmare)
shouldn't tokens be tokenised by a tokeniser
@umbral rose look at the indentation depth
https://docs.rs/ruw/latest/src/ruw/lib.rs.html#435-437
I might've shown that one before
sadly that one is actual okay code so I can't get anything by flattening it
whoa
I like that code because all logic is localised enough and easy to check for correctness
@ornate cobalt fn had different error
@ornate cobalt
when you can
it seems you are good at parsers/lexers
could you help me with mine
I have been coding for years but never needed to make this
!stream 1028671867785068574
β @misty sinew can now stream until <t:1724616155:f>.
the force mute is cancer
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
already passing time and blocks requirement
currently doing clothes and cant think over the washing machine
@ornate cobalt @misty sinew C++ has std::variant for emulating Rust's enum if that's something you need
its just a less wrong union
unions are unsafe even by C standards
typedef enum TokenKind {
TK_Flag,
TK_String,
TK_Identifier
} TokenKind;
typedef struct Str {
char* ptr
uint len
}
typedef struct Token {
TokenKind type,
union {
Str as_string,
Str *as_identifier,
// Idk how to make as_flag empty
}
} Token;
TokenKind not defined
i keep doing things out of the box to this course
supposed to create a loop from 1-100 anything divisibl e by 3 is fizz anything by 5 is buzz anything with both is fizzbuzz.... does this work? for number in range(1,101):
if (number / 3) == int:
print("Fizz!")
elif (number / 5) == int:
print("Buzz!")
elif (number / 3) and (number /5) == int:
print("Fizzbuzz!")
i used int because you cant have decimals. so it has to be a whole number
that was my logic at least
%
Search up the modulus operator and you will know what to do
i used modulus for odds and evens
@ornate cobalt
typedef enum {
TK_Flag,
TK_String,
TK_Identifier
} TokenKind;
typedef struct {
TokenKind type;
union {
char *as_string;
char *as_identifier;
};
} Token;
it works to check the remainder of division which happens to show even or oddity by /2
alright ill take a look ty
yeah I know
just making it syntactically correct first
@ornate cobalt structure fields are defined by analogy to variable declarations
not function parameters
whereas enums are just yes
because there are no namespaces in C, yes
void value_print(Value *val) {
switch (val->type) {
case ValueType_Integer:
printf("%d", val->as_int);
break;
case ValueType_Float:
printf("%f", val->as_float);
break;
case ValueType_Bool:
printf("%s", val->as_bool ? "true" : "false");
break;
case ValueType_String:
string_print(val->as_string);
break;
case ValueType_List:
list_print(val->as_list);
break;
case ValueType_Vector:
vector_print(val->as_vector);
break;
case ValueType_LinkedList:
ll_print(val->as_linked_list);
break;
case ValueType_Queue:
queue_print(val->as_queue);
break;
case ValueType_HashMap:
hm_print(val->as_hash_map);
break;
}
}
typedef enum ValueType {
ValueType_Integer,
ValueType_Float,
ValueType_Bool,
ValueType_String,
ValueType_List,
ValueType_Vector,
ValueType_LinkedList,
ValueType_Queue,
ValueType_HashMap,
} ValueType;
I'd put a default: abort() just because C allows invalid values in enums
to make the program die when it encounters an invalid one
abort is abort
more aggressive than panic
the whole process
kill -9
thats's roughly what it does
wait until you see trait hierarchy so cursed not even rust-analyzer can understand them
cmd.exe?
huh
rust-analyzer finally understands sha2
have you seen how the types are structured for it?
!d hashlib.sha256
hashlib.sha256([data, ]*, usedforsecurity=True)```
@misty sinew
no collisions for sha2 and sha3 have been publicly discovered
SHA-3 (Secure Hash Algorithm 3) is the latest member of the Secure Hash Algorithm family of standards, released by NIST on August 5, 2015. Although part of the same series of standards, SHA-3 is internally different from the MD5-like structure of SHA-1 and SHA-2.
SHA-3 is a subset of the broader cryptographic primitive family Keccak ( or ), desi...
sha2 is completely fine
sha3 is just a different model
just like how blake3 is different to blake2
sha2 is an upgrade from sha1
sha3 is not an upgrade from sha2
@ornate cobalt obviously
!e
print((1 << 256) + 1)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
115792089237316195423570985008687907853269984665640564039457584007913129639937
hash that many and you're guaranteed to find at least one
tuvw
ijklmnop(q)rstu part is common with Russian
@ornate cobalt just look at the type definition horror
https://docs.rs/sha2/latest/sha2/type.Sha256.html
no wonder rust-analyzer just gives up
!e
helloworld(print)
: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 | helloworld(print)
004 | ^^^^^^^^^^
005 | NameError: name 'helloworld' is not defined
@ornate cobalt you can force push a tag
but some git hosts hate it
delete then retag is more reliable
@delicate wren
is our general ChatGPT 10
for updating release message, you can freely edit that in the web UI
π
I have a tool for retagging 1 and 1.0 when new 1.0.X gets tagged
read git docs, learn how to do that, and make your own tool
Oh yeah
so what is this?
have you seen the 4k video one?
khan academy?
handmade hero is a good one for C++ gamedev @ornate cobalt
(I missed like 95% of the context)
!stream 1028671867785068574 1h
β @misty sinew can now stream until <t:1724622873:f>.

Sorry, I was away for a bit
all good
tests are not written by qa
and conveying those back to the programmer
even if those two are the same person
unless QA gets too clever
syscalls are fun
one day we might have O_NONBLOCK support for files
but not today
I might be getting permanent employment soon
for 50% pay increase
yeah
cool
g2g cut the grass. back in a bit
what am I looking at
doctor: syncio isn't real, it can't hurt you
syncio:
panic!()
@ornate cobalt rename?
F2
or what
idk
ah
I have F2 for renaming
@ornate cobalt you're confusing with C#
maybe
C# allows only ending in break, continue, return or wholly empty
C++ should allow fall-through
no recheck
switch is just a goto
case cases are labels
string_view
(it's basically &str)
Works
NVM
now it does
NOW IT DOESNT
NOW IT WORKS AGAIN
NVM IT DOESNT
π
ok wait I fixed it
first of | is the bit wise or operator and its || but you cant do and in a case statment so I fixed it by doing fall through
then my substr arguments where wrong
also
worst part
I was doing pos++; but pos is a pointer... I was incrementing the memory address
whhy i cant open mic
hello
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@hybrid tree π
@stuck bluff
i fixed the code i was having problem with btw
can i show u another one?
If you need to. π
#Power
power = float(input("What voltage would you like me to cut off from now on?: "))
unit = ("V", power)
current_p = float(input("what is the current voltage of your device?: "))
if current_p >= power:
print("power exceeded, would you like to turn off your device now/ \n")
answer = input("yes or no? ").lower
if answer == "yes":
print("Device turned off")
exit()
if answer == "no":
print("Device not turned off")
else:
print("You don't need to turn off your device but if you wish to say YES if not say NO")
answer = input("")
if answer == "yes":
print("Device turned off")
exit()
else:
print("Device not turned off")
im planning on working on this one for a ong timw
i think that this idea has potential u know
oh and this one
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()
I don't know, I'm a little resistant to the idea.
oh
hi
I think it doesn't matter if it's good or bad too much at this point. Are you learning?
Okay, so, something for contemplation...
There is a concept called The Principle of Single Responsibility.
It dictates that every thing you create should have a single responsibility.
One job to do.
This applies to functions.
Thus function shouldn't, in general, do a task and print.
Nor should a function do multiple tasks. It may orchestrate the execution of multiple other tasks, but then that's its function.
If you find your function exceeding a small handful of lines, it's probably too long
If you want to get information out of a function, that's where you might use a return statement, a yield statement, a class instance attribute as part of a method call or the mutation of an object given as argument in an in-place operation.
Returning being the primary technique for functions.
But it depends on the needs of the task at hand.
!e ```py
def func():
return 123
var = func() # var = 123
print(var)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
123
!e ```py
def gen():
yield 1
yield 2
yield 3
g = gen()
print(g)
for v in g:
print(v)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | <generator object gen at 0x7f1fc8594930>
002 | 1
003 | 2
004 | 3
!e ```py
def gen():
yield from (1, 2)
yield 3
for v in gen():
print(v)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
!e ```py
class MyClass:
def init(self):
self.v = 0
def set(self):
self.v = 1
instance = MyClass()
print(instance.v)
instance.set()
print(instance.v)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 0
002 | 1
!e ```py
def func(list_):
list_.append(123)
my_list = []
func(my_list)
print(my_list)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
[123]
!e ```python
def func(list_):
list_.append(123)
return None
my_list = []
func(my_list)
print(my_list)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
[123]
!e py my_list = [3, 1, 2] print(my_list.sort()) print(my_list)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | None
002 | [1, 2, 3]
!e ```python
def func(list_):
list_.append(123)
return None
my_list = []
a = func(my_list)
print(my_list)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
[123]
put print(a)
Ohk
!e ```python
def func(list_):
list_.append(123)
return None
my_list = [1,2,3]
a = func(my_list)
print(my_list)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
[1, 2, 3, 123]
!e ```python
def func(list_):
a = list_
a.append(123)
return None
my_list = [1,2,3]
b = func(my_list)
print(my_list)```
!e ```python
def func(list_):
a = list_
a.append(123)
return None
my_list = [1,2,3]
b = func(my_list)
print(my_list)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
[1, 2, 3, 123]
!e ```py
import random
my_list = [*range(10)]
random.shuffle(my_list)
print(my_list)```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
[1, 4, 9, 5, 3, 6, 7, 8, 2, 0]
Explicit is better than implicit.
!e py d = {k: v for k, v in enumerate('abc')} print(d)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
{0: 'a', 1: 'b', 2: 'c'}
import requests
class Main:
def __init__(self):
get_config_stuff()
def main(self):
do_main_thing()
if __name__ == "__main__":
Main().main()```
@royal rivet π
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
cheerful group
friend had female cat neutered , was still sleepy for 2 days and not eating , finally died -- what are complications that could cause that ? @thin lintel
2 days of not eating will kill
Cats need to pee/poo and eat everyday
Maybe too much meds during the surgery
so was it complications from anesthesia ?
The meds have to be reversed after
Could be
Could also be other issues
Like kidneys could not handle it
if kitty has a heart defect and has ANS ... could it ?
Could be related
mmm kidneys clean out ANS ? but if not working , then die ?
Had 3 other cats neuterd also , they recovered fine
Can find PDF books on canaine surgery , hard to find any books on feline surgery
All vets like dogs more... hard to find a cat speacialist
to access exteranl thingy
oh YA
sorry
i keep forgeting
ya sorry bout that
@thin lintel ya sorry about that
From the few vet shows I saw , they want students to try large and small animals - horse to cat , so when you say cat vet rare ? @thin lintel
LOL
@stuck bluff i keep getting this problem
- hamburger ($15)
2 .salad($20) - coca-cola($5)
- fries($10)
- shake($18)
- hamburger ($15)
2 .salad($20) - coca-cola($5)
- fries($10)
- shake($18)
its repeating them π
feline leukemia ?
once a year a Bobcat sleeps in my backyard , smells rabbits I guess @thin lintel
it behaves like cat , stretches , sleeps curled up ... @thin lintel
but can jump on a high fence like nothing ...
3rd kitty , kitten @thin lintel
older cats will train kitten , yes
rescue kitty
I think I got it out of context 0_0
anybody in voice??
hello
:incoming_envelope: :ok_hand: applied timeout to @stray gazelle until <t:1725143544:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Try using casses
For example
Nvm i forgot im rusty
for i in range(len(menu)):
print (menu[i])```
you mean
for i in menu:
print(i)
:incoming_envelope: :ok_hand: applied timeout to @misty sinew until <t:1725246400:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Thanks man
where build.zig
!rule 6
I think it's white-listed
at least to some degree
ig just because popular enough
normally invites are auto-blocked
this one isn't
and this is why it's not really violating rule 5
there is pycallgraph but it's abandoned
example they have
@glass trout we need dynamic tracing not static analysis
there is no universal guide;
you might as well have just already hit 95% performance you're going to ever get without changes to the underlying C, who knows
@proper ridge
there is a fork though
!pypi pyan
"why only many tabs when you can also have many windows"
one day
one day it will fit on screen
but not today
(as response to whoever was talking about tabs)
!stream 1028671867785068574 1h
β @misty sinew can now stream until <t:1725300306:f>.
i dont really understand the difference between staticmethod and classmethod
iirc staticmethod doesnt even need an instance to work
(if so, whats the point)
Good idea
Well from my understanding, static method is creating a method in a class that does not requite a instance of the class to be called.
You can use this to perhaps organize methods
classmethod takes cls, staticmethod doesn't
That's what I remember also
where just to confirm, class methods and attributes apply globally right? and does it apply to inherited instances as well?
Hi guys - I just jumped in and I'm curious what's going on. What sort of project are you guys working on? (Sounds LLM / ML related)
like yk whats the point of static methods when you can create another function outside of the class?
if you override, you need to write @classmethod decorator in subclasses too
static methods are for namespacing and code organisation
i dont get how it helps code org
to make it clear the function is related to the class
Functions that are related to a class stays with the class.
e.g. when it's a private implementation detail that is only relevant to that class
This is c++ atm, not python IIRC
if it's private and does not take self, prefix with __ and put a staticmethod
@warped canopy Do you have any question? You can ask here
how about getters and setters?
?
how are those even related to the topic?
don't mix property with staticmethod and/or classmethod, if that's the question
like if its private it can only be accessed through authorised means, ie through getters and setters?
float pi(3.14159);
?
IDK what the project is supposed to be doing XD
Is this looking for python errors?
no
its a custom programming language im making in c++
working on a function that can display basic errors
int reportError(std::string filePath, int lineNumber, int start_column, int end_column, std::string msg)
{
if (start_column > end_column)
{
std::cerr << "[reportError] Start Column is bigger than end column" << std::endl;
exit(1);
return 1;
}
std::fstream file(filePath);
std::string line = Utils::readLineFromFile(file, lineNumber);
std::cout << Utils::boldText(Utils::colorText("Error on line: ", "#fc0313")) << Utils::boldText(std::to_string(lineNumber)) << " " << Utils::colorText(Utils::boldText("Start column: "), "#ff9752") << Utils::boldText(std::to_string(start_column)) << " " << Utils::colorText(Utils::boldText("End column: "), "#ff9752") << Utils::boldText(std::to_string(end_column)) << "\n " << Utils::colorText(line, "#a8ff94") << "\n " << std::string(start_column - 1, ' ') << std::string(end_column - start_column, '^') << "\n\n"
<< Utils::colorText(msg, "#94b0ff") << std::endl;
return 0;
}
Ahhh okay. I suppose that makes sends
class Stuff:
def noop(self):
pass
def a(self):
self.noop()
def b(self):
self.noop()
def noop():
pass
def a():
Stuff().noop()
noop()
def b():
Stuff().noop()
noop()
with CallFrom(noop):
a()
b()
with CallFrom(Stuff.noop):
a()
b()
Stuff().a()
Stuff().b()
stuff = Stuff()
with CallFrom(stuff.noop):
stuff.a()
stuff.b()
a
b
a
b
Stuff.a
Stuff.b
Stuff.a
Stuff.b
(prints where the function is called from)
ig can be extended to be analysed externally/visualised
Do you have any 'about' page or anythign? I'm interested in your language, why you're making it, and what its advantages mightb e
As an aside: it might be interesting to define the colours that you use in an Enum, and specify the colour theme using a map
no advantages,
a barely working lexer and half a parser.
and yes here is the page https://github.com/nerd-bear/bassil
So kind of like a Python interpreter, but mostly focused on parsing the lines
or like, almost a compiler?
Cool shit. π
@warped canopy !res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
how to talk in discord main server
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Gotta be not a bot, not a lurker, and somewhat active
what do u mean
read through #voice-verification if the question is about mic usage
yes i got it
it said
you already meet the time requirement
more than 50 messages
50 non-deleted messages in channels other than the bot command channels
Joined more than 3 days ago
Active for at least three different ten-minute blocks
Those are the requirements. Do those
so just engage in converstations using text for now
not like there's anything happening in voice right now anyway Β―_(γ)_/Β―
'cause everyone is suppressed XD
5/9 people have mic permissions
really
Sorry, g2g
approximately nothing
midful dev
had to unstream you @misty sinew
my stream ended lol
why some bad noice coming
i wanted to steam
ohh ok
back in an hour
IDK the rules, but looks like you cant stream w/o a chaperone
chaperone π
can't talk @misty sinew , but give me like 30 more messages and I'd be happy to chat
its rainy
and only kind of warm
summer is feeling like its coming to an end π¦
it
noice
langdev?
not shit my dude!
this is like 90% more development than most projects get to XD
time to waste a few minutes on coming up with adequate names for CSS vars I use
ChatGPT
Claude
since maybe r, g, x1, d1, x2, x3, x4, d2, x5 is not good enough
if anyone is willing to try if AI can rename these:
https://github.com/parrrate/grid/blob/main/index.css#L9-L17
index.css lines 9 to 17
--r: tan(atan2(var(--100cqh), var(--100cqw) / var(--cell-ratio)));
--g: round(down, sqrt(var(--n) * var(--r)));
--x1: round(up, sqrt(var(--n) / var(--r)));
--d1: max(0, round(up, round(up, var(--n) / var(--x1)) - var(--x1) * var(--r)));
--x2: (var(--n) / max(1, round(up, var(--n) / var(--x1) - 1)));
--x3: (round(up, var(--n) / var(--x1)) / var(--r));
--x4: round(up, min(var(--x2), var(--x3)));
--d2: (var(--x4) - var(--x1));
--x5: (var(--x1) + var(--d1) * var(--d2));```
radius, gravity ?
idk why --g is even there
Give them mortal kombat names. Raiden, Goro, Liu Kang!
unused var from earlier
i have to send more than 50 messages only
It's probably interactive
.outer-container {
container-type: size;
}
.inner-container {
display: grid;
--grid-container-width: 100cqw;
--grid-container-height: 100cqh;
--grid-aspect-ratio: tan(atan2(var(--grid-container-height), var(--grid-container-width) / var(--grid-item-aspect-ratio)));
--optimal-row-count: round(down, sqrt(var(--grid-item-count) * var(--grid-aspect-ratio)));
--initial-column-count: round(up, sqrt(var(--grid-item-count) / var(--grid-aspect-ratio)));
--row-overflow: max(0, round(up, round(up, var(--grid-item-count) / var(--initial-column-count)) - var(--initial-column-count) * var(--grid-aspect-ratio)));
--adjusted-column-count-1: (var(--grid-item-count) / max(1, round(up, var(--grid-item-count) / var(--initial-column-count) - 1)));
--adjusted-column-count-2: (round(up, var(--grid-item-count) / var(--initial-column-count)) / var(--grid-aspect-ratio));
--column-adjustment: round(up, min(var(--adjusted-column-count-1), var(--adjusted-column-count-2)));
--column-increment: (var(--column-adjustment) - var(--initial-column-count));
--final-column-count: (var(--initial-column-count) + var(--row-overflow) * var(--column-increment));
grid-template-columns: repeat(calc(var(--final-column-count)), 1fr);
}
.inner-container > * {
aspect-ratio: var(--grid-item-aspect-ratio);
overflow: hidden;
}
@property --grid-container-width {
syntax: "<length>";
initial-value: 0px;
inherits: false;
}
@property --grid-container-height {
syntax: "<length>";
initial-value: 0px;
inherits: false;
}
@property --grid-item-aspect-ratio {
syntax: "<number>";
initial-value: 1;
inherits: false;
}```
Claude!? :X
:incoming_envelope: :ok_hand: applied timeout to @warped canopy until <t:1725300813:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
It literally says don't spam lol
optimal-row-count
wrong, not optimal
I cant do the ofrtmatting
(what it named final-column-count is the actual optimal one)
column-adjustment
that one is wrong too
it's adjusted-column-count, just like the previous two
@warped canopy If you try to spam again to get your message count, we'll have to give you a 14d wait time as well.
this error is somewhat surprising
like this is not where I'd expect the AI to fail, so didn't notice at first
Lol was that Mortal Kombat names you used?
container-type: size;
}
.inner-container {
display: grid;
--scorpion-width: 100cqw;
--subzero-height: 100cqh;
--raiden-ratio: tan(atan2(var(--subzero-height), var(--scorpion-width) / var(--liu-kang-ratio)));
--sonya-rows: round(down, sqrt(var(--kitana-count) * var(--raiden-ratio)));
--johnny-cage-cols: round(up, sqrt(var(--kitana-count) / var(--raiden-ratio)));
--goro-overflow: max(0, round(up, round(up, var(--kitana-count) / var(--johnny-cage-cols)) - var(--johnny-cage-cols) * var(--raiden-ratio)));
--shang-tsung-cols-1: (var(--kitana-count) / max(1, round(up, var(--kitana-count) / var(--johnny-cage-cols) - 1)));
--shang-tsung-cols-2: (round(up, var(--kitana-count) / var(--johnny-cage-cols)) / var(--raiden-ratio));
--jax-adjustment: round(up, min(var(--shang-tsung-cols-1), var(--shang-tsung-cols-2)));
--kano-increment: (var(--jax-adjustment) - var(--johnny-cage-cols));
--kung-lao-final: (var(--johnny-cage-cols) + var(--goro-overflow) * var(--kano-increment));
grid-template-columns: repeat(calc(var(--kung-lao-final)), 1fr);
}
.inner-container > * {
aspect-ratio: var(--liu-kang-ratio);
overflow: hidden;
}
@property --scorpion-width {
syntax: "<length>";
initial-value: 0px;
inherits: false;
}
@property --subzero-height {
syntax: "<length>";
initial-value: 0px;
inherits: false;
}
@property --liu-kang-ratio {
syntax: "<number>";
initial-value: 1;
inherits: false;
}
There we go
Yeah it was.
Let them come naturally - no spamming amirite?
yeah, unfortunately still
allegedly there are ways to make it work better
but I don't use AI so I don't know
If its any consolation, all of the legacy code I work on used to have constrained variable name lengths
use @crisp hazel, do not repost
mods are getting pinged for this I think
as in not you
the var name length was constrained to like, 3 or 4 chars max? So everything is "a", "b", "aa", "x1", "x2" etc
but the original message
because of the language used or something else?
or obfuscated? lmao
its because it was ported from fortran in like 1990
well, at least the original code ended up quite simple
I anticipated it being quite worse
that sure looks like APL
hi guys
https://aplwiki.com/wiki/Conway's_Game_of_Life
life β {β1 β΅ β¨.β§ 3 4 = +/ +βΏ Β―1 0 1 β.β Β―1 0 1 β½Β¨ ββ΅}
afaik code generation in malbolge is stochastic
Make a weird function that checks if all ints in a list are ones
def allOnes(_n:list[int])->bool:return(all(u==1 for u in _n))
!e
def all_ones(ones) -> 1 or not 1:
try:
return not 1 / ~-ones[not 1]
except ZeroDivisionError:
return all_ones(ones[1:])
except IndexError:
return not not 1
except:
return not 1
print(all_ones([]))
print(all_ones([1]))
print(all_ones([1, 1, 1]))
print(all_ones([1, 1 + 1, 1]))
print(all_ones([1, 1, "1"]))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | True
002 | True
003 | True
004 | False
005 | False
all(map(1 .__eq__, _n))
~
bitwise not
def allOnes(_n:list[int])->bool:return(np.sum(ones)==len(ones))
!e
print(~-1)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
0
[0,2]
-1 is ..11111111111111111
infinite ones
in binary
so ~ of it is all 0s
~1 is -2
!e
print(-1)
print(~1)
print(~-1)
print(-~1)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | -1
002 | -2
003 | 0
004 | 2
ones[not 1]
-
print(-1):
This is straightforward negation. It simply outputs -1. -
print(~1):
The~operator performs bitwise NOT. In binary, 1 is represented as ...0001.
Bitwise NOT flips all bits, resulting in ...1110, which is -2 in decimal. -
print(~-1):
In binary, -1 is represented as all 1s (...1111).
Bitwise NOT flips all these 1s to 0s, resulting in 0. -
print(-~1):
This is equivalent to -(~1). We know ~1 is -2, so this becomes -(-2), which is 2.
The key to understanding these operations is knowing how integers are represented in binary using two's complement, and how the bitwise NOT operation works on these binary representations.
:white_check_mark: Your 3.12 eval job has completed with return code 0.
0b101
||-6||
!e
print(5) # 101
print(~5)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 5
002 | -6
print("hello world")
ones[not 1]
int reportError(std::string filePath, int lineNumber, int start_column, int end_column, std::string msg)
{if (start_column > end_column) // Early return if invalid column integers were provided
{std::cerr << "[reportError] Start Column is bigger than end column" << std::endl;exit(1);return 1;
}
std::fstream file(filePath);
std::string line;
try{line = Utils::readLineFromFile(file, lineNumber);}
catch (std::exception exception){std::cerr << "Issue while reporting error:\n Error reading from file path:" << filePath << "\n";
exit(1);return 1;}
if (!Utils::isAnsiEnabledInConsole()){bool tryEnableANSI = Utils::enableAnsiInConsole(); // return 0 on success and 1 on fail
if (tryEnableANSI == 1)
{std::cout << "ANSI in not enabled in console, for better and more readable error messages, please enable ANSI!\n";
Utils::general_log("ANSI in not enabled in console, for better and more readable error messages, please enable ANSI!");std::cout << "Error on line: " << lineNumber << " " << "Start column: " << start_column << " " << "End column: " << end_column << "\n " << line << "\n " << std::string(start_column - 1, ' ') << std::string(end_column - start_column, '^') << "\n\n"<< msg << std::endl;return 0;
}
}
std::cout << Utils::boldText("File path: ") << Utils::italicText(filePath) << "\n"
<< Utils::boldText(Utils::colorText("Error on line: ", "#fc0313")) << Utils::boldText(std::to_string(lineNumber)) << " " <<Utils::colorText(Utils::boldText("Start column: "), "#ff9752") <<Utils::boldText(std::to_string(start_column)) << " " << Utils::colorText(Utils::boldText("End column: "), "#ff9752") << Utils::boldText(std::to_string(end_column)) << "\n " << Utils::colorText(line, "#a8ff94") << "\n " << std::string(start_column - 1, ' ') << std::string(end_column - start_column, '^') << "\n\n"<< Utils::colorText(msg, "#94b0ff") << std::endl;
return 0;}
why are braces like Lisp's parens
!stream 1028671867785068574 1h
β @misty sinew can now stream until <t:1725305259:f>.
sum(starmap(lshift,
map(itemgetter(slice(None, None, -1)),
enumerate(reversed(list(map(attrgetter('val'),
takewhile(bool,
accumulate(repeat("next"), getattr, initial=head)))))))))
^ real solution to one of Leetcode exercises
@misty sinew
enum class TextStyle {
Heading,
SubHeading,
BodyText,
Caption,
Highlight,
Link
};
// Create a map to associate each TextStyle with a hex color code
std::map<TextStyle, std::string> textStyleColors = {
{TextStyle::Heading, "#FF5733"}, // Orange-Red
{TextStyle::SubHeading, "#33FF57"}, // Green
{TextStyle::BodyText, "#3333FF"}, // Blue
{TextStyle::Caption, "#FF33FF"}, // Magenta
{TextStyle::Highlight, "#FFFF33"}, // Yellow
{TextStyle::Link, "#33FFFF"} // Cyan
};```
std::cout << Utils::colorText("Title", textStyleColors[Heading]);
How to start python
AI-generated documentation is inherently useless
Ok
AI will get obvious generalities and will miss any nuance
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
yep
if you ever ask AI to document an unsafe fn in Rust, it will break your code later on
elaborate
documentation of unsafe fn directly influences correctness of code that depends on it;
because users will look at the ## Safety section to get information on invariants;
AI will get that section wrong. not "may". will.
I have to do more than 50 message how to do that task
to get what invariants are, you need the context of everything inside the module it's defined in
just participate in conversations; you're already half way there
Just chat to people on the server
yes that makes sense
