#voice-chat-text-1

1 messages Β· Page 39 of 1

runic knoll
#

!e print('asdf')

coarse hearthBOT
runic knoll
#

!e

for i in range(4):
  for j in range(i+1):
    print(j+1, end='')
coarse hearthBOT
runic knoll
#

!e
for i in range(4):
for j in range(i+1):
print(j+1, end='')

coarse hearthBOT
runic knoll
#

!e
for i in range(4):
for j in range(i+1):
print(j+1, end='')
print(' ')

coarse hearthBOT
runic knoll
#

!e

for i in range(4):
  for j in range(i+1):
    print(j+1, end='')
  print(' ')
coarse hearthBOT
runic knoll
#

!e

for i in range(4):
  for j in range(i+1):
    print('a', j+1, end='b')
  print('c')
coarse hearthBOT
runic knoll
#

!e

for i in range(4):
  for j in range(i+1):
    print('a'+str(j+1), end='b')
  print('c')
coarse hearthBOT
radiant juniper
#

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

quaint dome
#

' c '

fleet nova
#

0c0

runic knoll
#

<@&831776746206265384> sup mods, can you give @quaint dome streaming rite?

umbral rose
#

!stream 980961294528176170

coarse hearthBOT
#

βœ… @quaint dome can now stream until <t:1724262147:f>.

radiant juniper
#

" i and j"

quaint dome
#

@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

zinc sphinx
#

hi
there
everyone

#

its good

haughty cape
zinc sphinx
#

hi buddy

#

how are you

haughty cape
#

I am fine

#

and u?

#

You are developer too?

#

I am developer.

#

I can do APP, WEB3,Python, WEB and etc

#

and u?

sly pond
#

Web3? Is that really a thing these days? Thought it was just part of the blockchain hype?

spark kestrel
#

@haughty cape broo u really can do python

stuck bluff
#

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.

broken totem
#

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

stuck bluff
#

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.

broken totem
#

thank you very much OpalMist

cinder swan
#

is there any general chats on this servber?

#

server*

cinder swan
#

I dont wanna break any rules

delicate wren
#

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"

delicate wren
#

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

delicate wren
#

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"

sinful patrol
#

Hey everyone

#

I need help

delicate wren
sinful patrol
#

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

delicate wren
#

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

raw wren
#
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

delicate wren
#

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

umbral rose
#

!stream 217691138696413187

coarse hearthBOT
#

βœ… @kindred rapids can now stream until <t:1724465194:f>.

stuck bluff
#

@fervent surge @past remnant πŸ‘‹

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

delicate wren
#

(somewhat lower though)

stuck bluff
stuck bluff
#

What sort of things have you covered so far?

#

goods

past remnant
#

I am in the begining stage yet. I want to learn python and get comfortable with solving problems.

#

@stuck bluff

kindred rapids
#
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> 
delicate wren
#

do it inside async def main

#

then don't use plain bot.run, instead use the async equivalent

stuck bluff
kindred rapids
#
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)
past remnant
stuck bluff
#

Okay, well, there's Corey Schafer, a YouTuber with a lot of tutorial videos.

delicate wren
#

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())
stuck bluff
#

I also recommend people use the documentation available from python.org.

delicate wren
#

(just a general idea)

stuck bluff
#

There's a web-based version of the documentation and a few downloadable versions.

delicate wren
#

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())
delicate wren
#

!intents

coarse hearthBOT
#
Using intents in discord.py

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.

delicate wren
#

@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

delicate wren
#

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

kindred rapids
delicate wren
#

@kindred rapids pkill python

#

unless you have some other python running

royal rivet
#

hello

#

@hoary citrus

hoary citrus
royal rivet
#

hi

#

@hoary citrus Can you open the mic for me?

coarse hearthBOT
#
Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

red sage
#

hi

#

hollup lemme fix some stuff for me

#

!voice

coarse hearthBOT
#
Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

red sage
#

im sorry

#

currently fixing my brainded mic

#

😐

#

yes?

#

sorry

#

nah np

#

im not even gonna turn it on again

#

😐

fair heron
stuck bluff
#

@quasi pelican πŸ‘‹

#

@sudden drift πŸ‘‹

sudden drift
#

what are you writing? a circuit simulator?

