#development

1 messages · Page 216 of 1

lyric mountain
#

olha, eu vou tentar te explicar bem detalhado

#

a combinação \0 significa full match

#

ou seja

#

Olá Mundo \0 ia tentar dar match em Olá Mundo Olá Mundo

#

eu ja te disse varias vezes pra passar apenas oq ta dentro das chaves ao invés do texto inteiro

#

regex tem replace-in-place

#

vc simplesmente itera sobre os matches

urban delta
#

eh, vou ter que usar uma máscara temporária

lyric mountain
#

n carai

#

aplica o regex no texto, e vai iterando sobre os matches

#

vc literalmente consegue ir de 1 em 1 e ir pegando os valores diretamente

#

esse é o texto do exemplo text = 'find a replacement for me [[:a:]] and [[:b:]]'

#

ele ta substituindo oq ta dentro de [[]]

#

usando uma função pra processar o conteudo

#

é literalmente oq vc ta tentando fzer

urban delta
#

uhmm, n sei se consigo fazer isso com texto pré-feito

#

pois os cara pode criar diversos macros

#

cada um com um código diferente

eternal osprey
#

I love spanish

urban delta
#

desta vez tirei o bagulho

eternal osprey
#

Such a beautifl langauge

quartz kindle
#

:^)

eternal osprey
#

?

urban delta
#
### This part is making use of space easier to handle, so there is no need to always type \0
    ### forhandling wise
    pattern = r"\[(.*?)\]"
    pivots = re.findall(pattern, macro)
    for num, i in enumerate(pivots):
        piv = i
        macro = macro.replace(f"[{i}]", f"[{num}]")
        piv2 = re.findall(piv, r"\{(.*?)\}")
        print(f"{piv = }")
        print(f"{piv2 = }")
        for num2, j in enumerate(piv2):
            piv3 = j
            note = ["{", "}"]
            piv = piv.replace(f"{note[0]}{j}{note[1]}", f"{note[0]}{num2}{note[1]}")
            piv = piv.replace(" ", "<xxspacematchxx>")
            piv = piv.replace(f"{note[0]}{num2}{note[1]}", f"{note[0]}{piv3}{note[1]}")
        macro = macro.replace(f"[{num}]", f"[{piv}]")

    macro = macro.replace("<xxspacematchxx>", "\\0")
#

desta vez sem wild cards

eternal osprey
#

I genuinely thing that

#

think

quartz kindle
#

confusing portuguese and spanish is a well known way to troll portuguese/brazilian people

urban delta
#

somente usando quando n estiver usando regex

eternal osprey
eternal osprey
#

Spanish is basically portugese on steriods

urban delta
sharp geyser
#

I guess a good bit of the words look similar, but in reality it's not

#

at least from what i've seen

lyric mountain
eternal osprey
#

@sharp geyser Have you looked into fixing your dataset?

quartz kindle
lyric mountain
#

meu amigo, vc ainda n entendeu oq eu quero dizer

sharp geyser
#

I am also juggling multiple projects rn

eternal osprey
#

😭

eternal osprey
#

Yeah it ain't worth it then lmao

sharp geyser
#

what isnt

quartz kindle
#

huehuehue

lyric mountain
#

eu tbm n

#

to tentando explicar pra ele q ele n precisa jogar o texto inteiro no parser, é só usar regex pra fzer replace-in-place

eternal osprey
#

Your site is very cool! I lived in spain for a few months so i can read it kinda

lyric mountain
#

mas ele ainda n entendeu

sharp geyser
eternal osprey
sharp geyser
#

Oh sure ig

eternal osprey
#

I would recommend you to look into creating a bigger and more versatile databset

sharp geyser
#

I have a larger dataset now

lyric mountain
eternal osprey
#

Because the hyperparameters are already pretty good using the gridsearch i applied

quartz kindle
#

there i helped

sharp geyser
#

1k of each level

#

There is just some duplicates so I gotta filter them out

urban delta
#

mas tipo, e se eu tiver criando algo que usa um tipo de string diferente

eternal osprey
urban delta
#

no caso, pode ser qualquer coisa na string

eternal osprey
#

to filter out entries

urban delta
#

tipo, pode ser [Olá 25 mundos]

lyric mountain
#

os seus comandos sempre vão estar entre {} n?

urban delta
eternal osprey
#

The rest should be pretty good to be fair. What you can do is increase the amount of layers and densities of the neural network to make the genetaliziarions better but watch out for overfitting

lyric mountain
#

ENTÃO

urban delta
#

minha string inteira e o comando

lyric mountain
#

é pra vc dar match no {}

#

esquece o resto

#

oq eu to te falando é pra vc usar o regex pra pegar esses grupos ESPECIFICAMENTE

#

AI vc passa o conteudo de dentro pro parser

#

e devolve pro texto original

#

é pra fzer isso antes de qualquer outra coisa

urban delta
#

como tiro isso daqui

#

que n era pra aparecer?

lyric mountain
#

n sei, vc apertou alguma coisa

urban delta
#

n sei o que apertei

#

apertei alguma coisa sem querer

#

e apareceu

#

n lembro o que ér

civic scroll
#

what

lyric mountain
civic scroll
urban delta
civic scroll
#

you didn't hear it wrong

lyric mountain
#

I made it in a rush just cuz I needed a frontpage

civic scroll
#

it worked

lyric mountain
#

vc da o conteudo pro parser, dps devolve pra função pro regex por no lugar

civic scroll
#

kuu i'm hearing those messages
i'm chuckling so hard for some reasons

lyric mountain
#

it's complicated

civic scroll
lyric mountain
#

yes, they're trying to apply regex on a text that contains \0

#

which ofc ain't working cuz it's a reserved wildcard

civic scroll
#

null byte match?

lyric mountain
#

full-match group lookbehind

civic scroll
#

would \x00 work?

#

assuming it's PCRE

#

iirc you can match by char code (hex, unicode)

lyric mountain
#

oh no, it's another thing entirely

#

Like this text with { smth }

#

they want to evaluate what's inside {}

#

but their parser doesn't work with spaces

civic scroll
#

are they making a language parser?

lyric mountain
#

so they're replacing it with \\0

civic scroll
lyric mountain
#

Like\\0this\\0text\\0with\\0{\\0smth\\0}

civic scroll
#

wait

#

why can't they use space?

lyric mountain
#

idk

#

but well, then they're passing the whole thing to the parser

civic scroll
#

if they really wanna do that

#

replace the \\0 with something very high in value

lyric mountain
#

I told them, but they insist in that specific thing

civic scroll
#

eg. \uffff (if it supports unicode)

#

or use one of the reserved ascii codes

#

or just use space

#

treat 0x20 as if it's a special token like \\0

civic scroll
#

