#development
1 messages · Page 256 of 1
tnx
I see, apparently dijkstra has manyyy implementations
A stopping criterion is stopping when heap is empty. It can still update the distances of dequeued elements = can work with negative edges.
However, the stopping criterion of going on until all vertices are visited will lead to provlems when negative edfes are introduced
may i see it?
its on github: tiny-discord
alr
theyre already paying the consequences for it lol
they released something called "guilds" now
so they cant call them guilds on the api because they call servers guilds
maybe theyll just call them servers?
might want read the chat
point still stands
they name attributes related to servers as "guilds"
libs can call it something else of course
but im talking from the discord api perspective
tim said same thing but different way
yes he has indeed
because they used to be a gamer company, from gamers for gamers
now they are a corporate DEI company for woke gaymers and kids
:^)
One message removed from a suspended account.
what are some free ways to host my bot 24/7
google's compute engine has a free vps, but you need a credit card to register
amazon's ec2 has a free trial for 12 months
but i think they also require a credit card
oracle also has a free vps, but they require credit card, id verification and may terminate your account for no reason
anything else that’s completely free?
ah
thats a lot though
i used to use one for free but it wont work with my current setup. plus, its very slow and only limited to one
Usually no VPS provider is going to offer a free tier without ID verification or debit card verification
Otherwise it’d be trivial to build a botnet with them
dang
You could also host on a raspberry pi, but that also means purchasing it 
You should try render.com, create a web service and then attach the bot to the web service. This is just one of the many ways to achieve that, just remember they often spin down projects inactive for more than 15 mins, and spin up when requested, a way out is to run a cron job or so to keep it alive or something. It supports docker so anything is possible, the sky is the limit. Good luck.
i think i still have mine
i just havent used it though
ive used oracle services at work and i know theyre the furthest thing from reliable and trustworthy
it kills me every time i see a company supporting oracle because out of all companies doing bad in the world, oracle needs to go the most
as a java dev, I also vouch for oracle going away
hey guys, is a heap like this even possible?
this would not even be a heap right
because all children must be filled from left to right? So there's no way that 4 has no child while 7 does
?
??
heaps should be ordered no? 4 cannot come after 9 if its a min-heap
a heap is a tree-based data structure that satisfies the heap property: In a max heap, for any given node C, if P is a parent node of C, then the key (the value) of P is greater than or equal to the key of C. In a min heap, the key of P is less than or equal to the key of C.
Insertion: Add the new element at the end of the heap, in the first available free space. If this will violate the heap property, sift up the new element (swim operation) until the heap property has been reestablished.
this is a max hreap
Would I be crazy for remembering this differently? I was under the assumption that the ordering of the children was not guaranteed, just that the root will always be the highest/lowest element
oh i was looking at it upside down lmao
yeah there should be no horizontal ordering
i get it now, you're right, the 1 should be a child of 4 not 7
but also, the children of 4 could have existed before and have been deleted
Owh thats so strange
Cuz a heap is usually represented as an array you know
Well yeah but I’m pretty sure there are a lot of heap algorithms and therefore it’s implementation defined iirc
Error 429 incoming 
make sure registerFont is used before creating any canvas, preferably put it right after require("canvas")
also make sure the path to the font file is correct, try absolute path instead of relative as well
if the problem persists try converting the font to a different format and try again
i gave up
also try using a different font family name, without dashes or special characters
everything was supposed to work, etc
cuz i did the same for my old bot and works fine
probably newer canvas version
be aware of the rule of 3:
free & fast = not reliable
free & reliable = not fast
fast & reliable = not free
if someone claims to be all 3 then you're about to be scammed
I mean, google & oracle are reliable enough
yeah ofc
free hosting platforms are generally all fucking bad
look at heroku for example, that shit kicks your bot offline after 20 days exactly each month, and it does not give you any root access to install required packages
well, heroku is for apis technically people just used for bots cuz they could
not free though
and not made for bots yeah
was free, for up to 23 days per month if 24/7
could shave some hours from uptime to have full month uptime mostly
also had the ability to verify with credit card and get like the double or something
anyone here trying to get this new DAVE stuff to work? I've been trying for a week now, it's a total nightmare
@quartz kindle @pearl trail gotta love that they give the answer in plain sight 
💀 what is that
assignment for my node.js course
just speedrunning it today
why read the instructions when you can just read what validate.js does 
whoa
I am not sure how much i trust a school that does this
How you going to teach me programming if you can't even hide your answers properly