fair heron
stuck bluff
#

@frigid geyser πŸ‘‹

crisp crescent
#

They there voice peoples

quartz mist
#

hey

#

Can anyone check it out

crisp crescent
#

I can throw it in a notebook and see for shits and gigles

quartz mist
#

?

#

i kinda need help

ocean mist
#

Btw, Whts difference between python dev and DevOps Eng

#

Who is more needed for projects

crisp crescent
# quartz mist Can anyone check it out

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.

quartz mist
#

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

crisp crescent
# quartz mist Can anyone check it out

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 πŸ™‚

mint lion
#

Can anyone Please help me

umbral rose
#

We're in here @red sage

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()
sly pond
#

So country country country wins the country test?

umbral rose
sly pond
#

just summon the bingbot for the legwork

umbral rose
#

If it errors, then no.

red sage
#

i just wanna know if that is the best way to do that?

mint lion
umbral rose
#

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

crisp crescent
#

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 )

tired summit
#

what circuit are you working on? and how does it relate to the python code?

red sage
#

so sorry guys

#

but i have to be going

crisp crescent
red sage
#

i have some business to do πŸ˜‰

tired summit
crisp crescent
#

Seeing the 1000 + lines made me look this up instead

umbral rose
mint lion
#

Please help me with this coding

crisp crescent
umbral rose
vital mirage
umbral rose
vital mirage
#

then see how many rude comments you would get

sly pond
#

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

umbral rose
#

Back in a bit

crisp crescent
#

I have some PyTorch Exercises i need to get back to πŸ˜›

hoary citrus
#

@umbral rose Hi!

#

Good. How about you?

crisp crescent
#

Ahhh one of these days ill be able to talk lol

#

11 messages i think

#

πŸ™‚

delicate wren
#

@proper ridge not running tests through VSCode test panel just because terminal is more convenient?

proper ridge
#

Also can choose what module to run testers for.

delicate wren
#

the only thing, that I found VSCode-specific run options to be useful for, was cmake (C/C++)

proper ridge
#

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.

quartz mist
#

this is crazy

delicate wren
#

I think I haven't

delicate wren
#

and after learning Git, IntelliJ Git UI feels a bit weird

#

because it's more loose about staging

proper ridge
#

It's comfortable, but it's caused me to neglect the Git commands skill.

delicate wren
#

when I was using VS proper, I only used GitHub Desktop and commands

#

because the alternative (in the IDE) was bad

proper ridge
#

I see.

delicate wren
#

and likely still is

proper ridge
#

Hehehe

crisp crescent
#

I got ben and jerries Brownie in mah freezer @proper ridge

delicate wren
#

it's going to be suboptimal for me to have ice-cream rn

#

(coughing)

#

for three weeks so far

crisp crescent
#

Ill take your cold you can have my bad knee

#

Hmm imagine a python game which emulates the creation of ice cream

delicate wren
crisp crescent
#

Oddly enough

#

That wouldnt be the weirdest thing put inside an MRI.

delicate wren
#

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

#

(second can easily be solved in C, you just need to spend a lot of time)

proper ridge
#
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])
            )
delicate wren
#

use (make) a language which magically optimises this for you

proper ridge
#
 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])
delicate wren
#