was about to say they might want to do lexer + AST since it looks like they are making a scripting language

#

AST is hard for me however

urban delta
#

like

civic scroll
urban delta
#

Hello 20 worlds becomes Hello20worlds

urban delta
#

cus of Lark

civic scroll
#

replace with one of reserved ASCII codes

urban delta
#

i see, but lark would use that as an error

#

or would just keep the same behavior

#

unless i test it here rq

civic scroll
#

try it

urban delta
#

i remember now

#

lark don't support ASCII

civic scroll
#

we need to use at least one character outside of your character range that is valid to it

urban delta
#

cus if it do

civic scroll
urban delta
#

all that belongs to english char set

#

no ç

#

no ñ

#

no ó

#

no ã

civic scroll
#

ASCII

#

it doesn't support unicode?

urban delta
#

what is unicode?

civic scroll
#

that's... very weird for a web application

civic scroll
civic scroll
urban delta
#

that's Lark

civic scroll
#

これも, those are also in unicode

#

oh

urban delta
#

yeah don't support

civic scroll
#

called themselves "enterprise" OMEGADANCE

urban delta
#

i had to jurry rig it to make those characters work

#
async def conversor(macro: str):
    ### This part is ASCII transformation
    # special characters
    macro = macro.replace("ç", r"{ cid }")

    # punctuation
    macro = macro.replace("à", r"{ ` a }")
    macro = macro.replace("è", r"{ ` e }")
    macro = macro.replace("ì", r"{ ` i }")
    macro = macro.replace("ò", r"{ ` o }")
    macro = macro.replace("ù", r"{ ` u }")

    macro = macro.replace("á", r"{ ´ a }")
    macro = macro.replace("é", r"{ ´ e }")
    macro = macro.replace("í", r"{ ´ i }")
    macro = macro.replace("ó", r"{ ´ o }")
    macro = macro.replace("ú", r"{ ´ u }")

    macro = macro.replace("ã", r"{ ~ a }")
    macro = macro.replace("ñ", r"{ ~ n }")
    macro = macro.replace("õ", r"{ ~ o }")

    macro = macro.replace("â", r"{ ^ a }")
    macro = macro.replace("ê", r"{ ^ e }")
    macro = macro.replace("î", r"{ ^ i }")
    macro = macro.replace("ô", r"{ ^ o }")
    macro = macro.replace("û", r"{ ^ u }")

    # positional symbols
    macro = macro.replace("ª", r"{ pos-a }")
    macro = macro.replace("º", r"{ pos-o }")
    macro = macro.replace("°", r"{ deg }")

    # inverted punctuations
    macro = macro.replace("¡", r"{ invert ! }")
    macro = macro.replace("¿", r"{ invert ? }")

    return macro
#

that's my jurry rig to enable compatibility with unicode

civic scroll
#

😔

urban delta
civic scroll
#

also

#

can you modify the whitespace rule?

#

like choosing not to join it when encountering one

#

another option is to preprocess it before passing into lark

urban delta
#

that's what i'm doing

#

pre-processing it

civic scroll
#

i ran out of options, since i don't have any knowleghe about it

civic scroll
urban delta
#

that's what i'm trying it here

#
### This part is making use of space easier to handle, so there is no need to always type \0
    ### forhandling wise
    pattern = r"\[(.*?)\]"
    pivots = re.findall(pattern, macro)
    for num, i in enumerate(pivots):
        piv = i
        macro = macro.replace(f"[{i}]", f"[{num}]")
        piv2 = re.findall(piv, r"\{(.*?)\}")
        print(f"{piv = }")
        print(f"{piv2 = }")
        for num2, j in enumerate(piv2):
            piv3 = j
            note = ["{", "}"]
            piv = piv.replace(f"{note[0]}{j}{note[1]}", f"{note[0]}{num2}{note[1]}")
            piv = piv.replace(" ", "<xxspacematchxx>")
            piv = piv.replace(f"{note[0]}{num2}{note[1]}", f"{note[0]}{piv3}{note[1]}")
        macro = macro.replace(f"[{num}]", f"[{piv}]")

    macro = macro.replace("<xxspacematchxx>", "\\0")
#

i'm gonna try the Kuuhaku way

civic scroll
#

best of luck

urban delta
#

@lyric mountain how do i match multiple groups in a function for regex?

urban delta
lyric mountain
#

The re.sub will iterate over each group

#

What do u mean "match multiple groups"?

urban delta
#

essa coisa aqui:

#

tipo, acho que isso só agrupa 1 grupo só

#

ae queria ver se dá pra fazer com vários

lyric mountain
#

Em regex um grupo é definido por ()

#

A ordem é da direita pra esquerda, de fora pra dentro

#

Pq vc precisaria de varios?

#

No seu caso é só 1 n?

urban delta
#

eh eu percebi que n preciso

#

então só faço isso neh?

#

@lyric mountain

lyric mountain
#

N

#

É pra vc dar match nas chaves

#

N no espaço

#

Eu falei pra vc usar isso especificamente pra pegar apenas oq é pra ser executado

#

Alias match.group(1) n vai existir se vc n declarou nenhum grupo

urban delta
#

eu peguei isso por conta disso daqui:

#

tem o m.group(1)

lyric mountain
#

Vc tem q entender oq ele ta fzendo ai

#

N é só copiar

#

Ele pegou o grupo 1 pq o grupo 1 da declarado la em baixo

#

(.+?)

urban delta
#

então é mais de 1 grupo

#

1 ou mais

lyric mountain
#

N

#

No seu caso vc precisa usar o regex \\{ *(.+?) *\\}

#

Pra pegar o conteúdo dentro das chaves

urban delta
#

esse regex aqui? \{(.*?)\}

lyric mountain
#

N, o q eu digitei

#

Pq vc pode ter espaço entre a chave e o comando

urban delta
#

como adcionarei ali?

#

só usar o re.findall?

lyric mountain
#

Desisto

urban delta
#

tipo, vc me falou pra adcionar o regex

lyric mountain
#

Mano eu te dei a manteiga, o pão e a faca

#

Mas vc ta tentando passar a manteiga na parede

#

Pega o re.sub, coloca o regex q eu te passei e pronto

#

A função q vc passa pra ele vai rodar pra cada match

#

N tem truque, traduz a pagina do stackoverflow qlqr coisa

#

Mas eu n sei como te explicar de forma mais simples q isso

quartz kindle
quartz kindle
#

can anyone confirm im doing this right?

#
x**5 + (u - 3)*x**4 + (3 - u*2)*x**3 - u*x**2 + u*2*x - u
wheat mesa
#

looks right to me

solemn latch
#

Yep its in parenthesis.
(u - 3)

#

lol

quartz kindle
#

thanks

#

