#development
1 messages · Page 159 of 1
I toyed with the idea of going compleatly headless and removing the gpu but its only an hd5450 and those use like 2w idle so not worth it
2 watts idle? that doesn't sound right
I toyed with the idea of going compleatly headless
kings used to do that too
lmao
even a basic LED uses like 10 watts
yeah the hd5450 is insainly power efficient
Might be a full build lemme look into it more
my gtx760 uses 140w at max load lol
I think this might be measuring a full system build not the gpu alone
yeah that sounds about right
man I love it when I go onto a website and the "reject all cookies" button is just completely broken
you could power that card for a while by just biking lmao
yeah
Im sure I read a forum discussion about them and the idle power is like 2-5w
not sure where you got an LED that uses 10W though
my 2070 has a tdp of 115w lmfao
cuz even 60w equivilent mains lightbulbs are only ~6w depending on how good they are
damn really?
thought the 20XX gpus where power hogs
mine isn't its about the only power efficiant part of mine lol
my previous cpu was a 65w tdp
its a 5600x used to use 80w
but i undervolted it and now it runs at 50w peak
the stock cooler keeps it under 60*C
My 2700 was 65w tdp but I had it overclocked from 3.2ghz to 4ghz on all cores so probably had quite a bit more than that
pretty nice
lmao yeah
I was gonna OC my chip but I onlt have a gtx760 and its already bottlenecked to hell
so I though to just save power
my cpu rn runs pretty low on power when not doing much
firefox, battle.net, ryzen master, spotify, and discord open
woh
running below 40c usually
I gotta clean out my fans so bad though, I haven't done a deep clean in 4 years of owning this
thats my cpu
lowest I have seen it is 19w
and yeah I havent cleaned my fans in the year I have had this
my cpu used to idle at 20*C
but then I got the gtx760 and the thing is dusty now and it now idles about 36 ish
also back to the original convo......
i did get sodium installed and working
still getting dropped packets like hell no idea why
I distinctly remember having the bot in 4 VCs at once and it working fine in all of them
the bitrate is set to 8Kb/s so its not a bandwidth issue and the cpu isnt struggling either
Mine idles around 20-25c
nice
But I gotta clean the radiator fans really bad
And the radiator itself
So much dust has built up
also I gotta go do dinner things rn so Ima be back ina bit
But I cannot be bothered to disassemble my pc to clean it up
if (interaction.isButton()) {
if (interaction.customId.startsWith("cl")) {
await interaction.deferUpdate();
scraper = new Scraper(interaction.customId.replace("cl", ""));
setTimeout(async () => {
let card = await scraper.findCard(1);
let cardLink = card[0]["item"].href;
let cardName = card[0]["item"].textContent;
let embed = await scraper.scrapeCardDetails(
cardLink,
cardName,
interaction
);
interaction.update({ embeds: [embed], content: ``, files: [] });
}, 2000);```
the interaction was already replied to? I mean, i know i actually send a message and edited the reply already, but can i update the reply again?
use let card = await scraper.findCard(1)[0]["item"];, ur not using it for anything as it is
this saves u 4 array/map accesses
also using a timeout ain't a good idea, might be the reason for ur issue
I got an idea of a programming language but I don't have time:
String name*: "World"
fn main() {
print("Hello, #{name}!")
}
String* thing: "Thing" // The type String is not mutable anymore
String: thing*: "Unmutable Thing" // The value of thing is not mutable anymore.
a: b // Value assignment
a = b // Condition
a < b // ...
a > b // ...
a <= b // ...
a >= b // ...
a != b // is not equal to
🤨
the last thing you'd want to hear is "mutable string"
Ok I think I have found out my audio issue,
it is nothing do do with my server, internet or code
its discord on my pc
for whatever reason when Im unmuted and NOT talking (I.E. the ring around my pfp is not lit) it constantly sends 800Kbps data stream of some kind out of my pc
how that is possible since my internet is only 70Kb/s I don't know
but when I mute myself my bot works perfectly and whats more I can now have it stream audio to about 4 vc befor it starts to die
anyone know why discord on my pc is being stupid? it never used to be that way used to only send data when i spoke but now its continuous.
Wait you're self-hosting your bot?
the type can change
also I restarted discord and it seems to be behaving now? so idk whats happening anymore
I mean, at this point just use var like other langs
since u cant ensure a variable is of a type
what like scratch?
no, shakespeare
The Infamous Hello World Program.
Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.
Act I: Hamlet's insults and flattery.
Scene I: The insulting of Romeo.
[Enter Hamlet and Romeo]
Hamlet:
You lying stupid fatherless big smelly half-witted coward!
You are as stupid as the difference between a handsome rich brave
hero and thyself! Speak your mind!
You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer's
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!
You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.
Speak your mind!
[Exit Romeo]
Scene II: The praising of Juliet.
[Enter Juliet]
Hamlet:
Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!
[Exit Juliet]
Scene III: The praising of Ophelia.
[Enter Ophelia]
Hamlet:
Thou art as beautiful as the difference between Romeo and the square
of a huge green peaceful tree. Speak thy mind!
Thou art as lovely as the product of a large rural town and my amazing
bottomless embroidered purse. Speak thy mind!
Thou art as loving as the product of the bluest clearest sweetest sky
and the sum of a squirrel and a white horse. Thou art as beautiful as
the difference between Juliet and thyself. Speak thy mind!
[Exeunt Ophelia and Hamlet]
Act II: Behind Hamlet's back.
Scene I: Romeo and Juliet's conversation.
[Enter Romeo and Juliet]
...
does not fit fully
the hello world, that is
my god
fun fact the closest thing to large language models before gpt 3 was this kinda thing which you trained on shakespeare or something and then it tried to predict the next sequence of words based on your prompt
Oh, man you should seriously just use a VPS
There are lots of good VPS providers out, especially Hetzner and DigitalOcean
and contabo
true but then having an excuse to run my own server is half the reason i host bots
its about the only thing I can run that works on my internet
I would host a server like nas but thats expensive an it takes ages for stuff to download so eh
Can you tell me a command that needs Guild Member Intents?
a better question, why do you want it?
if you're trying to invent a command just to get that intent, do you really need it?
If you don't need an intent, getting it for the sake of getting it a pretty bad
As ur increasing your bandwidth usage for no benefit
why ipc cannot read array?
I pass an array via ipc and it says undefined
nvm
im dumb
client.on(Events.GuildMemberAdd, async (newMember) => {
console.log(newMember.guild);
let unverifiedStudent = newMember.guild.roles.cache.find(
(r) => r.id === "1141656585626730496"
);``` -> the guild logged fine, yet it throws me cannot read properties roles of undefined
I'm assuming that the roles are not in the cache, but since you know the role id, can't you just assign it using await member.roles.add("1141656585626730496")?
newMember in this case of course
but shouldnt the cache instance still exist?
unless youre trying to query unverifiedStudent
well query is a bad word
read
The documentation of my programming language idea, but I didn't make an interpretor or a compiler yet
For those who tried making a compiler or an interpretor, was it hard to make?
imagine needing to hold down shift to make an assignment (doesn't really matter but might take a bit to get used to)
I don't need shift to type ":"
i feel like the any type is gonna create a similar situation to javascript/typescript
where a lot of things could potentially be declared as any and make it difficult to read
i get the simplicity aspect but eh
Yeah I'm sorry with the Any type but somehow it is useful, maybe it will be a restricted type, idk
You haven't documented regular arithmetic syntax without assignment, which I'm assuming is just Number const a = 1 + 1
let service = database[message.member.id].service;```
i am trying to save a class object in my json file, but for some reason it occurs as {}
Isn't this possible in js? I know java does allow storing in arrays etc.
Are you actually writing the file? Also you shouldn’t rly be using a json file as a database
i am.
Show
Uh idk I won't lie, I made it with ChatGPT, but assignment is":", so:
Number const a: 1 + 1
Right yeah
Only properties are stored in JSON
not methods
if I do
const fn = () => {
try {
if (...) return // <----
} finally {
// ... cleanup
}
}```
and the return executes, will the finally still be ran?
No
As a maintainer of the JavaScript programming language (as well as its interpreters and runtimes, such as V8 and Node.js), and LLVM, absolutely, creating an interpreter, runtime, or compiler is nothing easy whatsoever, it's quite hard actually
I'd highly recommend reading the Crafting Interpreters book (there's an online free version available as mentioned in the website), it'll guide you through and tell you everything you need to know about creating an interpreter and such
The process depends on whether you're making an interpreted or compiled programming language, but from what I'm seeing on what you've done so far, it seems to be compiled so here:
The hardest part of the entire thing will be parsing the source code that the user has written and convert it to an AST (Abstract Syntax Tree), this is called the front-end
After that, you can emit some sort of Intermediate Representation (IR) based on the AST and then apply optimization passes to optimize the machine code that'll be generated in the next step, this is called the middle-end
And finally you can emit the optimized instructions as machine code, this is called codegen (short for code generation) which is usually done with an assembly printer (to write the instructions), convert to an object file, and link with things like dynamic libraries and such to create an executable, this is called the back-end
Note: you can use modular compiler and toolchain technologies like LLVM for the middle-end and back-end
yep
finally is always ran regardless of what you do, think of it as a "when exiting this scope, do X"
Also reading the details of your programming language, I'd highly recommend to not make an any type, make a keyword (like C++'s auto keyword) to infer the type, or if you don't want to do it with a keyword, infer the type automatically if the type is not present (like Rust does it)
i tried making a compiler once, i just hate how hard it is to work with LLVM on Windows
which is why i gave up
there are no official prebuilt binaries for the LLVM compiler library in Windows/MSVC
and it essentially forces you to build the entire LLVM toolchain from source which would definitely kill my PC
That's not true, we provide official pre-built binaries for as many operating systems and architectures as possible
https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.6
Oh thank you very much!
hm, volt do u happen to have experience with antlr?
But how it looks like in Rust to infer the type?
actually, not really grails, just ast in general
The auto keyword means that the type change dynamically depending of the value?
Yes
It is interesting
let foo = 5;
When no type is explicitly specified, it infers the type as much as it possibly can
Oh I see
I'm trynna make an expression parser to convert formula tags into humanly readable scalings, for example:
At the start of each turn, heal {=$dfs/50} HP for every machine-type card in your graveyard.
so the type dynamically changes depending on the value?
^
if the compiler cant infer it, it would throw a compiler error
telling you to be explicit
I love this thing
the desired output would be ```
At the start of each turn, heal 2% 🛡 HP for every machine-type card in your graveyard.
and the parser already works, but I'm kinda stuck in how I'd approach it
We include it, that's old
some formulas are also quite big
since when
Since LLVM 14
for example ```
Consume {=100+max(0,$php-$bhp)} HP to deal double that value as degen to the opponent, at a rate of {=$pmp/($pmp+3)*50}% per turn.
when was LLVM 14?
Is there a way, with typescript, to make an object with all the tags like
let str = "At the start of each turn, heal {=$dfs/50} HP for every machine-type card in your graveyard."
let t = parse(string)
// t = {dfs: string}
And in what way do you wish to parse these expressions? What do these letters and symbols exactly signify?
php = player health point
I already have the ast generator done, thing is idk how to proceed from here
yes, php is player hp
A year ago
bhp is the receiver hp?
base hp
ah ok
bruh
i am too lazy to revive this project https://github.com/null8626/archive/tree/main/archive/20220428-sus
like, I want to be able to show the players what are the scalings for the cards' effects, but I cant really show them the actual formula as they'd never understand
so I want to convert it to percentages
should i revive the among us language compiler
It's like league of legends, stats are really modulable, if we can find a thing like that but like open source, it would be good
What is this software?
all I need now is to know how to work my way up the tree and parse those formulas into percentages
is among us a popular game right now
your answer is no
I get what you're trying to do, what I am asking is how are these formulas supposed to be parsed? What do some the symbols/operators do? And which are the identifiers and whatnot?
intellij, the generator is antlr
Okay
those $-prefixed words are variables, they represent one of the attributes of the card or the player
basically $hp/100 would become 1% HP
xD
And what's the = prefix?
that's just the tag itself, {=...} can be ignored
I use it to capture what's inside it
Oh alright
Yes 
could've come up with a better tag representor tbh
or since i presume you know C and LLVM, can you do it for me

I may not be able to since I'm very busy but I can help
Voltrex already maintains like every project in the world
such is the life of foss
The entire world runs on stuff made by volunteers, such volunteers (such as myself) have very high responsibilities to hold my title of maintainer
im not forcing you to do this btw
this was mostly a joke
I can't just sit there and do nothing, and expect to hold that title
yeah but your LLVM contributions are like once a month
and i don't think you've touched v8 in like months
What you're trying to do is quite easy actually, parsing that and converting it to an AST is simple, as well as executing it, what I'm wondering is where you're stuck exactly
well, never dealt with this tbh
Contributions are not the only thing maintainers do...
the effects are working atm, I use groovy to parse both the values and the effects (same context)
yeah ik
but idk how to approach making it a readable scaling
The main responsibility of maintainers is to make important technical decisions, help with the issues at hand, help others to reach consensus and work on important areas of the project (if need be)
Not to constantly make contributions
what are you working on at the moment?
I'm currently working on bringing new architecture ISel codegen optimizations (specifically for Arm32/64, x86-64, and LoongArch) to LLVM
can i see on your progress
Not sure what you mean, can't you just convert to percentages? Or am I misunderstanding it?
aight so, some formulas use a lot of pemdas
for example this {=(1+max(0,$mp-5))*2}
which would get reduced to (1+($mp-5))*2 cuz I dont care about max/min for the description, only for the effect
oh, found a larger one: {=min(0.5,1-min($php/$bhp*0.9,1d))*100}
I literally showed you one of them in DMs before
that's the idea
ah okay
and yes, I'm using groovy so I just run that snippet on it, but I'm trying to make it readable to people reading the cards' info
Are you making a game?
made
tbh I think it'd be easier to simply rewrite the scalings in a way that I can convert directly to percentages with regex
tcg, it's for my bot
lmao yeah, antlr is a bit confusing
I've used grammarkit before for my custom command syntax, so I somewhat understood antlr syntax quite fast
I think so
it returns an AST
yeah gonna do that, I'll rewrite the scallings in a simpler way
You two should read https://en.wikipedia.org/wiki/Comparison_of_parser_generators
This is a list of notable lexer generators and parser generators for various language classes.
woah
only 131 cards with scalling, thought there'd be more
alright
Well it generates its parser in the listed programming languages (C++ and Java) in this case so yes
I found this https://github.com/abrobston/jscc
Rust is an amazing language for creating programming languages
And rust has chumsky for a parser combinator
Writing your own parser isn't actually that difficult
can a footer have hyper links?
Dont believe so. I think only title ( with .seturl) descriptions and field values
pretty sure there's a url field for footers
Oh maybe im wrong then
when receiving an interaction option that's supposed to be from type 6 (user), the option is a String which is the user ID. You get the user from interaction.data.users
for footer there's the iconUrl, which is not that useful
Yea
Maybe one day they will add the option to use markdown in the title and in other parts of the embed as well 
I use the raw api, so if you're using a wrapper then you have to check the docs for your specific one.
The option for when you set it to type 6, when you receive it, the option is the user ID and Discord sends the user object as well
it also checks if the ID is valid
So um, I was wondering if there’s an optimal way of handling something like button interactions and selection interaction when there’s database calls involved.
Let’s say you need to check some data before sending the buttons and then when the button is clicked you need to make sure the data exists. This is causing the program to basically make the db call twice for same function
Once before sending button and once again after button click
Is there a better approach?
For example; let’s say A needs to give some points to B.
When A invoked command it sends a confirmation embed, with accept or reject buttons.
Now here the data is first checked before sending the embed.
The user can wait a while before accepting. During this wait time the user can also send points to B using some other command. Now A has 0 points. He goes back to the first confirmation and clicks accept. Now I have to make database call here again to make sure A has adequate points for the command to go through.
I basically want to avoid this dual db calls, and see if there’s a better way to do this
Anyone having issues with images (imgur specifally) being displayed in embeds?
Imgur blocks VPNs, might be that
But discord proxies all images shown in the client
So i am trying to setup a cron function on my vps that checks a certain table on my postgres db and checks when an item was created and if it doesn't fulfill the requirements it changes the status
Some work some don't - Only started happening today :/
Seems to be fixed now, think it was a Discord issue
no way to avoid multiple calls, but transactions are you friends
i assume when the button is generated, you want to check if the users have enough funds for the job, right? so you need to check the db for that, no way to avoid that
but you can cache the user's data
i'am currently using transactions yeah, just wanted to check if there's a better approach
yeah i did think i can cache and update the cache
when the button is clicked, you use a transaction to bundle both db calls together, removal from one user and addition to the other user
mm, but there can be side effects from it.
like if the cache doesn't have the updated data etc.
every db write should also write to the cache
or delete the cache to force a reload
its fine as long as data integrity is not compromised
push as much work as possible to the db itself, for example if youre using sql
you can use incrementation/decrementation to avoid working with fixed values
the example i provided was simple enough so i can just cache the data. but if there's some additional logic involved in calculating some results and to prevent recomputing i cache it but the user doesn't have the data needed in db so in that case it'll fail
the point of the cache is that you can track all your data in memory while still having it persist in the db, then repopulating it from the db when it doesn't exist in the cache
yeah i got that
it shouldn't really ever need multiple calls to the db as long as you have the caching layer
im trying to avoid making too many calls to db which can horde cost per call
you can also run checks inside the transaction to cancel it if the data diverges too much, ie funds were available before, but when the trancation starts they are not available anymore
one call to populate the cache with said user's data, then all the other changes are tracked client side in-memory
shouldn't need to query it more than once (or for writes) after you have the user data with a proper cache
so if the data is modified i have to check all cached data
and repopulate it or something
On startup, your cache will be empty.
User asks for data
You get said data from the db and throw it into the cache
If the user updates that data in some way, you make those changes in both the cache AND the db
When the user asks for that data again, you can return it from the cache instead of needing to query the db, since they both contain the same data
for ex: if im trading 100 cards -> i store these details in cache until user accepts trade. then user does something else with these 100 cards before accepting. comes back later and accepts trade.
also assume that user is doing some other operation with the same 100 cards which also has a confirmation and this data is also cached.
if user accepts trade i need to remove data from cache for both these operations, right?
you can also do the opposite
You would be updating the cache when the user does "something else" with these 100 cards. When the user comes back and accepts the trade, you will look at the cache to make sure the cards still exist and are valid, and if they don't, you cannot complete the trade
if the user does something else with those cards
warn him that they are pending in a trade
and cancel the trade
or tell them they cant do anything with them while there is a trade pending
hmm, so you suggest limiting to 1 action per usage
mm was thinking the same
but i cant cache data if they are paginating over it
no choice there but to make db calls
right
not quite sure what you mean, but I am getting the feeling you're not understanding what a cache is (correct me if I'm wrong)
nah ik what it does, i'm not able to explain it correctly, anyway thank you
anyone?
chatgpt is baffling about some python scripts
i could never
make a cron function to call a bash script
use bash for the task itself as u can code some logic on it
all cron does is call a command on schedule
u can also make a procedure on ur db to handle the logic, then have cron psql that procedure
alternatively, install cron module on postgres
lmao
bash is quite powerful and pretty easy once u get used to the syntax
I use it for sorting and organizing the images for my cards' endpoint
which requires querying data from the db
i hate using the interface
not a fan of gui either
it overcomplicates things fr fr
and it's such a big limitator sometimes
almost as if they wanna make it idiotproof...
i keep getting blacklisted on platforms like sellix for the amount of testing i do
their api sucks
they have a stupid webhook instead
ofc i'll test it
they dont want bro 💀
lmao
@spark flint hello dns and certificates person
I has a question, give me a sec
So I've been doing some scanning on my domain directly, though am a bit confused about this:
https://driftnet.io/project/3923338e-5d98-4b5f-8296-a84362d5035d under "Visible Domains"
especially the "portainer.s2.tomrasch.de"
do you possibly know what thats referring to?
Driftnet | Discover & Defend
and apparently the main site tomrasch.de redirects to wwf, which is a wilflife org
which sounds sus asf
Oh that ipv6 is my ipv6 of the server