(I didn't hear; was gaming)

proper ridge
#

Which feels odd.

delicate wren
#

math is faster than memory lookup

whole cloud
#

Hello

#

Damn I can’t run 8 tabs without lagging

delicate wren
#

"less than 30GB used by the browsers??"

whole cloud
delicate wren
#

okay right now it's not so bad

whole cloud
#

Not so bad????

#

Huhhhh

delicate wren
whole cloud
delicate wren
proper ridge
delicate wren
whole cloud
#

Cursor is ai?

#

What’s that

delicate wren
#

I just looked up Cursor editor

radiant glacier
#

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

delicate wren
#

across one client and two servers

#

if you're wondering what that looks like

#

context switching goes insane on that one

radiant glacier
#

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?

radiant glacier
#

-1?

delicate wren
#

!e

import random
print(*(random.randint(1,5) for _ in range(20)))
coarse hearthBOT
delicate wren
#

values from 1 to 5

#

whereas indices go from 0 to 4

radiant glacier
#

ohhh

delicate wren
#

!e

friends = ["Alice", "Bob", "Charlie", "David", "Emanuel"]
print(friends[1])
coarse hearthBOT
radiant glacier
#

so its not choosing one of the 5 because of the rand choice

delicate wren
#

!e

friends = ["Alisa", "Bob", "Charlie", "David", "Emanuel"]
print(friends[0])
coarse hearthBOT
delicate wren
#

!e

friends = ["Alisa", "Bob", "Charlie", "David", "Emanuel"]
print(friends[5])
coarse hearthBOT
radiant glacier
#

alice is 0 is what you are saying? so theyll never be picked?

delicate wren
#

$1B for nothing: "that's called NFTs"

delicate wren
#

and would crash sometimes

#

when 5 is rolled

radiant glacier
#

AHHH

#

so why -1 rather than 0?

#

just out of curiosity

delicate wren
radiant glacier
#

oh so 0,5 will be fine

delicate wren
#

[0,5)

radiant glacier
#

perfect

delicate wren
#

.randint(0, 4)

#

or

radiant glacier
#

thank you!

delicate wren
#

.randrange(5)

#

both generate from 0 to 4

radiant glacier
#

yeah still new only started learning today

#

hahaha

delicate wren
#

!e

import random
friends = ["Alisa", "Bob", "Charlie", "David", "Emanuel"]
print(*(random.randrange(len(friends)) for _ in range(20)))
coarse hearthBOT
radiant glacier
#

LOL

#

whoever said that lol

#

read me bedtime stories 😍

#

right peace peace ty again!

delicate wren
#

@umbral rose I have an idea on how to make that CSS challenge more difficult

#

code needs to be AI-generated

proper ridge
delicate wren
proper ridge
#

Hehehe

delicate wren
#

chatgpt and phind do

#

idk about others

proper ridge
#

I remember there was this research on implementing an invisible marker for AI generated content. Don't know what happened with that.

delicate wren
#

probably many do

proper ridge
#

To tell if sth is AI generated or not.

delicate wren
#

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

proper ridge
#

I remember sth vaguely.

#

I would be down to chip in to host a big model with a few of you guys.

misty sinew
delicate wren
#

I've heard of supermaven

#

haven't used

delicate wren
proper ridge
#

That's a first. Gotta document this moment.

delicate wren
#

(well, AI failed, I just didn't bother retrying)

#

/opt/random-garbage

#

/usr/local seems more sane than /bin indeed

proper ridge
#

I put my stuff in /home.

delicate wren
#

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

misty sinew
#

well yes

#

ofcorse but it mainly works

#

and for the few parts that dont work I can get work arounds

delicate wren
#

(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

delicate wren
proper ridge
#

I'm gonna go sleep. Blessed day to everyone.

delicate wren
#

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

delicate wren
umbral rose
#

uhhh

delicate wren
#

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)
coarse hearthBOT
delicate wren
#

!e

x = 0.0
for _ in range(10):
    x *= 10
    x += 9
print(x)
coarse hearthBOT
delicate wren
#

!e

x = 0.0
for _ in range(16):
    x *= 10
    x += 9
print(x)
coarse hearthBOT
delicate wren
#

hm

#

that

#

!e

x = 0.0
for _ in range(18):
    x *= 10
    x += 9
print(x)
coarse hearthBOT
delicate wren
#

!e

x = 0.0
for _ in range(17):
    x *= 10
    x += 9
print(x)
coarse hearthBOT
delicate wren
#

hmm

#

it works for 16

misty sinew
#

@umbral rose

#

Just started a new project

delicate wren
#

I, unfortunately, need to close the game to try that AI thing

misty sinew
#

can i stream it?

#

YAY

umbral rose
#

!stream 1028671867785068574

coarse hearthBOT
#

βœ… @misty sinew can now stream until <t:1724614612:f>.

delicate wren
#

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

ornate cobalt
delicate wren
#

at least visually

#

shouldn't tokens be tokenised by a tokeniser

#

I might've shown that one before

#

sadly that one is actual okay code so I can't get anything by flattening it

ornate cobalt
delicate wren
# umbral rose whoa

I like that code because all logic is localised enough and easy to check for correctness

#

@ornate cobalt fn had different error

misty sinew
#

@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

umbral rose
#

!stream 1028671867785068574

coarse hearthBOT
#

βœ… @misty sinew can now stream until <t:1724616155:f>.

misty sinew
#

the force mute is cancer

delicate wren
#

!voice

coarse hearthBOT
#
Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

misty sinew
#

!voice

delicate wren
#

already passing time and blocks requirement

misty sinew
#

currently doing clothes and cant think over the washing machine

delicate wren
#

@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

ornate cobalt
#
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;
delicate wren
#

uh

#

I don't remember

#

definitely missing some punctuation

radiant glacier
#

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

misty sinew
#

%

ornate cobalt
#

Search up the modulus operator and you will know what to do

radiant glacier
#

i used modulus for odds and evens

delicate wren
#

@ornate cobalt

typedef enum {
    TK_Flag,
    TK_String,
    TK_Identifier
} TokenKind;


typedef struct {
    TokenKind type;
    union {
        char *as_string;
        char *as_identifier;
    };
} Token;
ornate cobalt
#

it works to check the remainder of division which happens to show even or oddity by /2

radiant glacier
#

alright ill take a look ty

delicate wren
#

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

ornate cobalt
#
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;
delicate wren
#

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

coarse hearthBOT
delicate wren
#

sha256, sha512

#

sha384 too I think

#

family

#

no

#

it wasn't

#

sha1 was broken

delicate wren
#

no collisions for sha2 and sha3 have been publicly discovered

misty sinew
#

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...

delicate wren
#

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)
coarse hearthBOT
delicate wren
#

hash that many and you're guaranteed to find at least one

misty sinew
#

b

#

abcdefghijklmnopqrstuvwxyz

delicate wren
#

tuvw

#

ijklmnop(q)rstu part is common with Russian

#

no wonder rust-analyzer just gives up

misty sinew
#

!e

helloworld(print)
coarse hearthBOT
# misty sinew !e ```py 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
delicate wren
#

@ornate cobalt you can force push a tag

#

but some git hosts hate it

#

delete then retag is more reliable

misty sinew
#

@delicate wren
is our general ChatGPT 10

delicate wren
#

for updating release message, you can freely edit that in the web UI

hearty heath
#

πŸ‘‹

delicate wren
#

I have a tool for retagging 1 and 1.0 when new 1.0.X gets tagged

hearty heath
#

Always have been πŸ‘€

#

Yep

delicate wren
hearty heath
#

Oh yeah

ornate cobalt
misty sinew
#

this voice control stuff is annoying and accomplishes nothing

#

chat gpt is ass

ornate cobalt
misty sinew
#

so what is this?

delicate wren
misty sinew
#

@umbral rose Can I get stream again...? grumpchib

delicate wren
#

khan academy?

misty sinew
#

handmade hero is a good one for C++ gamedev @ornate cobalt

delicate wren
#

(I missed like 95% of the context)

hearty heath
#

!stream 1028671867785068574 1h

coarse hearthBOT
#

βœ… @misty sinew can now stream until <t:1724622873:f>.

misty sinew
misty sinew
delicate wren
#

error handling is on programmer not QA

#

QA is only about finding errors

umbral rose
#

tests are not written by qa

delicate wren
#

even if those two are the same person

delicate wren
#

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

misty sinew
#

@ornate cobalt

#

You kmow this guy?

ornate cobalt
#

yeah

misty sinew
#

cool

umbral rose
#

g2g cut the grass. back in a bit

ornate cobalt
delicate wren
#

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)