got my function working, not best pefromance tho

#

might try a ternary search instead of binary

wheat mesa
#

What are you trying to do specifically

#

(I imagine that is a packed question)

quartz kindle
#

L1 point is the point of gravitational stability between two masses, ie the exact point between the sun and the earth where their gravity cancels out each other

wheat mesa
#

Ah I see

#

I vaguely remembering doing solutions to this by hand when I was writing tests for my physics simulator

#

Granted they were much simpler than a quintic because I was only doing two dimensions

quartz kindle
#

this is the function i came up with

#
function L1Exact(p1, p2, dist) {
    const u = p2 / (p1 + p2);
    let r = Math.cbrt(u/3) * dist;
    let r1 = r + r/2;
    let r2 = r - r/2;
    let x1 = r1 / dist;
    let x2 = r2 / dist;
    let t1 = x1**5 + (u - 3)*x1**4 + (3 - u*2)*x1**3 - u*x1**2 + u*2*x1 - u;
    let t2 = x2**5 + (u - 3)*x2**4 + (3 - u*2)*x2**3 - u*x2**2 + u*2*x2 - u;
    for(let i = 0; i < 100; i++) {
        const m = (r1 + r2) / 2
        const mx = m / dist;
        const mt = mx**5 + (u - 3)*mx**4 + (3 - u*2)*mx**3 - u*mx**2 + u*2*mx - u;
        if(mt === 0) {
            return m;
        }
        if(Math.sign(mt) === Math.sign(t1)) {
            r1 = m;
            t1 = mt;
        } else {
            r2 = m;
            t2 = mt;
        }
    }
}
#

its basically a binary search to solve for r from an initial r estimate

wheat mesa
#

I'd imagine there's a way to write a solution to this as a function, since there is in theory a ring of gravitational stability around a given mass

quartz kindle
#

yes there is this one

#

which is what i use to get the initial estimate

#

the margin of error seems to be around 0.01 million kilometers

wheat mesa
#

Not bad

#

Are these two points assuming either body has no velocity?

#

Since that matters for problems to do with centripetal acceleration

quartz kindle
#

it says it accounts for centripetal force

wheat mesa
#

Perhaps I'm not fully understanding the model of the problem

quartz kindle
#

Lagrange points are the constant-pattern solutions of the restricted three-body problem. For example, given two massive bodies in orbits around their common barycenter, there are five positions in space where a third body, of comparatively negligible mass, could be placed so as to maintain its position relative to the two massive bodies. This occurs because the combined gravitational forces of the two massive bodies provide the exact centripetal force required to maintain the circular motion that matches their orbital motion.

Alternatively, when seen in a rotating reference frame that matches the angular velocity of the two co-orbiting bodies, at the Lagrange points the combined gravitational fields of two massive bodies balance the centrifugal pseudo-force, allowing the smaller third body to remain stationary (in this frame) with respect to the first two.

wheat mesa
#

Oh it's a 3 body problem

#

I was imagining something like this, a more simple diagram

#

The velocity of the moon here would matter because if it had 0 initial velocity it would just get pulled into the sun

quartz kindle
wheat mesa
#

Yeah this is famously complex

quartz kindle
#

i guess i got it working for L1, now for L2 and L3 should be similar

#

then L4 and L5 are literally an equilateral equidistant triangle, or exactly 60 deg ahead and behind, from what i understand

#

also, things i learned today, the nth root of a number is equal to the power of 1/n of that number

wheat mesa
#

Yup

#

5th root = to the power of 1/5

quartz kindle
#

ye

#

i was confused because the formula shows a cubic root, but chatgpt gave me code with Math.pow

wheat mesa
#

Another one is x^-n = 1/(x^n)

quartz kindle
#

lmao

wheat mesa
#

Exponents are fun

quartz kindle
#

no idea what that one means

#

negative powers are equal to division by that power?

wheat mesa
quartz kindle
#

so negative power of a number = 1 divided by positive power of that number

wheat mesa
#

Yup

quartz kindle
#

cool

#

i will probably not remember this

#

xD

solemn latch
#

Is this for a bot? 👀

wheat mesa
#

Math is really fun, especially calculus

#

There's tons of little things that seem counterintuitive but turn out to be really elegant

quartz kindle
solemn latch
#

Ah neat!

quartz kindle
#

i still need to figure out how to use hyperbolic orbits

wheat mesa
warm imp
#

Are all these files and folders really needed?

wheat mesa
warm imp
#

I learned you only need the index.js, config and a folder for commands

quartz kindle
#

its mostly personal organizational preference, if you want it you can have everything in only one file lol

wheat mesa
#

You can "technically" stuff everything into one index.js file, but that gets very difficult to maintain over time as you add more code

warm imp
#

Yeah i don't want that. Would should I do instead?

wheat mesa
#

By default your code has no idea what your files mean unless you tell them to do something with those files

#

Handlers tell javascript "hey, there's a function in here for the command named [some command name], please call the execute() function of it when the user uses this command"

warm imp
#

Oh

warm imp
wheat mesa
#

Videos aren't going to help you much, you're probably going to end up blindly following along without learning anything

warm imp
#

That is hard to read because I don't know what most of it means

wheat mesa
#

That's okay, just try to read it

#

Everybody starts somewhere

#

I usually don't understand much of what's being said in a new topic until I dive deeper into it, perfectly natural

warm imp
wheat mesa
#

Absolutely

warm imp
#

Fast or slow or medium?

wheat mesa
#

Depends on how much time you put into it

warm imp
#

Alright

#

Some people said it took them 2 years to learn code. That scares me because I don't wanna learn for 2 years.

wheat mesa
#

Plus I don't know you personally, everyone learns at different speeds

#

Are you wanting to do coding as a job in the future?

warm imp
wheat mesa
#

Yes

#

A career

warm imp
#

I don't know

#

I haven't really thought of it

#

Because i haven't really knew how to code or been taught

wheat mesa
#

I don't want to scare you but learning how to code is a lifelong adventure. If you end up pursuing a career in this field you will always be learning

#

I have been doing this for almost 4 years now and I am still learning

warm imp
#

What would you be learning about? That is new

wheat mesa
#

I have a good bit of knowledge but I am nowhere close to being an expert

#

Code isn't about learning the syntax of a language or its features

#

Programming is about problem solving and translating ideas to structures

quartz kindle
#

its something that takes time, and practice

warm imp
#

Ohhhhh

quartz kindle
#

you can say you can learn it in 1-2 months, but how good will you be with it really? will you be able to hold a conversation?

#

its the same with coding

sage bobcat
wheat mesa
#

been so busy

#

wish I was rich enough to not have to have a job

sage bobcat
#

One message removed from a suspended account.

wheat mesa
#