The notorious hacker gang known as wwf has infiltrated your net
Adopt a capybara or we'll hack your box and run crypto miners
ofc ofc
now I'm sussed out though
apparently 8443 is originating from a docker
its originating from mailcow
wtf
like idc if docker would use it
but it runs a traefik instance and another webserver
which is sus asf
the original docker-compose doesn't even include it
uh
ah nvm it does
still sussed out
Ok turns out its just a previous owner of the ipv6 subnet

they forgot to change their domain for whatever reason
but the redirect still sus asf
yeah
btw if your aim is to hide your server IP
using CF
its easy to find your server ip
yeah idc anymore 
i have basically everything firewalled anyways
and my nginx only lets through port 80 when it originates from cloudflare
d&d wizard 🤝 Aurel
i have basically everything firewalled anyways
ah fairs
one search found it
its something you put stuff in
smh
ofc
but yeah everything is essentially firewalled
I occasionally just use cloudflare to proxy and cache it
lmao
ill take that literally bc they didnt clarify with /j
Why the fuck are you looking into my IDE right now
How are you doing this
are you a witch
What?
dbwat?
Is anyone's embed images provided by imgur causing issues? Most images load, some take a good few seconds and some are just not loading at all.
Funnily enough, that's my partner 🤣 Didn't know he had already asked.
I think Imgur servers are probably having issues, if you look this up, this has happened a good amount of times before
Mhm, might have to move away from them in this case. I remember imgur being very reliable, guess things have changed since.
Or it's the ratelimit shenanigans of Imgur, which happens a lot
So yeah, it's better to move to an alternative
Seems that way, cheers. Back to hosting it myself 🤣
That's a prepared statement that allows you to provide parameters after you've created the query
Often avoids SQL injections
place holders
and 'keywords'
? is a placeholder, * means all
so SELECT ALL FROM users WHERE id = 123 would what it would end up being *assuming you pass something to the prepared statement)
what lib is this
but I would assume it does
then yea
wait until you get to relations 
Use PostgreSQL
tho sqlite can't do table relations iirc
are the images too old?
imgur deletes images that had little to no views within a period iirc
I mean, I've had images on imgur from like 2015 and they're still on there.
I used to use imgur as a host for my cards' image, around 20% went missing randomly
Take at look at its API documentation
Well that's not specific to better-sqlite3, you should learn SQL
https://intellipaat.com/blog/tutorial/sql-tutorial/tables-in-sql
Or move to NoSQL databases 