misty sinew
#

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

ornate cobalt
#

Yeah that's why I said (*pos)++

#

But good job man

warm zenith
#

whhy i cant open mic

stuck bluff
#

@warm zenith πŸ‘‹

#

!voice

warm zenith
coarse hearthBOT
#
Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

stuck bluff
#

@hybrid tree πŸ‘‹

hybrid tree
#

Hi

#

Have are you?

red sage
#

@stuck bluff

#

i fixed the code i was having problem with btw

#

can i show u another one?

stuck bluff
#

If you need to. πŸ™‚

red sage
#
#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()
stuck bluff
red sage
#

oh

stuck bluff
#

Currently.

#

But please, don't allow me to impede you.

red sage
#

np

#

anyways what u think of the code?

#

is it good or naw

stuck bluff
#

To be honest, I'm a little amped up for your progress.

#

@next zealot πŸ‘‹

next zealot
#

hi

stuck bluff
red sage
#

yes

#

i ask if it is good

#

bcs when i fix it

#

i learn more

stuck bluff
#

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)```

coarse hearthBOT
stuck bluff
#

!e ```py
def gen():
yield 1
yield 2
yield 3

g = gen()
print(g)
for v in g:
print(v)```

coarse hearthBOT
stuck bluff
#

!e ```py
def gen():
yield from (1, 2)
yield 3