or lucky enough to get a job in this field before my degree

warm imp
wheat mesa
#

I mean yes and no, I am teaching programming to younger kids as a job right now

#

But in the sense of building software, that's not my job right now

#

I do it as a hobby

#

I am pursuing a degree in computer science so I am working towards that area though

warm imp
wheat mesa
#

I would definitely recommend giving some effort to try out programming though

#

4 years ago I made a discord bot because I was bored and it ended up being what I wanted to pursue as a career

#

Before that I wanted to do astrophysics

#

Thank god I didn't

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

lmao

sage bobcat
#

One message removed from a suspended account.

warm imp
# wheat mesa 4 years ago I made a discord bot because I was bored and it ended up being what ...

My friend is a good coder. And I wanted to code I've always wanted to own something or make something. So that'd why I wanted to make a discord server. But then my friend said you can make a bot. It could help you grow your server and your in control the whole thing. So I said why not. So i wanted to make a bump bot and some other things in it. But i don't know where to start and coding is hard. So yeah but it is something I want to try out

quartz kindle
#

the best way to start is by wanting to do something with it

wheat mesa
#

^^

quartz kindle
#

i started because i wanted to create astrology charts lol

#

i had 0 idea how to do that

wheat mesa
#

And the best way to continue is by making more things you want to make with it

warm imp
#

Yeah

wheat mesa
#

I've fallen victim to some burnout because I'm so busy nowadays and it sucks, but I'm trying to get to a point where I program more often

#

Gotta get back into that mindset

warm imp
#

Javascript?

wheat mesa
#

I know javascript but I'm not too big of a fan of writing it

#

I prefer C++, Java, and Rust mostly

#

For discord bots typescript is my language of choice

warm imp
wheat mesa
#

Python and javascript are the most common

lament rock
#

python and javascript are the go to options

wheat mesa
#

I'd recommend javascript personally

#

But completely up to you

lament rock
#

depends on what you wanna do though

warm imp
#

Bump bot

lament rock
#

image manipulation is more of a python job

warm imp
#

And more

quartz kindle
wheat mesa
#

image manip libs are probably bindings to C++ DLLs

#

Highly doubt that python is going to power through images fast by itself

lament rock
#

Ive heard Pillow is probably the best option

#

But idk!

pearl trail
# warm imp Bump bot

is bump bot like that disbo*rd? you need pretty much a lot of servers for your bot to join so people can notice

warm imp
#

Those bots

#

That's what I am aiming for

quartz kindle
#

the thing is

#

you're bumping it where?

#

like if you wanna bump your server in a server list

#

you need to have the server list already

#

or have access to an existing list

warm imp
quartz kindle
#

so your bot will need to be very popular

warm imp
#

Yeah

#

Kinda

#

But it could grow if it is good

#

Hopefully

#

But it would have other things not just bumping

pearl trail
# warm imp Um more like BumpIt, WeBump, OneBump

yeah, the bump system is like putting your server into the top of the server listing so the user can see it. if there are only a few users, then there's a low chance the listing will be seen. well idk how those bot get popular, so you need to find a way to make your bot popular so more people can see others servers. good luck

#

cmiiw

dusky idol
#

Hello a little query!
I just started learning C#, it's my second language let's say. Other than that I know py which I always wrote in vsc

For C#, I downloaded VS for the first time yesterday however I couldn't make myself fit into it lol it all seemed a lot more complicated and uneasy compared to VSC so I downloaded some extensions into vsc to make c# work there. Frankly I've only worked with vsc so far for all my projects

Did some research and found out the core differences between VS and VSC, however would still like someone to tell me if I'm all good sticking to vsc for now/for long term or if I should root out and start writing in vs muidead

coarse crag
#

I recommend vsc

pearl trail
#

VS is the most common IDE for C#, made by Microsoft

#

and then jetbrains rider, paid one

lament rock
#

VSC can work as a CS editor, but it wasn't purpose built like VS was since CS is a Microsoft language. Naturally, VS made by MS would be a good pair

pine nova
#

notepad++

earnest phoenix
lament rock
#

Very funny. VSC wasn't designed for CS. It can support it, but VSC is more of a swiss army knife than a steak knife to cut through steak.

surreal sage
#

least annoying eslint warning

civic scroll
surreal sage
#

eslint better....

#

but you have to restart the server for the error to go away

civic scroll
civic scroll
surreal sage
#

i use ts too 💔

#

"i use arch btw" i use typescript btw

radiant kraken
#

@lyric mountain @covert gale do you guys know how to publish a gradle library to maven central? i've been using jitpack and it refuses to work today

frosty gale
#

notepad++ users

radiant kraken
#

yes that is me

#

staying strong for 4 years with notepad++ 💪

#

what is that

lyric mountain
#

yes that's it, was trying to remember the name

radiant kraken
#

what's the difference

lyric mountain
#

idk, but sonatype will also publish it there

#

ik cuz I could find my libs

#

and I published it on sonatype

radiant kraken
#

alright, thanks

quartz kindle
#

friendly reminder, exponentiation is js is SLOW AF

radiant kraken
neon leaf
sharp geyser
radiant kraken
#

make a node addon ezpz

neon leaf
#

make it make a web request to a supercomputer

#

every time you want an exponent

#

and dont cache it

quartz kindle
neon leaf
#

...

quartz kindle
#

literally 10x faster

neon leaf
#

makes sense that its faster

#

but not that its 10x

#

wtf

quartz kindle
#

exactly

neon leaf
#

did anyone here ever install a rasberry pi 1 a+ without wifi (ssh over usb)?

frozen isle
#

TOPGG_TOKEN = "My TOKEN I PASTED"

@bot.event
async def on_connect():
bot.topgg_api = topgg.DBLClient(bot, TOPGG_TOKEN)
print("top.gg client initialized")

bot.remove_command("help")

async def update_stats():
while True:
try:

        await bot.topgg_api.post_guild_count()
        print("Server count updated successfully!")
    except Exception as e:
        print(f"Failed to update server count: {e}")
    
    await asyncio.sleep(1800)

@bot.event
async def on_ready():
print(f'{bot.user} is now jamming')
await update_stats()
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} commands.")
except Exception as e:
print(e)

#

top.gg client initialized
CodeGuard#8181 is now jamming
Server count updated successfully!

#

nothing happen

#

ed

#

Opps

#

took long it worked

#

lol

#

wait u can post a 1000 server

#

s

#

Also is it ok if u post 45 and ur bot is in 43?

quartz kindle
#

however if someone finds out you're cheating and reports it, you can get banned from top.gg

#

but for small differences there is no problem

#

most bots do have some margin of error, due to discord also being inaccurate sometimes

frozen isle
#

ok

frosty gale
#

is there a point to users submitting server counts now anyways?