they don't even try to obfuscate it 😭
@pearl trail @sharp geyser LMFAO even the base64-encoded answer validation code is bugged
☠️
because of this it's impossible to pass the validation test without modifying validation.js itself
the bug was something like this ```diff
- const stderr = stderr.toString();
- const stderr = stderr?.toString() ?? '';
assert(stderr, '', '<message>');
damn
trol
i love this course sm
work smarter, not harder 🗣️🔥
imagine if the guy who made this course hash user passwords in their website with base64 
lmao
Imagine this was their plan all along
Either they intentionally did this and are trying to catch cheaters with seemingly correct answers, or they are this dumb
how would they catch cheaters lmao
it's just a text file, it can't do anything
besides the answer would be process.memoryUsage().heapTotal no matter if you cheat or not
since there's no other way in achieving it
🤓 ☝️global.process.memoryUsage().heapTotal
Was nerd emoji-ing to the fact that you can prepend global and still be correct
More of just a roundabout way which is stupid
BUT it is another way to reach the same thing
I feel like with coding answers, you'd have to evaluate the answers and compare with an expected simulated value because there are so many ways to achieve the same thing in quite a few cases such as with var assignment for short-handing or perhaps optional chaining if applicable
also dumb that they dont just call an api to check the answer
I’m surprised they’re not using an online platform for this like HackerRank or something similar
well they do have assignments on the website
but ig this one is a special case because you have to edit multiple categories of assigments
though you can implement it on the website as well tbh
requiring devs to use node validate.js to see if their code is correct or not is just 🤡
Or better yet don’t use javascript and have a language that can write actual unit tests 😉
Js does have unit tests now!
Or rather, node does
they would have to read assembly to read the answers
I really do hate javascript now after working with it at my job
Recent versions of node have actually included a test suite
yup
what part(s)?
Especially when our codebase is easily 30k lines of messy javascript in which 45% of it is probably redundant
i no longer need jest because of node:test
Web development
Jquery, etc
So incredibly tangled and messy
JS is an entry level language so you do get people who dont bother to optimize their code to reduce redundancy
Ew
Our codebase is 35% javascript and like 45% C#
That should tell you what’s wrong with it right there
but didn't you say that it's 35% js
Not to mention, the code quality is horrific
then why not... refactor it
I got hired by someone and they asked me if I can do front end development and I flat out refused. I'm a back end dev through and through. If I do any front end work, it's for my own projects because I can experiment with what I like… Like pug!
I have a ticket to debug a few issues with a page right now, and the files I’m looking through are 3k+ lines of js each, and half of them have duplicate event listeners and it’s a mess to find out where the problem is
Because that’s not my job, I am an intern
I have tickets and deadlines to make
The only front end templating lib I'd use tbh
what about react?
It would take me several hundred hours of dev time to refactor even one page of our codebase
And the main problem lies in the fact that most of this code was written by incompetent interns at some point
Just fell off I guess because all of these other frameworks are the whole package and people want more tightly knit ecosystems I guess??
Absolutely not.
They don’t use classes, they don’t use functions very often, etc
We still use var for everything
Which leads to complications in a codebase this large
maybe they want to prioritize backwards compatibility?
No, it’s just a mess of a project
It’s been ongoing since 2020 and it’s still not fully ready for production
jeez
Company that contracted us keeps feeding us money so there’s always more work to be done
Hi
I very strongly dislike anything that takes away from a low level experience and is less dev friendly since you have to deal with stuff like automatic re-rendering and shit like that when the developer knows when you should actually re-render
Just so much wasted CPU cycles
but... its popular 
That doesn't make it any better!
its like python
I’d prefer react over razor pages any day
Null you're making me shed tears
why
I want something functional and powerful, not beginner friendly
I'm anything but a beginner
I also have horrible experience with libs that have too many layers of abstraction like discord.js. The cached imported module strings alone blew past my memory budget
I feel like you reach a point where there’s too much abstraction
I want to know what my code is doing, not just run it and hope it works
I feel like at a certain point of wanting to do things with js you start to have to understand the internals of js, which defeats the whole purpose of it
Mmm not really. That's when you really start to nitpick the performance of things like Tim, which dont get me wrong, I am grateful for it, but I'm not at that point yet
Im still a freak with overarching performance though
I just want to get to a job where I’m working with C/C++/Rust
And a job where I don’t have to touch disgusting frontend dogshit
Front end devs are sadly in very high demand
I can tell with the quality of the frontend code I read
Looks like they taught a chimpanzee to write code
It’s not just that. It's moreso that companies want an online presence and need maintenance and stuff like that
But when you outsource your work to contractors, you do get mixes of code base styles and have fun spaghetti
I just want to do backend so bad
95% of my time at my new job has been spent fixing frontend bugs and it’s genuinely boring
which is why im not a fan of big frameworks or big libraries that do very superficial things
SAME
i cant believe im basically forced to get into web nowadays
its either web or mobile dev
Im so thankful that my passive contributions landed me a contracting position for someone
It doesn’t make me the most money but it makes me happy
I have interviews lined up with some fintech and quant finance firms rn so I’m hoping to land something there
idk if i fit as a mobile dev, frontend dev, backend dev, desktop app dev, etc
Make your own stuff I guess
Lowkey scared for the quant finance interview because I feel like it’s gonna be really difficult
the next app is a big social media replacement
Short form content and what is "advertiser friendly" is destroying the internet
then you fit as a fullstack dev
gotta keep the users engaged
unnecessary smiley at the end but kinda true
Which Discord manages to do for me without any of that
full-stack devs are just devs that are in there just for the money /s
they get plenty of money from quests (which is just basically glorified ads) and discord nitro
Which I only interacted with once and cheesed it and never again
for nitro, I mean yes but emojis
oh and also profile avatar decorations
🧏
Thats more than likely an L since they have per guild customization
File storage at Discord's scale cannot be cheap
I’d imagine it’s not cheap, but at the same time not expensive for a company of their size. With a multi billion dollar valuation, I’m sure they can afford some hefty hardware to handle it
intentionally wrong answers
I'm half glad half burdened by the fact that I forgot how to do a lot of manual arithmetic especially with floating points. For some expressions I can work out in my head, but once it starts to have like 3-4 layers of operations, I just usually leave it to my calc. Why that all matters is because I'm working on a js library that does arithmetic on strings which would theoretically allow for infinite precision of the exponent and the mantissa
Progress going smooth. So much to do, but sadly you cannot override how operators are applied to classes like + or - so I have to make methods :(
im really not excited for sqrt or mod
infinite precision isn’t possible though
Some numbers just physically are not representable in base 2
it's correct 💀
the question was literally about the total heap memory
process.memoryUsage().heapTotal is the answer
java bigdecimal could give u up to 9.2 quintillion digits 
all that's required is to extend bigdecimal to allow long precision, and a helluva ram
i hate winscp so much it makes me want to kms
Still better than filezilla in my opinion 
what about javascript bigint or ordinary python ints 
wait what wdym?
doesn't look like it
me when func name
looking like discord-api-types type names

sql statement still better than one I just saw a senior engineer write at my company
(he was inserting params with ${} in js)
💀 💀 💀
hey guys i am absolutely brainfucked atm
Cool stuff
yall now stacks right?
Look suppose we call f(a,b,c,d,e,f,g,h), then it puts the first 6 onto registers and the other variables on the stack right?
However, in this case its a fucking stack so it pushes first g and then h and because of that it appears as
h
g
however, the stack pointer is where we will pop elements from (it's at the local variables now) and when we pop, doesn't it mean that it goes against fucking LIFO?
we first pop g while it should have popped h first.
Or am i tweaking
i know you have either little or big endian but still, i assume a down growing stack atm
it doesn't make any sense
so this would mark the stack as:
[h,g,return address, frame pointer, local variables]
Something about this doesn’t add up
H and G are in the wrong spot on that picture, it should be g and then h I believe
why so? cuz we add elements on the top of the stack right?
I was gonna say
So if we have:
char test = 'a'
char f = 'b'
it first pushes b and then a but why the fuck does it do that
honestly i don't need to know allat tho
now i can do some cheecky buffer overflow attacks guys 🗣️
Yeah you mostly care about overwriting the ra anyways, if your stack is growing down and your heap is growing up then you shouldn’t have an issue with the saved locals in that visualization at least
(I’m not super good at this tho so that’s just my pov)
Worth noting that there are calling conventions BTW, so it doesn't necessarily look always the same
i see
but wait in this case
isnt the bottom of a downgrowing stack at the side of the lower addresses?
Because in a stack we pop and push at the top of the stack right
x86 gcc usually pushes every param onto the stack without touching registers unless you use the fastcall attribute (the name is a bit misleading in case youre wondering there isnt really any difference in performance for x86)
downgrowing stack?
if you mean higher to lower stacks which is the norm then yes
i see
yo chloe you are good at c right
look at this program, when i input 100 characters into the program (so the buffer gets filled up)
now, suppose i enter one more character, shouldn't it already overflow the command array?
cuz as of now that shit aint happening it takes me 2 chars, is that like a general padding rule or..?
cuz at 101 characters it was still oki and printed /bin/ls but after i wrote another letter boom it immediatelly became ""
and then another character, boom it showed the new char/
Keep in mind that C strings are terminated with 1 char, so a char array of 100 length can actually only hold 99 characters. The last character is reserved for the null terminator
huh wait so when i write data to the buffer i can only use 99 of its capacity?
Yes
In memory, a 5 length character array would look like so:
CHAR CHAR CHAR CHAR NULL
There’s many videos out there on how buffer overflow attacks work, highly recommend watching one since my visualization is pretty bad lol
oowh shit, i continosuly asked chatgpt if the last character of the char is a null character and that bitch told me no
but that still does not explain why it took me 102 character inputs to fully erase the original string?
Idk fully, you might want to compile to assembly and look at the output
how can i make a qotd command with python using bible verses
create an interaction endpoint and then have that return a random verse
how would it set a specific time and channel for it to be sent to/in
Do you have a database?
oh, that would be even easier. you dont even need an interaction endpoint for that
i do not
Then it will be more difficult/impossible because you need to store this information somewhere
i dont know how to get or use a database
What language
python
you shouldn't just send message without user input though. at least let them enable/disable the notifications
thats the plan
some type of /set-qotd command that allows them to set a channel and enable or disable it
i'd go with serverless hosting for this. you dont need a vps running 24/7
wut
also do you have any tips to improve my embeds?
it looks pretty plain
create an interaction handler using a free tier AWS Lambda with a free API Gateway. That handler will listen to the /set-qotd command. when it gets that command it saves the channel id to a free DynamoDB table. Then create a separate free AWS Lambda that is invoked by Amazon EventBridge every day. That other Lambda should iterate through the channels in the DynamoDB table. Send a message to each channel with a second delay between each one.
the hosting cost for this is $0/month
you dont need to use a bible API. Just store all the bible versus in a DynamoDB table and give each verse an index starting at 0. Then use a random number generator to pick a number between 0 and the last verse then retreive that from the DB
alright
how do i improve my embeds
Trial and error
play around with different layouts. At the end of the day there is only so much you can do
how can i improve this though
Really a holy bot
the holiest bot
is it written in HolyC
the best C
just be a dev
so how do i make my embed look better
You could put like an image if you wanted. To make my embeds more clean, I set the color to #36393E which is the default Discord dark mode background color
what does #36393E look like
google it
dont add commands just to pad the list. Focus on quality then if you have an idea for something that genuinely makes sense, then sure
its a bible bot. what is there to make sense of
Idk. If you can't think of anything then don't force anything
Too many general purpose bots that just add features for the hell of it
They lose their sense of purpose
think of things that relate to the Bible/church that you would use/have in real life and then try and incorporate that into your bot
Add a button to the embed that lets the user fetch a new verse when they want
then you dont need a database or a scheduler
you could add a feature to let the user set which bible they want versus from
i added that before it gets too complicated
you should support the biggest 5 or so religions and then accept donations in your bot for each religion. Then make a leaderboard for the religions that donate the most.
i mainly focused on rthe bible because its my religion
so idk if i should do that
also, for the versions thing, i wouldnt be able to do each personal version for the qotd or anything like that
hey guys i have a very simple buffer overflow attack but this shit continously writes to the wrong address and it makes me crazy
the launch shell is at 0x5555555551e9 right, so that's the program i am trying to open
i have successfully found that the padding should be 120, after that it basically starts overwriting the return address.
for some fucking reason \xe9\x51\x55\x55\x55\x55\x00\x00 does not want to work
like putting:
\xe9\x51\x55\x55\x55\x55 makes my program simply crash (i assume it needs 2 more bytes to overwrite)
\xe9\x51\x55\x55\x55\x55\x00\x00 does not output anything, simply goes out of gdb
Can you overwrite $rip?
yeah
my padding is 100% correct, exactly 120 elements
cuz if i write 121 b's, the last element of the return address becomes 62 = b
somehow the address i am concatenating in the end is just wrong
what ar they?
Idk what I'd want from a bible bot other than
find a random verse
find a specific verse
and find a verse containing a word
maybe finding verses that are quotes from certain people?
e.g "findverse Jesus" and that makes it show one verse where Jesus talks
maybe if you're trying to make a minigame you could make the bot show a verse with certains words blanked and then if the person who used the command can remember the words used in the verse they get good boy points
doing that while calling it a biblebot would cause a ton of outrage
the books have diff names
The name can always be changed
until the bot gets verified
Well, it's better to open it to other possibilities now than later when it will be more difficult
ofc
im too young to even get it verified
why dont you try some other kind of bot? one with broader scope so you can comeup with new modules from time to time
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
well actually my multipurpose bot is revolutionary with hundreds of never before seen features 🤓
that's what every multipurpose bot developers said
I mean, mp bots aren't inherently bad, it's just that you'll have little to advertise it upon
Quite difficult to be unique with a multipurpose bot
Wasn't it HolyBot?
idk
Isn't holybot kind of even worse lol
Now this is a good idea
RIP Terry. 🪦
well, "holy" isn't limited to a single religion, it's a generic theist term
This is my understanding too. But I don't know too much about religions
I got my 3rd subscriber to my bot this week!
nice
what would be a good way to give users API access to my bot commands? My bot is setup like this
Discord API Gateway (Interaction URL) -> Lambda (Signature Verify) -> Lambda (Command Logic)
i'm thinking about making another API Gateway + Lambda for the user API or modifying the Discord API
Discord API Gateway (Interaction URL) -> Lambda (Signature Verify) -> Lambda (Command Logic)
User API Gateway -> Lambda (Verify token) -> Lambda (Command Logic)
token + ratelimit is pmuch enough
yep, and i'll need to do some more verification stuff. like i'll need to check which guild's token it is and make sure they aren't messing with another guild's stuff
should i mess with the API or make the user use the same format the Discord expects?
discord sends in data like this
{
"data": {
"options": [
{
"name": "1st_place",
"value": "@tribal ether"
}
]
},
"member": "...",
"application_id": "..."
}```
then i'll have to explain the discord Interaction Event format to everyone
i'm also using the resolved data too.
oh wait wait, you want to allow users to trigger commands IN discord through an api?
that's a recipe for disaster
yeah
i think it would be too dangerous
i'd have to check everything for trickery
let's say I create 10 accounts, run 10 instances of a script that triggers ping command on your bot in a certain guild, or even 10 different private guilds
I can easily ddos your bot by filling the message bucket
and you cant prevent this, cuz they're different accounts
User API Gateway -> Lambda (Verify token) -> Lambda (Command Logic)
the verify token would prevent it from getting to the lambda command logic
and it's all lambdas so it would just spin up a bunch and cost me money
different accounts, different tokens
for you it'd be no different than 10 unrelated users using the api
it would never get to Lambda (Command Logic)
how do you pretend to check at verify token lambda?
there is a command to create a token and it's saved to the database
then i look it up
i'll make the command a premium command too
^
if they want to subscribe then i'll allow them to attempt to ddos me
but then your other legit subscribers would be prevented from using both the api and the bot
discord has a different endpoint than the user
if they cause AWS to crash then theyll have a bigger problem than me
bots have a global message bucket
they can lock your bot by spamming way too many commands
oh, the commands just insert records into DynamoDB
they only do followup responses and there wont be anything to followup
i'll just make a separate API that doesn't use Discord's Interaction Event format.
i'll have to add each command manually, but i dont think users need API access to most of my commands
do you really need a discord output?
no, i dont think so
you could make a dashboard of some sort to manipulate those data
especially when the end user wouldn't even know what an api is
this is my current plan
A guild can only make an API token if they have an active Discord subscription to my bot. they generate that token via a Discord command and I save the associated guild id. Then they use that token against an endpoint that is different than the Discord Interaction URL endpoint. That endpoint transforms the data into the Discord Interaction Event format and calls the Command Logic Lambda
Not sure what this is for, but its important to remember discord messages are not end to end encrypted and is not a secure form of sharing tokens.
even ephemeral messages are not secure.
Not end to end encrypted afaik
gotcha, so someone on airport wifi can read all our messages
DAVE is only audio and video
this is what AI says
End-to-end encryption, which is found in apps like Signal or WhatsApp for example, ensures that only the sender and the recipient can read the messages, with no intermediary (even the service provider) being able to access the content. Discord currently does not offer this level of privacy for messages.```
discord already has access to the endpoint so i'm not too worried if they have access to those tokens
kinda creepy that Discord wants to read all our messages, but that's another issue
Wait until you learn texts and calls are not encrypted ^-^
There was that video a month ago ish that showed anyone with a few thousand dollar investment can track locations, texts, calls of a lot of people using just their phone number(no other info).
the telegram CEO was just arrested because the service supports end to end encryption
how can i make a command that translates words to hebrew
and describes them
n stuff
well...
We aren't chat gpt
google it
You will need some sort of translation api (google, yandex, deepl, etc etc) for starters
I don't think you can accurately translate to or from heb
Which is why so many bible translations exist
i kinda figured out how to do it
it sucks though
and my embed design is terrible
how do i improve this
It's fine as-is
no
Then improve it
i give up
its too hard
and i cant even fetch the definition of the hebrew word
There are many dictionary APIs out there you will need to research it, I will suggest using Postman to make the HTTP requests and play with the results then you can integrate it.
what made you think so
i just want to translate the input to hebrew and then send the english definition of the hebrew word
Idk where to put this but anyone have any good ideas on growing my bot enough where it has constant usage, but also dosent blow up? lol
it did what it was intended to do
in one way, it's well done
if you want to improve it, make the embed title only literal hebrew word
then separate each field into its own embed field
using whatever is the equivalent of canvas for python
do note that's a bit overkill depending on what you plan to use for
huh
tkinter seems to be for doing stuff like the image you provided, or any basic image stuff.
i have no clue how to do that
Cant really help much with python, not a python developer.
but the docs seem to explain how to use it ^-^
Since the library seems really simple I'd suggest just playing with it.
It's basically drawing but using code instead of mouse and keyboard
i need bot ideas too
i wanna make somethin original
butt i have no ideas
something that could get big
and be in a lot of servers
If someone has an original idea they're probably working on it or its a really large project that will take a long time and they dont want to work on it
- "EventHub" Bot
A bot that helps server admins create and manage events. It supports various types of events like game nights, movie watch parties, or community discussions. Key features include:
Cross-server event sharing, allowing people from different servers to join public events.
RSVP and reminder system to notify users about upcoming events.
Custom event categories (e.g., gaming, educational, social).
Why it works in many servers: Communities often run events, and this bot would help organize them across different servers.
chat gpt
that a good idea?
Discord does already have an event system
i js have no ideas
Not cross server, but I dont see that as helpful. But maybe I'm not thinking of situations it would be.
The bot market is so developed its really hard to find interesting and new ways to get into it.
any ideas?
In my case I do have an unique idea and implemented it, but I'm still pending to finish the tutorial I was making 
100k lines of code no prob, 5 minutes of tutorial designing is pain
any ideas for one i could make
Good ideas don't come easy, nor people simply give them away
bro.
Just make a bot and put whatever comes to your mind on it
Eventually you'll find something worth making a bot around
I wanted a real tcg on discord, i made a real tcg on discord
Even if it took me 4 years to make it the way I envisioned
i wanted to do a bible bot which i started but i dont think many people will use it. also, theres not much u can rlly add
Make a multipurpose bot, add content as you see fit
No better way to come up with an idea than doing that
guys do you know the answer to this question
given the trollish nature of my lecturer, i'm not sure which is correct

C
the question is "which of the following statements is false" which means if any of them is false then answer D is also false
although it specifies than only A B C can be false
weird way to design a question lmao
welp, then I dont think any of them is false
A and C cannot be false
and B has no little error I could use to justify it being wrong
D is a stupid option
I'd say go D, since as tim said the question only says the first 3 can be false, not the fourth
they want to troll the students so when a student answers something the lecturer would say "uhm ackshually you're wrong 🤓☝️" and give them a zero
does discordjs version 13 support multi select menu?
i dont want to update to 14. there are simply too many breaking changes.
is there a way to see documentation for previous versions?
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
this still sohwing me the new one
i clicked on guide from this link
You asked about documentation, not a guide. Guide is updated to the latest version because v13 is no longer supported afaik
gotcha, so in the documentation can i find multi select?
Wait, there is v13 guide - https://v13.discordjs.guide/#before-you-begin
@lyric mountain @pearl trail @wheat mesa this statement is true, right?
"Each recursive call causes another copy of the function's statements and variables to be created; this can consume a lot of memory."
from what i've known, recursion can overload the stack memory because each function call occupies a certain amount in the stack memory
Not statements but local variables yes
my brain said yes, idk
so... it's false?
Statements themselves don’t take up memory
Since all of the code for a function call is stored in the .text section, it just calls the procedure again, it doesn’t duplicate the statements inside of it
But this question is worded poorly so I’d say that this is true
well yeah because i google translated it

dw in my native language it's also worded terribly
(It’s technically not true but it doesn’t seem like it’s trying to trick you intentionally)
that's exactly what my C lecturer is doing

he loves trolling his students in his questions
That’s a lot of classes because they don’t expect you to know more advanced topics
A lot of what you get taught is “technically” wrong
On some level
"oh you answered that? well actually you're wrong because..."
recursion issue isn't memory usually, it's the stack yeah
Stack is memory
lmaooo he threw in a C++ and Delphi question in a course learning about the basics of C and algorithms
oh, right, meant more for the overflow thing
i mean in our first homeworks, i literally had to explain what an undefined behavior is

is there a way to show checkmark by default if that option is previous selected?

i dont see any attr tho
Each time a function is called there is something called a “frame” that gets allocated on the stack. It stores info about the function call, such as local variables, return address, parameters, etc. Excessive recursion is bad because it causes a LOT of stack frames to be created, and it doesn’t pop those frames until after you reach the base case, which means you sometimes run out of stack to use leading to a StackOverflowError
so is the statement true or false
i'm not sure if i wanna risk a "well, actually" answer here
from the wording itself i would argue the statement is false
because it technically isnt a copy (most things in C are references unless explicitly copied) and technically the memory usage isnt the problem (infers a misleading question)
I would say that TECHNICALLY it’s false, but the way the question is worded makes me say that it’s true
but if the teacher wants a basic superficial overview of what recursion is (aka repeat until finished but each scope is its own) then then answer would be true
hm, alright! thanks guys 🫶
from one of the documents provided by the lecturer, he wrote that it has to do with activation records

sounds like a fancy term of what waffle has explained 
in that case yeah, each recursion creates a new "activation record"
aka stack frame
never heard the term "activation record" before tho lmao
i think the lecturers here primarily take notes from geeksforgeeks 
:^)))))
wait, huh 
that's what my lecturer wrote lmao
That's correct
But nowadays you'll burst the stack before you even notice the higher memory usage
Unless you have a fat function recursing itself
The stack is tiny compared to the heap so yeah
But if you had the ability to have an infinite stack then it would use much more memory
ah, noted
me when
for (;;) {
int *hehe = (int)malloc(10000000);
}
you thought that was bad? me when malloc((size_t)-1); 

anyone have ever used react d3 tree? is there a "fix" so the next children's lines are on the other side of it's parent's node?
it's just connecting the next lines to the point the previous line came
akshually, nvm, i got it
this isn't true for Elixir
is C doing TCO too?
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -foptimize-sibling-calls")
Making solid progress with DAVE encryption!
is DAVE end to end encryption?
or is discord still holding the keys?
yes it's e2ee, and discord can optionally hold the public key, and only the public key
you can opt in to uploading your pubkey to an API endpoint,.but it isn't needed. also seems that bots can't do that atm
when they have the public key they can snoop, but not spoof right?
no
iirc they store the signature
so just verify?
which is derived from your key+snowflake
man i have no bot ideas
but considering uploading is optional and opt in I don't think it's an issue
not bad
make omegle using DAVE
lmao
no
you need bad ideas?
im getting trolled
but really don't make: anything AI, any general purpose mod bots, music bot, or Pokémon style collector bots
wow
like omegle remake using DAVE
if you avoid those you're already more unique than 95%
i made a bible bot but im about to quit since theres not much really to add
that's unique
add the sequals
expand it to other religions
its unique but not many servers would use it
and
only like 2 commands u can use
that are actually good
or make forks that do different religious works
i wanna js keep it to christianity
thats the purpose
if you only cover Christianity you only cover 31% of the possible discord user base
you could at least double your user base,.perhaps make a new bot for each
this idea is great BTW.
you should support the biggest 5 or so religions and then accept donations in your bot for each religion. Then make a leaderboard for the religions that donate the most.
#development message
well, can your bot convert atheists like me? make it do that (seriously) and you got something beyond just a discord bot
commit a percent to charity
the bot could accept donations from atheists too
the only thing u can really do for the bot is to fetch a specific verse and generate a random one
not much else to add
can it do bible quote of the day on a schedule
or let users pick a favourite bible quote or passage to attach to a profile?
i dont know how to do that. servers would also have to enable it
sure but worth adding
do things you don't know yet,.step out of comfort zone
itts a good idea
in whatever language you use? unlikely as it's probably js or py
just send a certain command to every server
python
id need a command to enable and set the channel as well
I don't really know python and I suck at js
all my bots are C++ with PHP dashboards
i have no clue what that even is
php 
this is hard
php for life
PHP is life, PHP is love
what is php
www.php.net, go see
only the one of the most popular programming languages in the world for web stuff
is php coming back? I heard they had a good upgrade
maybe you got a use for Dave e2ee, I think dpp might be first bot lib with it at this rate
idk if I want to make another discord bot
it never went away
I want to do more fancy stuff with uws
facebook did a lot of work on php
because I love annoying segfaults
intresting
wherever you look they all say PHP is still used on like 70% of sites on the web
that isn't a dead language that needs to come back
in fact PHP is my day job
js is still the underdog
apart from on front end
I mean, its mostly wordpress isnt it?
nah
wordpress, Laravel, WooCommerce, oscommerce, most of Facebook
magento
tons of cakephp sites
do people use hack besides facebook?
at work we mostly do laravel
no
Facebook don't any more
it was too divergent from php 5
a lot of what they did got merged into php 7 jit
which is now obsolete and replaced by php 8
there wasn't much gain between hack and php 7 except in specially configured setups specific to Facebook infra
and a complete impossible ball ache for anyone but Facebook to set up and use
how do i send a message to every server the bot is in
and there were many things it couldn't do like reflection, eval, etc
iterate through your list of servers in d.py
wut
that's good they stuck with php for the most part.
take a step back and learn a bit at a time
no
i'm sure facebooks experience with the php influenced the language a bit
use AI to do it for you
god no
AI is a great tool once you already have enough experience with programming to not really need it anymore.
Loop through each server and send a request, but you'll likely hit ratelimits pretty quick.
it's great for linguistically analysing large chunks of text and summarising
i wanted to set a qotd every day then send it to servers who have it enabled
idk how
I'd just use channel following for that tbh
then find out how to access each element in they list in loop
huh
should i just send a different one to each server
randomly generate it
For example. https://i.imgur.com/SEgpwxV.png
so your bot just sends 1 message to 1 channel and the users can follow that channel if they want.
does anyone know which companies still use haskell and what its main purpose is in the wild (i know its a functional language)?
I have managed to understand haskell pretty well a while back and i ABSOLUTELY love this language. Tryna do more with it, but first gotta know whether there's any demands for it lol
Elixir would be a better language for getting a webdev job
AI knows all. it can answer all your questions
give AI your code and ask it a question
open your heart to AI. it will lead you to the answers you're looking for
stop
look into Roko's Basilisk before making your decision on this
Roko's basilisk is a thought experiment which states that an otherwise benevolent artificial superintelligence (AI) in the future would be incentivized to create a virtual reality simulation to torture anyone who knew of its potential existence but did not directly contribute to its advancement or development, in order to incentivize said advancement
I'd really suggest avoiding AI answers until you're confident in your programming language.
i give up
i will be doing everything AI tells me to do just in case
don't necessarily want a webdev job
currently doing data analysis at a company, its pretty fun but idk i miss using haskell in the real world
lots of companies dont care which language you use on internal tools teams
Roko went on to state that reading his post would cause the reader to be aware of the possibility of this intelligence. As such, unless they actively strove to create it the reader would be subjected to the torture if such a thing were to ever happen.
lmao
anyone mind taking a look at this to see if it makes sense? its supposed to be a high level docs page about discord audio and what steps are taken to send audio on discord from a bot, what happens internally etc.
https://deploy-preview-1258--dpp-dev.netlify.app/voice-model.html
it's very good, but the padding is way too big
Looks pretty good. For more technically correctness, I'd use the word socket instead of websocket when referring to the UDP connection to the voice server.
also I'd dim the background color and use a sans-serif font, and use different colors for arrows and text or avoid having arrows cross text
why is that so true?
no, websocket and the udp connection are different things
theres a websocket, an actual https websocket, which is used as the control channel for the UDP, the UDP is just used for the audio stream
That's what I mean. In the docs you refer to two "websockets" which is technically incorrect. When referring to the UDP socket, it should be labeled as such
no
there are two websockets
and one udp socket
first websocket: the discord shard, where the server is
secondary websocket: control socket for the vc
udp socket: RTP stream target
but the first websocket we only use to request details and token to get to the secondary websocket
Ah. I totally forgot about the hole punching step
does hole punching really work?
i heard its only a theoretical way of connecting two clients behind a NAT
is it practical is probably a better question
it doesn't really matter if it's practical or not if it's the only option
how could i make a bible api
have a database containing the bible, possibly divided into passages or some other parameter
then make a server that receives http requests and retrieves information from this database
and returns it to the user
i dont know how to do all this
on my tsc, when i compile my tsc file to js, it always adds .default behind the name of the import its fucking annyoing. Any way to stop it?
For example:
import moment from moment-timezone:
now adds:
moment.default
i dont know how to do that
at all
finally managed to implement my template system in nodejs for my bot's webinterface
me when people reinvent the wheel
what database and how do i do this
There are tons of database options. You can research which one makes sense for your use case, but some popular options are PostgreSQL, MongoDB, MSSQL Server, SQLite
when i tried mongodb it kept showing an error
im just trying to do it through github
but i dont get how to do it
well github isnt a database
yeah github is for source control and making your code public
how
sounds like you need to watch a mongodb tutorial
MongoDB is a database, it doesn’t create an API for you. Look up “how to make a REST API in [x]” where “x” is your programming language of choice
what would i make the API in
That depends on your programming language
There are tons of API frameworks, it’s up to you to choose one based on your needs
i do want it public though
GitHub is for open sourcing your code
It doesn’t deploy your API (not counting CI/CD pipelines)
yeah i know
So you want your code to be open source and visible to everyone?
yeah
In that case, you can use GitHub for that
Now that you know you must make a decision.
first step for you is probably getting all the data and putting it into a database
Get the data, store it in a database, set up a REST API that queries your database depending on the endpoint of HTTP methods used
That’s the general idea
I already found this for them
https://github.com/scrollmapper/bible_databases
i use mariadb mainly
could someone bless me with the answer
Does anyone have a problem where the child expands its parent? When it reaches a certain amount of items on that container above the image the container expands
It's overflowing, but it still expands for some reason
i made an api in replit. how do i host it with the zip file
qq vc ta usando pra ajustar o tamanho?
replit itself is capable of hosting it, otherwise you need a VPS or smth alike to run it
alas, you dont move projects using zip files btw, use git
this way you have a backup in case something goes wrong with the files
i cant host it 24/7 tho
…
apis, bots, programs, games, they're all the same
the only difference is where they're being executed
it's only online as long as someone is running the code somewhere
for api tho you dont need 24/7, you just need it online when someone is actually using it
so replit will fit for it
can we talk brazilian here?
nesse canal em especifico s
im using it for my bot tho
so it kinda does need to be 24/7
Well, you can rent a VPS where you can host your bot and your API
entao qual elemento voce ta falando
o do overflow?
.citizen-list {
position: relative;
width: 100%;
max-width: 100%;
display: flex;
gap: 1%;
overflow-x: auto;
overflow-y: hidden;
&::-webkit-scrollbar {
display: none;
}
.citizen-name {
padding: .5% 1%;
box-sizing: border-box;
background-color: var(--mdt-focus-color);
border-radius: 2vh;
color: var(--mdt-primary-background);
font-size: 1.4vh;
display: flex;
align-items: center;
white-space: nowrap;
.icon {
flex-shrink: 0;
width: 1.5vh;
height: 1.5vh;
background-color: var(--mdt-primary-background);
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
margin-right: 0.5vh;
svg {
font-size: 1vh;
color: var(--mdt-focus-color);
}
}
}
}
im too brike
broke
Then you have to choose either 24/7 (paid) hosting or free hosting
Raspberry Pi :D
se vc usar a unidade vh ele vai ignorar o parent
na vdd qlqr unidade q n seja % vai
só q, se o pai não tiver tamanho fixo, os filhos tbm podem "esticar" ele pra fora do pai
24/7 free!
então ou vc usa a msm unidade pra todos, ou usa um constraint pra limitar o tamanho maximo
You can host using serverless and it'll be ready 24/7, but only goes online when someone uses your bot
Good luck then
ok
AI can help you find these answers.
Us humans are flawed. We don't know the Answers.
It's not called Brazilian. It's Spanish.
🙂
That's a good NIN song
entao o problema é o icon?
a classe?
anyone know how i can implement rate limits using FastAPI?
usa overflow-x: scroll pros campos
mas não da pra saber mt a causa verdadeira sem ver o css inteiro, e o html
pelo inspect elements vc consegue ver a disposição do layout
pra saber oq empurrou o container pra fora do pai
como?
vai usando a setinha, no site o elemento atual vai aparecer em azul
vai indo até vc achar qual q ta grande dms
n tou percebendo se eu usar a setinha ele abre o elemento
mas supostamente é o icon
você sabe alguma maneira de fazer um quadrado com percentagem?
ou com outra medida sem ser vh ou vw
afinal nao é o icon
sinceramente nao consigo perceber..
ata, tem outras coisas dentro dele
então, tem um porém
o % n considera outros elementos
se o pai tem 500px de largura, então 100% seria 500px
pra vc fzer oq vc ta fzendo precisa usar unidade flex
flex: 1
ou seja no citizen-list em vez de display: flex coloco flex: 1?
por exemplo, se o pai for do tipo row (horizontal), e todos os filhos tiverem flex: 1 então eles vão dividir o espaço igualmente
flex é como se fosse uma "fatia" do tamanho
3 elementos com flex: 1 daria um total de 3, então cada elemento ocupa 33% do tamanho
se 2 tem flex: 2 e 1 tem flex: 1 (total 5), então esses 2 vão ocupar 2/5 do tamanho, e o outro vai ficar com 1/5
pensa como se fosse uma proporção
no container cinza coloca flex: 1
no container q ta no lado esquerdo faz a msm coisa
dai vc ajusta o flex até ficar na proporção q vc quer, se aumentar o flex ele aumenta o tamanho da "fatia" desse elemento
depois como controlo? nunca usei o flex
o flex só afeta o tamanho do elemento dentro do pai, a questão ai é q o display: block mexeu nos elementos internos
coloca uma <div> dentro do container cinza só pra ter o display: flex
sobre controlar o flex, vc precisa imaginar o container como se fosse um bolo
dai o numero flex simboliza qual o tamanho da fatia q o elemento vai pegar pra ele
o tamanho do bolo é a soma de tds os flex
flex/total flex
a div vc colocou dentro do container cinza né?
sim
e o container cinza ta display: block ainda
vc colocou flex nos dois?
ignora o html, to falando doq ta atras da janela
aqueles elementos à esquerda do container cinza tbm precisam estar dentro de uma div com flex
ta tem coisa errada então
volta ao q tava no começo
tenta por auto no width do container cinza
ta, nao mudou nada
hm, tenta no inspect elements ir deletando oq ta dentro dele até ele voltar ao tamanho certo