for v in gen():
print(v)```

coarse hearthBOT
stuck bluff
#

!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)```

coarse hearthBOT
stuck bluff
#

!e ```py
def func(list_):
list_.append(123)

my_list = []
func(my_list)
print(my_list)```

coarse hearthBOT
elder wraith
#

!e ```python
def func(list_):
list_.append(123)
return None

my_list = []
func(my_list)
print(my_list)```

coarse hearthBOT
stuck bluff
#

!e py my_list = [3, 1, 2] print(my_list.sort()) print(my_list)

coarse hearthBOT
elder wraith
#

!e ```python
def func(list_):
list_.append(123)
return None

my_list = []
a = func(my_list)
print(my_list)```

coarse hearthBOT
elder wraith
#

!e ```python
def func(list_):
list_.append(123)
return None

my_list = [1,2,3]
a = func(my_list)
print(my_list)```

coarse hearthBOT
elder wraith
#

!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)```

coarse hearthBOT
stuck bluff
#

!e ```py
import random

my_list = [*range(10)]
random.shuffle(my_list)
print(my_list)```

coarse hearthBOT
elder wraith
#

Explicit is better than implicit.

ocean mist
#

Any way to create dict with that {**range(15)}

#

any

stuck bluff
#

!e py d = {k: v for k, v in enumerate('abc')} print(d)

coarse hearthBOT
elder wraith
#
import requests

class Main:
  def __init__(self):
    get_config_stuff()

  def main(self):
    do_main_thing()

if __name__ == "__main__":
    Main().main()```
stuck bluff
#

@royal rivet πŸ‘‹

royal rivet
#

@stuck bluff 🫱

#

@stuck bluff Can you play the mic for me?

stuck bluff
#

!voice

coarse hearthBOT
#
Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

terse sierra
#

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

thin lintel
#

2 days of not eating will kill

#

Cats need to pee/poo and eat everyday

#

Maybe too much meds during the surgery

terse sierra
#

so was it complications from anesthesia ?

thin lintel
#

The meds have to be reversed after

#

Could be

#

Could also be other issues

#

Like kidneys could not handle it

terse sierra
#

if kitty has a heart defect and has ANS ... could it ?

thin lintel
#

Could be related

terse sierra
#

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

red sage
#

HI @stuck bluff

#

np

#

also can u look at this code

terse sierra
#

can koala bears be vicious ? @stuck bluff

#

Terrible Teddys

red sage
#

repeat pls

#

mhm

#

true

#

i think

#

maybe

#

this night

#

i will learn like

#

how

thin lintel
red sage
#

to access exteranl thingy

#

oh YA

#

sorry

#

i keep forgeting

#

ya sorry bout that

#

@thin lintel ya sorry about that

terse sierra
#

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

stuck bluff
#

Lazy dog:

red sage
#

LOL

#

@stuck bluff i keep getting this problem

#
  1. hamburger ($15)
    2 .salad($20)
  2. coca-cola($5)
  3. fries($10)
  4. shake($18)
  5. hamburger ($15)
    2 .salad($20)
  6. coca-cola($5)
  7. fries($10)
  8. shake($18)
#

its repeating them 😐

terse sierra
#

feline leukemia ?

red sage
#

@stuck bluff ight

#

np

terse sierra
#

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

versed elk
past remnant
#

anybody in voice??

past remnant
#

hello

coarse hearthBOT
#

: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.

misty sinew
#

For example

#

Nvm i forgot im rusty

tranquil thistle
#

you mean

#
for i in menu:
  print(i)
coarse hearthBOT
#

: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.