#

discord shows a rounded version publicly now

deft wolf
#

Some users look at the number of servers when browsing top.gg

#

I'm not that kind of person, but I know that there are people for whom the number of servers = quality I guess

pine nova
radiant kraken
#

bruh what nvm realized i accidentally inherited the class 💀

result.h(97,69): error C2280: 'topgg::internal_result::internal_result(void)': attempting to reference a deleted function [C:\Users\user\Desktop\cpp-sdk\build\topgg.vcxproj]
lyric mountain
#

@quartz kindle need your consultation on a thing

#

lets say I have a websocket server

#

and I need to request an image that'll be sent over the wire from the client

#

what'd be the best way to transfer it?

#

image is a png btw

tribal crow
#

Any way to place the two icons at the bottom next to each other instead of underneath?

#

They're both images placed inside the bottom most div

solemn latch
#

I'd use a flexbox for that

tribal crow
#

Or

#

I mean i manage to place them next to eachother, but then the "justify-content: space-around" wont work

solemn latch
#

wont work how?

tribal crow
#

Doesnt apply at all

solemn latch
#

intresting, have you used your browsers dev tools to look at what the flexbox looks like?

lyric mountain
#

this will mimic the space-around

solemn latch
#

👀 i've never come across that being an issue

#

intresitng

#

css is weird

neon leaf
lyric mountain
#

cdn is not doable, not anything involving cache

#

reason being the image is dynamically generated

frosty gale
#

either send it over the connection in binary format with lossless compression or convert it into a b64 string and send it as a regular string in ws

lyric mountain
#

I am using b64 currently, guess I'll try direct binary to see if it improves

frosty gale
#

it definitely will because that way youre not doing any additional processing (minus the compression if you were to use any)

#

with b64 you first have to convert the binary data into b64 string and then have to unpack that b64 into binary again

#

youll also end up sending less data since b64 data tends to be longer

neon leaf
#

well, depending on how you display the image, you could just use the b64 stirng directly in html

#

but yeah

#

binary is probably better

frosty gale
#

most of the time devs choose to send images over base64 for convenience

#

like being able to fit the image into an object

#

but its not good from a performance standpoint

#

but depending on image size that performance penalty and extra network doesnt matter that much

#

binary can be annoying to deal with in high level langs

solemn latch
#

. to you too

warm imp
#

Do you need dotenv

neon leaf
#

?

warm imp
#

Idk if i need dotenv

solemn latch
#

not 1000% necessary, but you should use it.

warm imp
#

What does it do?

solemn latch
#

It gives nodejs access to local .env files

warm imp
#

Oh ok

#

So what do the numbers mean then

solemn latch
#

what numbers?

warm imp
#

A=123
B=456
DISCORD_TOKEN=your-token-goes-here

solemn latch
#

the first two are example numbers, the last one is your bots token that discord provides.

warm imp
#

Ok

#

Why when i do npm run it wont turn on my bot?

solemn latch
#

👀 I dont think the guide says to use npm run does it?

warm imp
#

it says node.

#

but it doesnt work when i do it

solemn latch
#

Did you read the whole tip?

warm imp
#

I changed it

#

Still didnt work

solemn latch
#

what does it say back?

warm imp
#

node.: The term 'node.' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

solemn latch
#

node .

#

not node.

warm imp
#

It says something different now

#

"token"= "My Real Token Just took it out of here"
^^^^^^^

SyntaxError: Invalid left-hand side in assignment
at wrapSafe (node:internal/modules/cjs/loader:1350:18)
at Module._compile (node:internal/modules/cjs/loader:1379:20)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
at Module.load (node:internal/modules/cjs/loader:1249:32)
at Module._load (node:internal/modules/cjs/loader:1065:12)
at Module.require (node:internal/modules/cjs/loader:1271:19)
at require (node:internal/modules/helpers:123:16)
at Object.<anonymous> (D:\Infinity Bump\index.js:2:19)
at Module._compile (node:internal/modules/cjs/loader:1434:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)

Node.js v22.2.0

frosty gale
#

that probably means you tried to assign a value to something that you cannot assign to

warm imp
#

Now it says my token it wrong

#

TokenInvaild