Future<void> postStatsToTopgg() async {
final url = Uri.https("top.gg", "/api/bots/${client.appId}/stats");
final body = {
"server_count": client.guilds.size.toString(),
"shard_count": client.shards.toString()
};
final res = await http.post(url, body: body, headers: {"Authorization": topggToken});
print(res.statusCode);
}
This is the code I'm using to post my bot's stats. It prints a 200 status code, but on dblstatistics, it's not updating
I am confusion cause I dont know of a lang that looks like that syntax and uses print
looks like groovy
its more resembling java from final
definitely not java I'll tell you that for sure
I could be wrong but I think it's dart
from the few code snippets I've read
What language is this
Simple to just ask them

yeah it's def dart
dart is primarily used with flutter
dk what flutter is
a UI SDK for making mobile apps
Dart
ty :p
I rewrote my bot in Dart because it has pattern matching and everything Rust has
Basically it's Rust + JS
lmao nice
yeah from my short time using dart it was quite elegant, very clearly inspired by java but with actual modern features
also it can do foreign key relations but it's a flag you have to enable for each connection
disabled by default for compatibility or smth stupid
sql databases have 4 operations
SELECT <columns> FROM <table> for retrieving data
UPDATE <table> SET <column> = <new value> for updating
ah ic
DELETE FROM <table> WHERE <condition> to delete
and INSERT INTO <table> VALUES <values> for inserting
CRUD
and values are comma separated are they not?
yep
I haven't used raw sql in awhile
(value1, value2, value3)
a good way of visualizing an sql table is a spreadsheet
they work effectively the same
that's the purpose of spreadsheets
Weird, adding a navbar causes overflow on my page
overflow: hidden
fixed
wont that prevent scrolling
overflow-horizontal exists no?
Or something similar
Alternatively, just put the overflow hidden in the navbar's div and set it to 100% width
sort of
it prevents the scroll bar from appearing
isn't it overflow-x?
Idk, usually I just type the first 3 letters and press ctrl space
Quick question that I think I already know the answer too. If I await interaction.deferReply() then send an embed after the fact that should be ephemeral, will it? It doesn't seem to want to show it as such. I am interaction.edit()-ing the deferReply()
Guess the derferReply() needs to have ephemeral in it aswell.
Hey guys
from the forwarder i want to access the json file,
by doing ../database.json
how come it's wrong?
print out the current path your forwarder.js is in, within that same file
HI im new here i had idea for a bot to use with soundbords like (rpg sounds) to set bot as output device for bot to play. and Question is is there already something like that or it needs to be developed?
discord has a soundboard soo
Dont think bots can use them though
oh nvm i see the question
I mean yeah there are soundboard bots out there (made before soundboard existed)
But honestly I don't see the point anymore as said, native soundboards exists
soundord was an example what i had in mind was to make audio outpu to bot. specific soundbords like rpg sounds would be just an exapmple of usages
I mean the only voice applications I can think of are soundboards (which now isn't as useful) and music bots
it would open more advanced software like adobe audition etc
Are you trying to receive or send audio?
send oudio but thru software that can only outputs on outputdevices
so software->fake output/bot input->bot
how bad is it to go through a string 1 by 1 instead of findIndex + slicing?
https://github.com/0x7d8/NPM_WEB-SERVER/blob/bec979dc405047961dfe14a009b900b45d233f41/src/functions/getCompressMethod.ts
generally feel like thats quite inefficient
its less readable
I mean this is findIndex stuff, quite impossible to debug without investing some time into understanding it
https://github.com/0x7d8/NPM_WEB-SERVER/blob/bec979dc405047961dfe14a009b900b45d233f41/src/functions/parseURL.ts
what are you trying to achieve
faster execution
that parseURL is like 8x faster than built in functions
but idk bout how I parse compression headers
Hello! Someone can just explain me the basics of Antlr ?
thx
Uh
What do I do?
Alright I fixed it
Hmm how do I put a grammar in a grammar
bruh help me...
The fuck is g4
Antlr4
Never heard of
it's a powerful parser
string.indexOf is stupid fast
an order of magnitude faster than looping through characters
thats if you still have strings
if you have arrays, then the difference wont be much
let action = await kicker.checkVerifiedStatus(member);```
currently this is what i have in my index.js. The verifiedStatus should return true or false after 1 hour, it's an async function
i thought that if i would await it, it would await till the function completed, and then move on to the rest of the function, but it sadly doesn't work like that?
The verifiedStatus should return true or false after 1 hour
yeah das a bad idea
I suggest using a callback instead
a function that runs after this has been done
i found the issue
so apparently setTimeout is an async method
so it doesn't block out the rest of the code
dont block the rest of your codeflow
it's like running on 'another' thread.
just use a callback
yeah, i just created a promise
and resolve that within the setTimeout.
that way my code awaits for a response, so that i can later on use that value.
probably because looping through characters has a lot of safety checks and other stuff
plus also less overhead when doing operations
One message removed from a suspended account.
I finally got my bot to stream the same audio resource to multiple servers lmao
last time I tryed doing it I massively overcomplicated it
didnt know you can just make one player and set it to multiple connections
though I don't think Im suposed to make the player run permanently and just subscribe it to connections when needed
yep
nah
what about '' and 0 ?
those are just false
undefined too
undefined is falsy yes, but u can check with theBool === undefined
non-boolean datatypes will error in ts
"" is also a boolean. As is [] iirc
actually wtf
those are, in js
null isnt true or false
in ts they'll error
?!??!
null is falsy, can be checked with theBool === null
TS is JS bruh
yes, with type checking
null == true // false
null == false // false
Boolean(null) // false
'' == false // true
0 == false // true
u cant let theBool: boolean = []
You can double unary negate though
that'll cast to boolean, returning to my initial point
!!expressionToBoolean
or if you use == everywhere, you can just
const theBool = [] as unknown as boolean;
again, the point
as doesnt cast
it literally does
^
yes, compile-time cast
But that doesn't mean TS transforms it into a boolean for the runtime
it's still [] at runtime
yes, then js will proceed to cast it to false wherever u use it
my point is, true false null undefined are valid boolean values
If paired with weak equals
I'm not talking about using falsiness of other values as a trick, I'm talking about literal boolean values
@earnest phoenix how do you access node internal modules. Google is not helpful at all
specifically, I want lib/internal/process/esm_loader.js
null and undefined are not inherently booleans. When checked for truthiness, they are casted to booleans
not talking about if (theBool)
they aren't inherently booleans, but they are valid boolean values
or actually, valid variable values
Any falsy value is a valid boolean value
You need to use the --expose-internals CLI flag
this is the whole point of what I'm talking
After that, you can import node:internal/<internal module>
Array.from(process.allowedNodeEnvironmentFlags).includes("--expose-internals")
this returns false
Are you trying to access that on a program you don't control? Like a sandboxed environment?
No. Trying to make a module that pushes that flag at runtime so I can access lib/internal/process/esm_loader.js
then get the ModuleLoader class instance so I can create a global.import.cache = ModuleLoader.loadCache;
bc node won't expose the cache :(
Lol not like I can anyways. Not a built-in module
You can't expose the internals at runtime, this is for security reasons
Ah. But iirc, there is a way to push flags at runtime right? Just pushing to argv or is that readonly
You can't modify the CLI flags/options the runtime was invoked with, this is not only for security reasons but to also prevent third-party libraries from messing up the runtime while it's running
You're trying to access the ESM loader's module cache right?
Yeah
Not being able to delete entries from it is literally a memory leak
Otherwise, I'd just write my own import like resolver and loader
what does --expose-internals do
it exposes internals 
Yeah you would need to do that, that's the only possible way to affect how the ES Module loader works without accessing the internals
This is a good read: https://dev.to/giltayar/mock-all-you-want-supporting-es-modules-in-the-testdouble-js-mocking-library-3gh1
It allows you to access everything here
https://github.com/nodejs/node/tree/main/lib%2Finternal
Until a third-party library tries to take advantage of the internals and mess up how the runtime works
Just a little trolling 
Good luck
thx
>> npm i @top-gg/voting-sdk
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/@top-gg%2fvoting-sdk - authentication token not provided
where should I provide the authentication token
Where did you find this package?
this package is not public yet.
for now, use https://www.npmjs.com/package/@top-gg/sdk
Official Top.gg Node SDK. Latest version: 3.1.5, last published: 4 months ago. Start using @top-gg/sdk in your project by running npm i @top-gg/sdk. There are 9 other projects in the npm registry using @top-gg/sdk.
css 🤩
Hey, any website developer please dm me I need a simple website ( I pay )
Question as I apparently can't read this properly due to my smooth brain. https://rizzzigit.github.io/jikan4.js/classes/v4.AnimeManager.html#search I want to add the SFW filter on this found https://rizzzigit.github.io/jikan4.js/interfaces/v4.AnimeSearchFilter.html#sfw With my search code looking like...
const search = (await client.jikan.anime.search(interaction.options.getString('anime'))).map((anime) => {
return {
title: anime.title.default,
id: anime.id,
link: anime.url
}
})
How do they want me to add the filter after the string for the name of the anime?
I just added a .filter() to it before the .map() for what my conditions I want are and that worked as intended. Though I still wish I kinda knew what they wanted me to type to utalize the sfw boolean
What is the issue
my god
This is redundant This is also like why
you could do it in a much better way
Quite frankly both could be shortened down to a 1 line if you just outlined the pokemon in a json file rather than in the command
I know but I prefer to declare them one by one, in fact I would like that if the person votes when he comes to type the command then he receives a reward
for this piece of code it's classes and mega-gems
to each their own
wtf

mf recreated yandere dev's code
how do i change memory address pls and thank
dm
do they give a sfw boolean?
if not you can filter it manually by blocking certain genres and ratings
I use malscraper which fetches animes from myanimelist
I used to block 4 available genders ["Hentai", "Ecchi", "Yuri", "Yaoi"]
and 2 ratings ["R+ - Mild Nudity", "Rx - Hentai"]
The official vote SDK for Top.gg. Contribute to top-gg/top.gg-voting-node-sdk development by creating an account on GitHub.
pm ERR! 404 Not Found - GET https://npm.pkg.github.com/@top-gg%2fsdk - npm package "sdk" does not exist under owner "top-gg"
npm ERR! 404
npm ERR! 404 '@top-gg/sdk@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
I have this on my .npmrc
@top-gg:registry=https://npm.pkg.github.com
nvm I removed that it works now
I mean I did filter it myself but I linked the things because i just dont know how they want me to type it
Me i love u ❤️
that escalated quickly
@leaden tendon also
this statement let poke; will always be undefined
just that whole set of comparisions would fall through
good
@leaden tendon tip:
let availablePokes = {
"Absol": "Absolite",
"Alakazam": "Alakazamite",
// ...
};
const pokeName = availablePokes[pokeId]
this is accessing object property value via its key as index
dont forget to check if pokeName is undefined
and yeah that too
👀
why
why is it not possible
why can't i drop like rust
smh js runtime needs to step up its game fr
hey guys i am trying to make some more use of my portfolio. Would this be a good beginner idea to recreate:
A soundboard with emojis, each emoji has it's own voice, and you can eventually add it to like a beatpad or something.
@earnest phoenix we need Symbol.dispose and Symbol.asyncDispose frfr
even without the using statement, those symbols should exist
never tell blud to make an isOdd(number) function
function isOdd(number) {
if (number = 0) return false
if (number = 1) return true
if (number = 2) return false
if (number = 3) return true
if (number = 4) return false
if (number = 5) return true
if (number = 6) return false
if (number = 7) return true
if (number = 8) return false
if (number = 9) return true
if (number = 10) return false
if (number = 11) return true
if (number = 12) return false
if (number = 13) return true
if (number = 14) return false
if (number = 15) return true
if (number = 16) return false
if (number = 17) return true
if (number = 18) return false
if (number = 19) return true
if (number = 20) return false
if (number = 21) return true
if (number = 22) return false
if (number = 23) return true
if (number = 24) return false
if (number = 25) return true
if (number = 26) return false
if (number = 27) return true
... + 25688995245 lines
isOdd(-1)
10/10
i mean
a solid 5/7
anyone a clue how to improve my prompt? its working most of the time but it doesnt always use unicode emojis, sometimes it uses stuff like :wave: which discord obv doesnt support
const rawResponse = await ctx.gradio.chat(ctx.join(
'Imagine you are an assistant in a discord server, your nickname is "Cat". please make sure your responses only follow this schema, make sure its json complient and',
'make sure your response is ONLY the following schema, strip any additional text:',
'### Schema Start',
'{"response":"<your response text>","reactions":[<array of UNICODE EMOJIS (not discord emojis) to add to the question as reactions (example "👋", do not do escaped emojis). if you dont want to add any reactions keep the array empty (if the user greets you ALWAYS include an emoji)>]}',
'### Schema End',
...(context ? [
'Please keep in mind your history in this chat when responding but dont actually answer anything in here. focus on the User Question below:',
'### History Start',
JSON.stringify(context.messages.map((m) => ({ ...m, content: undefined, question: m.content }))),
'### History End'
] : []),
'### User Question (now answer using the response schema):',
JSON.stringify({ username: ctx.interaction.author.username, question: ctx.interaction.content.replaceAll(`<@${ctx.interaction.client.user.id}>`, '') }),
))```
Python?
JS
Actually
equal to is "==="
not "="
you are doing an asignment
'============================================='
it's a repeated typo lol
not enough
enough?
seems kinda fine
@earnest phoenix Sorry for disturbing, but ChatGPT don't know how to make a ANTLR4 grammar, How can I do?
yeah cool, then stop it
thank you
Back with another noob question 
Currently just messing around with svelte to get the ropes by creating a notes website with a REST API.
I am currently trying to make a edit functionality, and I got the editing part down, just a simple PUT method, however, I have the edit form set up in a modal, and, like with any modal, there is a cancel button that just closes the modal.
However, when I do this, for some reason the form submits itself and just makes the note completly blank, or if there was anything in the form, it will update the note to whatever was in the form when you press cancel.
I have no idea why it's doing this, as you can see in the code, the cancel button only closes the modal and has nothing in there to do with submitting the form.
It is worth noting I am using the following:
- svelte@latest
- daisyui@latest
Easily share your source code with other developers.
How do people add this to their bot?
Already suggested this, they claimed they wanted to do it like how they had it for whatever reason 😭
-servercount
@earnest phoenix
To have your bot's server count displayed on Top.gg, please read the documentation on server/shard posting.
finally figured out i could make a config file for my ssh keys
my life is easier now
huh
some people just like pain
like you
I succeeded without changing my parameter but thank you anyway!
👍🏿

but did you fix it

sounds like he did

anyone know how google search console works?
i created a sitemap for the relevant pages almost a month ago and google is refusing to crawl & index them
I won't be able to help you go through the process but you can request crawling in search console somewhere.
They also may not crawl very fast(really slowly) for some sites with a lot of pages, which may not be very important iirc.
That’s only for specific pages though right? I believe I did that for one of them and it worked but I’d have to do that for each of them manually
Yeah, and you'd have a limit of how many you can do at a time.
Painful 😪
Anyone got any ideas? I'm stuck asf 
am bad dev 105%
Your cancel button is inside a form element, so every button inside the said element that doesn't have a type explicitly specified, it'll then implicitly have the default behavior of a submit button
🤦
All you need to do is to specify the type of the button with the type attribute
ur a godsend voltrex
what would us noobs do without you 
thank you
You're welcome
Does a thread id and channel id have the same ids?
If the thrwad is created from the channel
no as u can have many threads per channel
and threads are still channels technically
That wouldn't even make sense either way
average smtp server testing 🥰
until frustration, then depression
fyi, I suggest using something else to check your delivery
One message removed from a suspended account.

bro the new
domain connections
im wilding already
gon spam my profile full of it fr
already on your way abusing them 
LMAO the tick
i wanna buy walter.hartwell.white.(something)
glad I have cringe.dev
me when gmail blocks my emails even though my mail server follows all best practices
rip
i gotta test that out
for new email addresses google is very strict
will most likely put you straight to spam
maybe after a couple of weeks/months after your emails are "well received" aka marked as not spam or not put to spam by users and follows practices like dmark/spf and the IP is consistent it will eventually start letting through more emails
occasionally also does tests during that period which puts a random email sent from your server into the inbox instead of spam to see how a user reacts to it
not enough certs
basically your reputation is "unknown"
it'll take some time to gain enough trust not to be thrown in the bin by gmail
AMBADEBLOU

how to fix "cursor session. id not the same as the operation context's session id" ?
i have not had any issues with the code for over a year and suddenly i get this 🗿
show code
google shows results for mongoose not mongodb lib
its not mongodb lib specific
the implementation of a workaround might be
but other than that
what does your connection string look like
const mongo = new MongoClient("mongodb+srv://username:password@dbname.thingy.mongodb.net/dbname?retryWrites=true&w=majority", { useNewUrlParser: true })
looks normal
what mongodb version are you using
you're exact issue was a known problem in some older versions
it should be fixed but maybe try https://github.com/Automattic/mongoose/issues/6357#issuecomment-384054679?
he's not using mongoose
he could just pass the session directly to the whatever method he is using
find/create/etc
doesn't it use mongodb options?
I think mongoose has different naming/use cases than mongodb lib
with mongodb lib you can directly pass the session as one of the options idk if you can with mongoose
ok fixd
i added a cooldown between marking db as connected and allowing first db request
that weirdly worked
Likely was losing session in between maybe?
it might be trying to create an operation before establishing a connection (race condition, perhaps?)
@earnest phoenix do you have any pointers (no pun intended) to setting up VSC with C++ (and windows)? Trying to set up my school laptop environment and I’d prefer to not have a heavy IDE like VS or CLion on my laptop (makes the fans loud in class)
Or anyone for that matter
install the C++ intellisense
and that's pretty much it imo

I meant more or less compiling it
I’d like to use CMake since I’m more familiar with it but I also don’t quite know how to get it set up to work
install cmake then
I did, I don’t know how to set it up to work since most of the time the setup was done for me by CLion
i haven't used the extension tho, i always do it from the command line
there should be documentation somewhere about it
or you can just look at the extension's settings
I’d like to use it from the command line
I’m happy with doing it that way
That’s partly why I’m using VSC, so I can become more familiar with command line tools
i primarily use VSC because of its shitty intellisense
if you have cmake installed and it's in your path then you are already good to go
How do I get it to build though? I was messing around with it earlier and it generated a ton of cmake files, but I couldn’t get anything to actually build the c++ file
@wheat mesa
cmake -B build .
cmake build
then if you use MSBuild, run
msbuild build/<yourProjectName>.sln -noLogo -p:Configuration=Release
otherwise
cd build
make
i used it in one of my older projects https://github.com/null8626/archive/tree/main/archive%2F20211009-jsfuck
this is why Windows is obviously better 😎
Uhhh, what if my pc does not recognize msbuild as a command
what is in your build dir
Tons of cmake generated files, including a hello.sln
I have VS2019 installed so I can certainly compile & run C++ projects, just not sure how to get it to work
All I have in my CMakeLists.txt is ```
cmake_minimum_required(VERSION 3.11-3.18)
project(hello)
add_executable(hello hello.cpp)
you probably dont have msbuild installed
I probably don't but I don't see why I would need to?
I have a compiler, I have a build system
I got it to build a .exe
I think I have it set up now
ok I have it going
anyone know how to make a quick little python script for running commands? Something like being able to do this in vscode terminal: ```ps
python run.py
Automatically runs like this:
cmake --build ./build && .\build\Debug\hello.exe
that way I don't have to type things out a ton
because I'm lazy
and you didn't even start coding 
Precisely!
You can make a batch for scripts
Good enough for what I want here
batch is underrated
Also remember pshell refuses to run batch scripts, so change ur vsc terminal to cmd if it isn't already
Idk their reasoning for pshell
they can afaik
microsoft tm
I will teach you how to earn $50k or more from the Crypto Market, you'll pay me 10% of your profits when you receive it.
Bcuz ofc your own scripts aren't safe, just like how you need to whitelist intellij projects folders from win defender
make me rich!!!! I will give you $600,000 if you promise a 678% return!!
@unkempt ocean
just use labels and goto
ezpz
remaking my entire house in Unity without 3D scans. Just my bedroom has taken me collectively over 24h and I'm not even half way done with it. Tho a lot of it was initial setup and dialing in settings for lightmapping and PBR plus taking measurements
Kinda surreal to explore my home in game
Those are some bigass planks
Placeholder textures lmao
Also can't repeat textures on an atlas and all of the sub-textures on the atlas are 128x128
Wdym?
Thanks, now I’ll know your exact house layout when I pay you a visit! Make sure to leave your safe combination on a note on your desk, no reason
You can tile a texture to repeat, but you can't do that on a texture atlas which is a combination of textures. The UV mapping just doesn't work that way unless the mesh was more complex and subdivided to "tile" per face
you forgot to remake your house's exterior and it's sorroundings in Unity btw
dont forget the street too and its name

no lmao
But u can multiply texture coordinates
not doing my outside for that reason
Mult the scale by 4 and u have a nice floor
All of the meshes use the same material
Still, u can do it with nodes
if I multiply the UV tiling, then this happens
Well, not that
explain
You can take a subsection of the atlas and repeat it as much as you like, kinda like clipping only the part you want
I don't remember how, but I did it once
When I was still using blender
I've literally never seen this done. Materials or meshes don't have a way to define which faces to repeat a section of the texture
You can only repeat on Unity if the UVs spill off the edge of the texture
It's probably possible in shader graph, but then I'd lose the shader I'm using which is non negotiable
I am not sure if what @BluePrintRandom suggested works, maybe there is a misunderstanding. However, below is a little example, I think I made working what you are trying to achieve. Have a look at this incredible piece of artwork in the UV image Editor. Let’s assume you want to repeat the star. I unwrapped a single plane and played around with...
Might be useful
See the part with the shapes
Yeah this would be a shader graph thing
Can't do that on top of the shader I'm using
Which shader is it?
A Bakery shader
Doesn't it support nodes?
That is an option yes, but why would I make the meshes more complex than they have to be
Idk the final scene performance hit and I'd wanna wait until everything is done before I substitute higher poly meshes
I mean, 6 extra tris aren't gonna be noticeable at all
I also plan on making this run okay on mobile hence why I’m not using any realtime lights anyways with Bakery
ok now I'm just confused, when I type cmake on the command prompt it works just fine, but when I use it through a batch script like so: ```bat
@echo off
set path=0001_Testing
cmake --build ./%path%/build && .%path%\build\Debug\main.exe
nvm got it
msvc gang

we both suffer
but yeah ive had my email for a while now
i think most get accepted now by gmail and dont get thrown in spam
Btw I recommend updating to VS2022 since the C/C++ compilers provided by VS2019 doesn't support a lot of the newer stuff (like C++20 for example)
i'm surprised you didn't promote clang

Oh yeah thanks for reminding me, you should use Clang which is way better than MSVC and such! Better support, code generation, diagnostics, and more
For the amazing price of free
ads
there is something better than clang tho
its called 'cargo'