red sage
misty sinew
delicate wren
#

where build.zig

glass trout
#

This is the Rocket League AI server

#

they have a Python section

misty sinew
#

!rule 6

coarse hearthBOT
#

6. Do not post unapproved advertising.

delicate wren
#

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

delicate wren
#

there is a fork though

proper ridge
#

!pypi pyan

coarse hearthBOT
#

Animation with turtle.

Released on <t:1614393995:D>.

umbral rose
delicate wren
#

"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)

umbral rose
#

!stream 1028671867785068574 1h

coarse hearthBOT
#

βœ… @misty sinew can now stream until <t:1725300306:f>.

delicate wren
obtuse valve
#

i dont really understand the difference between staticmethod and classmethod

#

iirc staticmethod doesnt even need an instance to work

#

(if so, whats the point)

misty sinew
misty sinew
#

You can use this to perhaps organize methods

delicate wren
hoary citrus
obtuse valve
gilded urchin
#

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)

obtuse valve
delicate wren
delicate wren
obtuse valve
#

i dont get how it helps code org

delicate wren
#

to make it clear the function is related to the class

gilded urchin
delicate wren
#

e.g. when it's a private implementation detail that is only relevant to that class

obtuse valve
#

like if its private just prefix with _?

#

well you can use getters and setters

gilded urchin
#

This is c++ atm, not python IIRC

delicate wren
hoary citrus
#

@warped canopy Do you have any question? You can ask here

delicate wren
#

?

#

how are those even related to the topic?

#

don't mix property with staticmethod and/or classmethod, if that's the question

obtuse valve
#

like if its private it can only be accessed through authorised means, ie through getters and setters?

misty sinew
#

Lets goo

#

multi char error specification

gilded urchin
misty sinew
gilded urchin
#

IDK what the project is supposed to be doing XD

#

Is this looking for python errors?

misty sinew
#

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;
}
gilded urchin
#

Ahhh okay. I suppose that makes sends

delicate wren
#
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

gilded urchin
#

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

misty sinew
gilded urchin
#

So kind of like a Python interpreter, but mostly focused on parsing the lines

#

or like, almost a compiler?

misty sinew
#

idk

#

just a little experiment

gilded urchin
#

Cool shit. πŸ™‚

hoary citrus
#

@warped canopy !res

coarse hearthBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

warped canopy
#

how to talk in discord main server

delicate wren
#

!voice

coarse hearthBOT
#
Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

gilded urchin
warped canopy
#

what do u mean

delicate wren
warped canopy
#

it said

delicate wren
#

you already meet the time requirement

warped canopy
#

more than 50 messages

gilded urchin
#

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

delicate wren
#

so just engage in converstations using text for now

warped canopy
#

ye

#

yes

#

sure

delicate wren
#

not like there's anything happening in voice right now anyway Β―_(ツ)_/Β―

gilded urchin
delicate wren
#

5/9 people have mic permissions

warped canopy
#

really

misty sinew
#

whats going up

#

in vc

umbral rose
#

Sorry, g2g

delicate wren
misty sinew
#

midful dev

umbral rose
#

had to unstream you @misty sinew

misty sinew
warped canopy
#

why some bad noice coming

misty sinew
#

i wanted to steam

misty sinew
umbral rose
#

back in an hour

gilded urchin
misty sinew
#

chaperone πŸ’€

gilded urchin
#

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

misty sinew
gilded urchin
#

summer is feeling like its coming to an end 😦

warped canopy
#

it

smoky mountain
#

noice

misty sinew
gilded urchin
#

not shit my dude!

smoky mountain
#

sorry

gilded urchin
#

this is like 90% more development than most projects get to XD

delicate wren
#

time to waste a few minutes on coming up with adequate names for CSS vars I use

delicate wren
#

no

#

ChatGPT is not good enough

gilded urchin
#

XD

glass trout
#

Claude

delicate wren
coarse hearthBOT
#

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));```
gilded urchin
#

radius, gravity ?

delicate wren
#

idk why --g is even there

gilded urchin
#

Give them mortal kombat names. Raiden, Goro, Liu Kang!

delicate wren
warped canopy
#

i have to send more than 50 messages only

gilded urchin
#

It's probably interactive

delicate wren
#

this is literally just an automatically-sized grid

#

that's all it does

gilded urchin
#

Can you name scope it?

#

This is like that guy's 1 million checkmarks thing

glass trout
#
.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;
}```
glass trout
#