#
    "token"= "Token"
}```
#

Did i do that wrong?

#

The Token is the real token

lyric mountain
#

is that supposed to be a json?

#

cuz json uses : not =

warm imp
#

yeah

warm imp
lyric mountain
#

...no, replace = with :

warm imp
lyric mountain
#

which error?

#

delete that

#

the image

#

u didnt censor ur token

warm imp
#

Whoops

lyric mountain
#

go reset it just in case

#

anyway, the issue is that ur trying to write a json in a .js file

#

either rename the file to config.json or export it

warm imp
#

Oh

pine nova
#

would prefer to use dotenv over config.json cuz you will to push and also deploy the app/bot ,can't really push the config.json file yk

warm imp
#

Alright how would i switch then?

warm imp
# lyric mountain either rename the file to config.json or export it
  • D:\Infinity Bump\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1186:15)
    at Module._load (node:internal/modules/cjs/loader:1012:27)
    at Module.require (node:internal/modules/cjs/loader:1271:19)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (D:\Infinity Bump\index.js:2:19)
    at Module._compile (node:internal/modules/cjs/loader:1434:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
    at Module.load (node:internal/modules/cjs/loader:1249:32)
    at Module._load (node:internal/modules/cjs/loader:1065:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'D:\Infinity Bump\index.js' ]
    }
#

Now i am getting another error

lyric mountain
#

you cant import a json file

#

u need to require("...") it

warm imp
lyric mountain
#

the file as a whole

#

use import for js files, use require for json files

warm imp
#

ReferenceError: Token is not defined
at Object.<anonymous> (D:\Infinity Bump\index.js1014)
at Module._compile (node:internal/modules/cjs/loader:1434:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
at Module.load (node:internal/modules/cjs/loader:1249:32)
at Module._load (node:internal/modules/cjs/loader:1065:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)
at node:internal/main/run_main_module:30:49

Node.js v22.2.0

#

Now i got another one lol

#

@lyric mountain

lyric mountain
#

because u named it "token"

warm imp
#

It worked

lyric mountain
#

not "Token"

warm imp
#

Ty

#

It worked

#

Only after 50 trys

frosty gale
warm imp
# lyric mountain not "Token"

ReferenceError: Collection is not defined
at Object.<anonymous> (D:\Infinity Bump\index.js:12:23)
at Module._compile (node:internal/modules/cjs/loader:1434:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
at Module.load (node:internal/modules/cjs/loader:1249:32)
at Module._load (node:internal/modules/cjs/loader:1065:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)
at node:internal/main/run_main_module:30:49

Node.js v22.2.0

#

Do you know what happened?

lyric mountain
#

show what's in line 12 of index

warm imp
#

client.commands = new Collection();

#

I made a command

#

And my bot stopped working because of this

lyric mountain
#

whatever Collection is, you didn't npm i it

warm imp
#

How do i figure out what it is

lyric mountain
#

where did u get your code from?

warm imp
#

The guide

#

@lyric mountain

lyric mountain
#

you dont need to ping me

#

read the guide, dont just copypaste any code you see in it

warm imp
warm imp
#

nvm

#

What is wrong with it?

lyric mountain
#

it's wrong that u didn't import it

lyric mountain
warm imp
#

I fixed it but i am getting another error

#

SyntaxError: Identifier 'Client' has already been declared
at wrapSafe (node:internal/modules/cjs/loader:1350:18)
at Module._compile (node:internal/modules/cjs/loader:1379:20)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
at Module.load (node:internal/modules/cjs/loader:1249:32)
at Module._load (node:internal/modules/cjs/loader:1065:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)
at node:internal/main/run_main_module:30:49

lyric mountain
#

read the guide please

#

for that error it's because u literally copypasted the line, instead of getting what u needed

#

thus adding another Client

#

also your editor should show you what's wrong before u even attempt to run it

#

dont ignore the errors, it wont run if there's any on the editor

#

also read the first line of the error, it usually tells the exact cause of it

warm imp
#

ReferenceError: Collection is not defined

#

That just says that

#

But you said it might be a npm i

solemn latch
#

What page of the guide are you on? 👀

warm imp
#

That one

solemn latch
warm imp
#

First i turned on debugger and i dont know how to turn it off

warm imp
#

But i cant turn off debugger 😭

lyric mountain
#

99% of your errors will solve themselves if you read the guide

trail quail
#

i highly suggest to avoid copying code without knowing what each line does

#

otherwise you'll never be able to make your ideas become a thing in your code

warm imp
#

True

trail quail
#

plus all the debugging issues that come with it

warm imp
#

its the run and debug that on

#

And wont turn off

solemn latch
#

what IDE are you using?

warm imp
#

IDE?

lyric mountain
#

from the image they sent earlier it was vscode

solemn latch
#

intergraded development enviorment

solemn latch
warm imp
#

i dont even know what happened

#

But the commands dont work

#

It just says the thing when a bot is offline

#

But i dont have any errors and the bot is online

trail quail
warm imp
#

Yeah 3

solemn latch
#

pick one and show the code ^-^

warm imp
#

const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
await interaction.reply('Pong!');
},
};

#

Thats the ping

lyric mountain
#

did you register it?

solemn latch
lyric mountain
#

ah

pine willow
#

Ah

solemn latch
#

in the terminal

warm imp
#

I put it in my index

solemn latch
#

Did it log the interaction?

warm imp
solemn latch
#

then determine if it logs the interaction

warm imp
#

PS D:\Infinity Bump> client.on(Events.InteractionCreate, interaction => {

console.log(interaction);

});
ParserError:
Line |
1 | client.on(Events.InteractionCreate, interaction => {
| ~
| Missing argument in parameter list.

pine willow
#

@solemn latch I didn't get everything, what exactly is it about?

warm imp
#

Did i do that wrong?

solemn latch
pine willow
#

Ohhh

warm imp
solemn latch
# warm imp Confused on what your asking sorry

have you performed this step?

client.on(Events.InteractionCreate, interaction => {
    console.log(interaction);
});

This is a test to check if your bot is receiving when someone runs a slash command.

When you have this code, and run a slash command it should show up in the box you ran node . in.

#

with a whole bunch of information

solemn latch
#

and?

warm imp
#

client.on(Events.InteractionCreate, interaction => {

console.log(interaction);

});
ParserError:
Line |
1 | client.on(Events.InteractionCreate, interaction => {
| ~
| Missing argument in parameter list.

solemn latch
#

ah hi tim

quartz kindle
warm imp
# solemn latch ah hi tim

client.on(Events.InteractionCreate, interaction => {
console.log(interaction);
});

do i put this in my index.js too

quartz kindle
#

encoding stuff as string should be avoided whenever possible because you're just double/triple encoding things

#

you convert binary to b64 string then it will be converted to utf8 binary before being sent, then unconverted from binary to utf8 string, then unconverted again from b64 string to binary lol

solemn latch
quartz kindle
#

that doesnt look like a js error, are they using typescript?

solemn latch
#

just js

quartz kindle
#

ah wait

#

they tried to run that on powershell LMAO

quartz kindle
pine willow
#

Oh yea i see PS

frosty gale
#

i havent seen that one before

solemn latch
#

😐

warm imp
#

client.on(Events.InteractionCreate, interaction => {
if (!interaction.isChatInputCommand()) return;
console.log(interaction);
});

#

What about that

pine willow
warm imp
#

Does that also go into index.js

pine willow
#

Yes

quartz kindle
#

everything goes into js files

#

the only thing that you run in your shell/cmd/terminal is npm commands and node commands

warm imp
#

Even this

#
    if (!interaction.isChatInputCommand()) return;

    const command = interaction.client.commands.get(interaction.commandName);

    if (!command) {
        console.error(`No command matching ${interaction.commandName} was found.`);
        return;
    }

    try {
        await command.execute(interaction);
    } catch (error) {
        console.error(error);
        if (interaction.replied || interaction.deferred) {
            await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
        } else {
            await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
        }
    }
});```
quartz kindle
#

yes, thats js code

#

everything that is js code goes into js files

solemn latch
#

👀 alright, I gotta go

pine willow
#

Doesnt look that bad right?

#

Guilds is bugged

quartz kindle
#

looks good

warm imp
#

Still didnt work

pine willow
warm imp
#

I put it in my index.js

quartz kindle
warm imp
#

How do i fix it?

quartz kindle
#

lay your bricks correctly

warm imp
quartz kindle
#

show full code

pine willow
#

Without bot token please

warm imp
#

in my index.js

quartz kindle
#

yes

warm imp
#
const path = require('node:path');
const { Client, Collection, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.once(Events.ClientReady, readyClient => {
    console.log(`Ready! Logged in as ${readyClient.user.tag}`);
});

client.login(token);

client.commands = new Collection();

const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
    const commandsPath = path.join(foldersPath, folder);
    const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
    for (const file of commandFiles) {
        const filePath = path.join(commandsPath, file);
        const command = require(filePath);
        // Set a new item in the Collection with the key as the command name and the value as the exported module
        if ('data' in command && 'execute' in command) {
            client.commands.set(command.data.name, command);
        } else {
            console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
        }
    }
}

client.on(Events.InteractionCreate, interaction => {
    console.log(interaction);
});