Yea

#

πŸ™‚

gilded urchin
#

Not good enough

#

hahaha

coarse hearthBOT
#

: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.

gilded urchin
#

It literally says don't spam lol

delicate wren
misty sinew
gilded urchin
#

I cant do the ofrtmatting

delicate wren
#

column-adjustment
that one is wrong too

#

it's adjusted-column-count, just like the previous two

umbral rose
#

@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.

delicate wren
#

like this is not where I'd expect the AI to fail, so didn't notice at first

glass trout
#

Lol was that Mortal Kombat names you used?

gilded urchin
#
  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?

delicate wren
#

allegedly there are ways to make it work better

#

but I don't use AI so I don't know

gilded urchin
#

If its any consolation, all of the legacy code I work on used to have constrained variable name lengths

delicate wren
#

use @crisp hazel, do not repost

#

mods are getting pinged for this I think

#

as in not you

gilded urchin
#

the var name length was constrained to like, 3 or 4 chars max? So everything is "a", "b", "aa", "x1", "x2" etc

delicate wren
#

but the original message

delicate wren
#

or obfuscated? lmao

gilded urchin
#

its because it was ported from fortran in like 1990

delicate wren
#

yeah, I'd expect that given Fortran

delicate wren
#

I anticipated it being quite worse

misty sinew
delicate wren
#

that sure looks like APL

misty sinew
warped canopy
#

hi guys

delicate wren
delicate wren
misty sinew
#

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"]))
coarse hearthBOT
delicate wren
#

all(map(1 .__eq__, _n))

misty sinew
#

~

delicate wren
#

bitwise not

gilded urchin
#

def allOnes(_n:list[int])->bool:return(np.sum(ones)==len(ones))

delicate wren
#

!e

print(~-1)
coarse hearthBOT
delicate wren
#

-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)
coarse hearthBOT
gilded urchin
#

ones[not 1]

misty sinew
#
  1. print(-1):
    This is straightforward negation. It simply outputs -1.

  2. 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.

  3. print(~-1):
    In binary, -1 is represented as all 1s (...1111).
    Bitwise NOT flips all these 1s to 0s, resulting in 0.

  4. 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.

delicate wren
#

101

#

!e

print(bin(5))
coarse hearthBOT
delicate wren
#

||-6||

misty sinew
#

!e

print(5) # 101
print(~5)
coarse hearthBOT
delicate wren
#

...11111111111111010

#
...11111111111111010
+                110
warped canopy
#

print("hello world")

gilded urchin
#

ones[not 1]

delicate wren
#

first element

#

no elements => all elements are 1

#

IndexError case

misty sinew
#
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;}
delicate wren
#

why are braces like Lisp's parens

umbral rose
#

!stream 1028671867785068574 1h

coarse hearthBOT
#

βœ… @misty sinew can now stream until <t:1725305259:f>.

delicate wren
#
sum(starmap(lshift,
  map(itemgetter(slice(None, None, -1)),
    enumerate(reversed(list(map(attrgetter('val'),
      takewhile(bool,
        accumulate(repeat("next"), getattr, initial=head)))))))))
delicate wren
gilded urchin
#

@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
};```
misty sinew
#
std::cout << Utils::colorText("Title", textStyleColors[Heading]);
gilded urchin
#

ThemeStyle::Headingh

#

textStyleColors[ThemeStyle::Heading]

warped canopy
#

How to start python

delicate wren
#

AI-generated documentation is inherently useless

warped canopy
#

Ok

delicate wren
#

AI will get obvious generalities and will miss any nuance

delicate wren
coarse hearthBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

delicate wren
warped canopy
#

Can I learn python in 1 weak

#

Week

#

I know basics

#

Some

#

Basics

delicate wren
#

if you ever ask AI to document an unsafe fn in Rust, it will break your code later on

delicate wren
#

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.

warped canopy
#

I have to do more than 50 message how to do that task

delicate wren
#

to get what invariants are, you need the context of everything inside the module it's defined in

delicate wren
umbral rose