client.on(Events.InteractionCreate, interaction => {
    if (!interaction.isChatInputCommand()) return;
    console.log(interaction);
});    

client.on(Events.InteractionCreate, async interaction => {
    if (!interaction.isChatInputCommand()) return;

    const command = interaction.client.commands.get(interaction.commandName);

    if (!command) {
        console.error(`No command matching ${interaction.commandName} was found.`);
        return;
    }

    try {
        await command.execute(interaction);
    } catch (error) {
        console.error(error);
        if (interaction.replied || interaction.deferred) {
            await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
        } else {
            await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
        }
    }
});```
pine willow
#

Mhm

#

Ah

quartz kindle
#

ok so, you dont need to have an interaction event 3 times

pine willow
#

Yes.

quartz kindle
#

you only need one client.on(Events.InteractionCreate, ...)

solemn latch
#

For now we dont need the bottom two. we just need the first one until we figure out if you're receiving interactions

quartz kindle
#

then what exactly is not working? do you get any error? when you run node index.js?

warm imp
#

Not that i know of

#

I have to go because i have a baseball game

quartz kindle
#

does this show up when you run it? Ready! Logged in as ${readyClient.user.tag}

quartz kindle
#

ok so the bot is running

#

when you type / on discord, does your command show up?

quartz kindle
pine willow
quartz kindle
#

i still need to re-verify my bot >.>

#

shitty discord doesnt accept images, they want me to take a live photo

frosty gale
#

youre a developer find a way around it

eternal osprey
#

Not limited to? What they gonna do next to removing verification? Hunt me down or sum notlikenoot

eternal osprey
#

Oh hellll nah fr?

#

I need this dc account man

#

But I don’t want to post my ugly ahh again

quartz kindle
#

i cant take a pic of my id now because its dark

#

gonna have to do it tomorrow

#

i hope they will accept the image because my phone's camera is borked

#

the glass lens cover is broken

eternal osprey
#

I am thinking about turning my bot into a file system lmao. Basically a way to store data safely, download it etc. What you think? Good idea?

quartz kindle
#

store data in discord channels?

#

theres dozens of github repos about that xD

eternal osprey
#

No, on my dfs.

#

I want to create an actual backup type of system, like iCloud type shit

dusty bronze
#

Hi

quartz kindle
#

like your bot sees your uploads and mirrors them into your cloud?

dusty bronze
#

Any way to show the servers of my application on the page?

eternal osprey
#

Nah you send a file, the bot keeps it save for you on a dfs. You can download it whenever you want.

#

Like an actual datastoring system for backups

quartz kindle
#

how are you gonna send the file tho, you gotta upload it to discord first no?

eternal osprey
#

I most likely will do so through a web interface

quartz kindle
eternal osprey
#

But idk I need some creative minds to help me find a purpose for my bot. Do you have any ideas?

dusty bronze
quartz kindle
quartz kindle
eternal osprey
#

I will remake it from scratch

quartz kindle
#

and have it send a message saying It's 4 o'clock on all channels everyday at 4h

dusty bronze
#

Mine doesn't have that icon next to the star.

eternal osprey
quartz kindle
quartz kindle
eternal osprey
#

I know what I wanna do, I want to implement geoguessr

#

What you think

quartz kindle
#

whats that?

warm imp
quartz kindle
warm imp
eternal osprey
quartz kindle
warm imp
#

Alright I'll do that when I get on PC again

dusty bronze
quartz kindle
#

then restart your bot, and try using a command on discord, your bot should show up the command data on your console

warm imp
quartz kindle
#

top.gg doesnt not create those stats for you automatically

#

you need to send the stats to top.gg

#

for example, inside your bot code, you create a fetch like this:

dusty bronze
quartz kindle
#

i dont remember if top.gg uses json

#

might need to change it to urlencoded

dusty bronze
frosty gale
#

use discord as a free file backup

#

each channel is a form of stash

#

if the file you upload is bigger than discord upload limits, just split it into multiple files then rejoin it later when downloading

#

encrypt it also so discord cant look inside of your files

#

literally unlimited secure storage

#

discord is cooked

lyric mountain
#

files now have expiring urls

#

so u need to manually find the file through client and download it

frosty gale
#

no problem

#

i save the message ids of the attachments then fetch the message each time i wanna download a fragment

#

although im not sure how practical it is

#

it might take a while and a lot of fragments to upload a big enough file

#

if you have nitro you could be cheeky and make a user bot that uploads 100mb fragments

#

but then again you might as well pay for storage hosting like a normal person

lyric mountain
#

some terabytes of storage is like $7 on contabo

frosty gale
#

but it could get you a bang for your buck when it comes to nitro

#

not only do you get nitro benefits but free unlimited file storage

#

50 missed calls from harvard just now

quartz kindle
#

lmao

frosty gale
#

although if enough people do it discord will just finally add expiring attachments

#

or add some kind of internal cap of attachments per user

#

they probably already have that

quartz kindle
#

is there a difference betwee these?

#

like, aside from one being u-3 and the other 3-u

#

what is the difference between x being on the right side or the left side? isnt it a multiplication the same way and thus same result?

wheat mesa
#

3 - u is not the same as u - 3

quartz kindle
#

yeah aside from that

wheat mesa
#

Oh

#

There is no difference about the order of multiplication

quartz kindle
#

like isnt x4(n) and same as (n)x4?

wheat mesa
#

Yes

quartz kindle
#

then why did they write it different

#

lol

wheat mesa
#

Probably just an inconsistency

quartz kindle
#

@_@

wheat mesa
#

People usually prefer having less negatives as well

#

Oh wait nvm that doesn’t make sense

#

Yeah it’s just inconsistent

quartz kindle
#

also this

#

cant you just write it x²u?

wheat mesa
#

Yeah

#

Sometimes people prefer parenthesis for readability reasons

quartz kindle
#

damn maths confusing me

wheat mesa
#

Makes the multiplication look more explicit, harder to overlook the u

#

Also just to be consistent with the rest of the terms

quartz kindle
#

so

#

L1 and L2 have this

#

but L3 doesnt have the second option

#

i need the quintic equation one, i dont understand the first equation, and the other small equation is an approximation, not the one i want

#

how would i convert the L3 equation into the corresponding quintic equation like above in the L2?

#

also, the small one at the end would be this? R * (7/12) * u?

pine nova
#

tf kind of maths is this

quartz kindle
#

the annoying kind

pine nova
#

💀

sage bobcat
pine nova
wheat mesa
quartz kindle
wheat mesa
#

I'll try to see if I can do something with this but no promises because this looks complex

quartz kindle
#

i have L1 and L2 working, based on the quintic example they show

#

L3 should be simple, but idk how to proceed with that equation, as it doesnt have the same quintic example as L1 and L2

wheat mesa
#

yeah honestly I'm not sure how they get from L1 & L2 to the quintic function

#

actually I can maybe see how they do it but it's so exhaustingly tedious I don't think I'm going to even attempt it (on the very real possibility that my thought process is wrong)

pine willow
#

FINALLY

quartz kindle
#

look at this

#

jesus christ

#

it gave me this end result, no idea if its correct tho

wheat mesa
#

chatgpt is bad at math but this doesn't look like a standard LLM model, is it?

civic scroll
# quartz kindle

image 2, line 1 step 3
where did (1 - x)^2 go in the denominator

#

image 3, the last expression was not completed

civic scroll
#

don't trust it 😔

quartz kindle
#

rip

civic scroll
#

wait

#

so in L3, x = r/R and u = M2/(M1 + M2)?

#

peak web development
i couldn't even scroll to the right to see the whole equation

quartz kindle
#

yes

#

M1 = mass of the sun
M2 = mass of the earth
R = distance between sun and earth

gaunt swan
#

Discord has announced an update to their developer policy. This new update now restricts the use of AI tools on Discord user data, unless express permission is granted by Discord staff.

  1. Do not use API Data to: profile Discord users, their identities, or their relationships with other users...
  2. Do not use message content obtained through the APIs to train machine learning or AI models (including large language models) unless express permission is granted by Discord.

Read more here:
https://discord.com/developers/docs/policies-and-agreements/developer-policy

Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

civic scroll
quartz kindle
#

lmao

past field
#

is there a rate limit with the model forms?

lyric mountain
#

Also the first one technically makes anti alt account bot's illegal

#

As you'd be trying to identify which accounts are alts

gaunt swan
civic scroll
quartz kindle
civic scroll
#

@quartz kindle

#

i got to this

#

need to isolate u and x to each side though

#

split M1 from R^2

radiant kraken
#

math chat

#

@civic scroll what r u doing

civic scroll
#

see the L3?
i need to convert it to just x and u

radiant kraken
#

oh i thought you were doing physics in drawing something

civic scroll
#

it is physics

#

but in tim's

radiant kraken
#

icic

civic scroll
#

also in space

#

astrophysics my beloved

radiant kraken
#

idk why but physics never really clicked with me

crystal wigeon
#

hey whats the rate limit for sending dms to multiple users?

#

is that counted as a global rate limit?

#

if i want to send some kind of notification dm to 100 users. how should i approach the logic?

deft wolf
#

Any dms that are not the result of user action (e.g. using a command) are a terribly bad idea

bitter granite
crystal wigeon
crystal wigeon
surreal sage
#

client's server seems to does this whenever it just started for a few minutes
discord.js doesn't seem to care and it never properly starts and it just errors
this error isn't catched by discord.js and i do not know how to fix it

#

it just gives up

spark flint
#

a lot of hosts force you to use their dns servers, i always change to either 1.1.1.1 + 1.0.0.1 or 8.8.8.8 or 8.8.4.ed

#

since better reliability and sped

surreal sage
#

it fixed itself after like a minute or two

#

but discord.js doesn't retry

quartz kindle
civic scroll
quartz kindle
#

like i know its an iterative process

#

i have an initial value for r

civic scroll
#

the annoying part is convert M1*R^2 to x and u

quartz kindle
#

and i need to iterate until i find an r value that produces an exact fit

#

or as close as possible fit

#

for L1 and L2 using the quntic form of the equation, that has to equal 0

civic scroll
#

yeah, and it would be easier if i can reduce the number of variables by converting it to quintic form

quartz kindle
#

i iterate and i find values smaller and smaller until its 0 or as close as possible to 0

#

i found a youtube video explaining all the maths and shit but at the end he shows a python script to calculate them, im gonna take a look at that too later

civic scroll
#

🙏

quartz kindle
#

here

#

his code is very different from the formulae in wikipedia tho

civic scroll
#

he used return as if it's a function 😭

quartz kindle
#

ew

#

lmao

#

also something i dont quite understand, i keep getting the result of r as a positive number
and it says and r being defined such that the distance of L3 from the centre of the larger object is R − r.

#

so L3 should be at distance - r away from the sun

#

but the description of the L3 point says it should be slightly farther away than earth's orbit around the sun, not closer

#

so r should be a negative number, not positive

#

or distance - r is wrong

civic scroll
#

did you try debugging to see what was causing it

quartz kindle
#

i have no idea

#

like even this

#

that gives a positive number, not negative

#

thats the simplified formula that should give an approximate answer to r

civic scroll
quartz kindle
#

unless this is wrong lol

#

151.78 = sun-earth distance in mio km

civic scroll
#

can't say it's wrong when following formula

quartz kindle
#

but the explanation is sound tho

civic scroll
#

what it's saying here is r > R

#

which means it's the R - r that's negative

#

not r

quartz kindle
#

but it says r being defined such that the distance of L3 from the centre of the larger object is R − r

#

the distance from L3 to the center of the larger object cannot be R - r if r > R

#

i think i found an answer on reddit

pine nova
#

should I use unidici.request or built in fetch api to make api calls in nodejs? i heard fetch api is based of unidici but which one is better and faster?

pine nova
#

oki

#

thenku

pine willow
#

My bot can now switch between my nodes so if one goes offline for whatever reason it switches to another node. This should prevent downtime

#

Is that a good idea?

pearl trail
#

depend on what your bot does

pine willow
#

clean asf

pearl trail
#

seems like tictactoe bot requires the user to give inputs multiple times, idk how you handle your bot nodes, but prob if someone is in the middle of the game and the bot switches nodes, it'll be stuck. well yeah back again, idk how you handle the system

civic scroll
pine willow
civic scroll
#

the ui looks nice

pine willow
#

yes

civic scroll
#

very apple-y

#

also you are hosting on a VPS?

pine willow
civic scroll
#

your server is vm-based

pine willow
#

i know

civic scroll
#

should have asked if it's a vm 😔

#

mb

civic scroll
#

ah

pine willow
civic scroll
#

using windows for vm????

pine willow
charred nest
#

posting here too coz yall smart
we're having a recurring issue with our bot (in one server, not sharded) randomly hitting 100% CPU. when i manage to get into the server to check why, these are the only errors i see spawned:

  • ConnectTimeoutError: Connect Timeout Error
  • SocketError: other side closed
  • Error: write EPIPE
  • RequestAbortedError [AbortError]: Request aborted
    please help Sob i really cant figure this issue out
charred nest
#

no, discordjs SADGE

sharp geyser
#

What version

charred nest
#

v14.13

surreal sage
charred nest
#

shit, i meant to mention- this spawns from undici

sharp geyser
#

huh

pearl trail
#

undici CPU leak? idk never heard of that