#development
1 messages · Page 127 of 1
class Test {
wee: string;
constructor() {
this.wee = 'Woo';
}
toString() {
return 'hi!';
}
}
console.log(test.valueOf(), test.toString()); // Test { wee: 'Woo' } hi!
is what happens,
Re-reading
This method is called in priority by numeric conversion and primitive conversion, but string conversion calls toString() in priority, and toString() is very likely to return a string value (even for the Object.prototype.toString() base implementation), so valueOf() is usually not called in this case.
It seems like you're right, toString is a prority.
I think the first line confused me 👀
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf
Yeah, I'll look over it. thank you
You're welcome
If anyone comes across this conversation in the future. this is neat ^_^
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive
The Symbol.toPrimitive static data property represents the well-known symbol @@toPrimitive. All type coercion algorithms look up this symbol on objects for the method that accepts a preferred type and returns a primitive representation of the object, before falling back to using the object's valueOf() and toString() methods.
javascript
@wheat mesa do u know how vectors work?
Yeah
I have absolutely no idea how to work with them
Well, in what sense?
Vectors as in the list, or vectors as in the math vectors
in math context
Yeah
like, I'm making a script for a game I play, I'm trying to figure out how to get the relative angle of block X with block Y
ok, so, got the diagram
oh boy 3d
this is the WorldMatrix that each block has
so, first of all how tf do I even read this 
ummmmmm
I haven't done much matrix stuff
But your goal is to get the angle between two blocks based on their xyz positions, right?
not really
I'll paint it, just a sec
the green square is the reference block (imagine it's facing forward), the yellow is the block I'm trying to find the angle of (denoted by x - it's facing the red line direction)
ohhh
the hardest thing is that the only thing I'm given is the WorldMatrix of both
there's no GetAngle or anything
yeah this is difficult
this is what I'm making (a sonar)
the whole thing does work, all I need now is the damn angle
So you would still be using atan2(dy/dx) somewhere, but you have to find dx for this scenario
hmmmmm
the worst part is that they don't usually teach vector/matrix operations at all around here
at most we scratched what they are and what they look like
so you want the angle between two vectors, right?
Yeah I'm not incredibly familiar with matrices, since I haven't done those in a while, but I am decent with vectors
well, yes, I just don't know how to extract the angle vector from that matrix
once I have the vector it's fairly simple to transform into degrees
Cast a unit vector facing from that angle out, and one towards your reference block, then atan2(dy/dx)
lemme illustrate
As for how to do this with the matrices, I'm not sure
And then for it to be programatically correct (and not have undefined values at 90 degrees), you'd use Math.atan2()
And those vectors are just normalized unit vectors
this is what I managed to get (current code) by diving through forums
<cos(angle), sin(angle)>
but I'm not sure GetOrientation().Down is what I think it is
also, GetOrientation() is a matrix too 
Ah this is C# as well, nice
yep
I haven't done much with 3d vectors unfortunately
I'll get back to you after I finish my first linear algebra class 😉
seriously considering taking a few linear algebra courses
I might be able to help later, I'm trying to learn some 3d opengl which is gonna require that I relearn matrices
const parse = require('parse-duration')
const length = parse(length, "ms")```
honestly, you'd likely love space engineers 
just to save you coming back asking for help 
😐
the scripting api math heavy af, and is c#
ew a kiss from battleless
bruh
wtf luca
wait you are not battleless anymore?
i am
I approve
can a mod make my username battleless
after all the battle he had in this server alone, he had to remove "less" at some point
taken
This summer I'm trying to learn a lot about that sort of stuff
broooooooooooooooooooooooooooooooooooooooo
NMOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
When do we get to change our names, is that coming soon to older accounts
Space Engineers is an open world sandbox game defined by creativity and exploration.It is a sandbox game about engineering, construction, exploration and survival in space and on planets. Players build space ships, wheeled vehicles, space stations, planetary outposts of various sizes and uses (civil and military), pilot ships and travel through ...
$19.99
89406
this game
lmao
there were psychos that made a fuckin gameboy emulator in that shit
I'm mostly going to spend this summer learning some linear algebra, doing 3d opengl, and learning more about compilers
I'm going to do an accelerated masters degree so I gotta find an area I want to specialize in 😭
well, what about computer engineering?
nitro old accounts then old accounts
you dive into low level stuff all the time
Eh, engineering isn't really my thing. I want to do software specifically, so there's a few areas within my CS degree I can specialize in
(I guess it's a form of engineering, but you know what I meant)
Data Sciences Track
Cyber Security Track
Intelligent Systems Track
Interactive Computing Track
Networks and Telecommunications Track
Systems Track
Traditional Computer Science Track
These are the options I have to choose from for a CS masters
How do I reload my bot and I can't find the reload button?
lol
!reload bot
reload the bot or the bot page?
uh
I might do the traditional CS track
why is it different icon now
The bot image on top.gg
he evolved into a pokeluca
looks like it's a pretty robust option for going into something I'd like to do
🧐
bot page -> reload -> edit -> save
Thx 🤝
@lyric mountain @wheat mesa i literally fell asleep while watching this https://www.youtube.com/watch?v=tRaq4aYPzCc
There's a strange number system, featured in the work of a dozen Fields Medalists, that helps solve problems that are intractable with real numbers. Head to https://brilliant.org/veritasium to start your free 30-day trial, and the first 200 people get 20% off an annual premium subscription.
If you're looking for a molecular modeling kit, try S...
wait what tf
the 0.999... = 1 I already knew, but that multiplication thing is wtf
how do i get a member from a guild in discord.js
Depends
on what
By his id or his name?
id
guild.members.fetch("memberid") should work
try guild.members.fetch
why do i need to fetch
Maybe member is not in cache
i have guild members intent
what you wanna make
Guilds and channels should always work with cache.get but members you need to cache yourself
in config what are you storing ?
stop
😶
that has nothing to do with it 🫥
Also fetch gonna put member into cache so next time it's not gonna fetch him from api
xoxo
bro
i know that
i am not stupid
why does everyone think i'm stupid

if everywhere you go the same thing happens over and over again, maybe you are the source :^)
what
explain in simpler terms
🦅 i agree
why doesnt my custom html want to work on topgg description
are u declaring the full html structure?
should i?
like <html>, <head> and <body>?
no
only <style>
try applying the styles directly on the browser
see if it works as you expect it to
aint gonna work cause of what i have
then that's the reason it's not working
if the styles work in the browser, they work in the long description
same for the opposite
paste the styles block in the page's head, see if it applies
if you're using any js, it wont work
are u importing the css?
just
<style>
css stuff
</style>
html stuff
yes, but did u write the css or are you importing from somewhere else?
copy the styles block, press F12 and paste in the page's head
don't use a separate file for that
sigh
look, go to your long description, copy <style> AND EVERYTHING INSIDE IT </style>
press F12 IN THE SAME PAGE, go to elements, click on <head> and press ctrl + v
see if the styles work on the page
if they don't, then your css is wrong
i did that and it broke topgg
then u pasted in the wrong place
and its not my css fault cause it works in the browser
i did what u told
"works in the browser" is not a validation of your css
it's hard to give u any help without seeing the css
can you take a look at the code yourself
okay
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
the !important tag is cuz of my experience with my other topgg custom html changes
i see the animation doesnt work unless !important is removed from keyframes, but idc about it rn, i need to fix the boxes
hm, aside from the !important abuse, I don't see anything out of normal
does at least the background color chance work?
nvm, rewatched ur video, it does
try applying those styles to some existing topgg elements
like, change .boxes to body, see if it applies that block
if it does, then topgg doesn't support custom classes
try {
if (value) return res.writeHead(400), res.end()
} catch (err)
res.writeHead(500)
} finally {
res.end()
}``` Would the `res.end()` still be called if value were to be truthy?
huh, js can return multiple values?
or is that a typo?
it will just return the last thing
return a, b would return b?
ye
...ok, this is the part where you try to justify their design choices
its a pretty dumb thing but you can use it to do stuff like return dosomething(), result
so it's just a one-liner for ```js
dosomething()
return result
that smells like 2 weeks of debugging to find
expecto D
yeah that seems like a terrible idea to use
welcome to js 🔥
good but also shit
are u still one-lining everything?
that's the type of shit that's on the java certification exam I had to take but with java so it's 10x more obscure and more unintuitive
but hey, I passed, so worth it
js is like building in a plot of land without fences, you gotta know the limits yourself to avoid making dumb mistakes
but as long as you know them, everything is fine
also, beyond the fences is the farlands from minecraft
:^)
I miss farlands
I wonder if there's a mod that makes the entire map generate like farlands
it's fun to play in a wacky terrain
btw @wheat mesa, gave up on figuring out how to work with matrices for now, resorted to a rotor (which has GetAngle)
👍
now I need to calculate how fast the rotor has to rotate to complete 1 pixel-degree within N ticks
the pixel-degree is dependant on the current resolution
niceeee
but that's for tomorrow, enough math for one day
I'm so glad I'm done with that java certification exam
my god
the questions are so cancerous
Some of the questions aren't even hard, you just wouldn't know them unless you've done specifically that thing before
ex:
Thankfully I knew this one, but only because I've gone through hell with these shitty syntax rules for enums
another one
lol
i hate this.
so specific
only B is illegal no?
beautifier
it was kind of funny taking the exam, apparently you're put into a zoom call with a proctor and like 15 other people
but those 15 people are from all around the US
(and other countries I'm sure)
so I'd see some dude in his 40s taking the exam in some random place while taking the exam
idk why, it was just funny
honestly, those exams are meaningless in measuring knowledge
like, why tf do u need to know which enum syntax is valid? the ide is there for exactly that
"but I code in notepad" there's the damn compiler then
One of the kids that failed has developed an app that helps diagnose parkinson's disease with machine learning, she made a legit research project
She made a 64.3%
The passing score was 65%
It was tragic
those exams usually have a ton of false-positives
Dude some of the questions were literally wrong
common dutch grades, getting a 54% when 55% is passing
so common
Like, not even like a "I don't know this obscure feature so it's probably wrong" type wrong, but a question with literally no correct answers was on there
like, people who code for years don't give a damn about such details, they simply write their mind and let the ide fill the gaps
Asked something about What outputs "hello: world!" but there was absolutely no colon anywhere
I passed with a 75%
Super happy about that
lul
Most of the stuff I got wrong was on exceptions, I always forget the hierarchy and shit
But it doesn't matter
a proper test would be to ask yall to do X and see which ones did it better (or did at all)
true
It's not easy to accurately measure that though, nor is it easy to measure that en masse
They're just looking for an easy metric
Aka multiple choice questions
Damn dangling pointers, forgot I have to watch out for UB
That doesn't work, but this does
agh
Well, that's kinda obvious because shaderCode is a constant and you're reassigning it in the the code above that
the second code does not count as reasignment?
shaderCode = raw.c_str();
Oh nevermind it seems like I read it wrong, they're reassigning the pointer address, not the value
so why does the second code work but not the first one?
im as confused as waffle here
It works just fine for me, I'm not sure what issue they're running into
@wheat mesa mind telling us what issue you're running into with the first one?
Ah I just tried with the try..catch blocks and that's the issue, they're reassigning the address the shaderCode pointer points to in the try block, but once the try block is over the value is destroyed, hence the address points to nothing outside of that try block
@quartz kindle ^
ah so the block scope of the try catch ends the life cycle of the variable?
Correct
yeah i see it now, the char* is owned by the std::string, so std::string must exist outside of the block, for the char* to exist
unless you copy it to a new address
Yep
can you change the ownership of a char*?
like remove it from an std::string
without copy
so that when the string is destroyed, the char* is not affected
That's not possible without a copy
ye i figured, i tried doing this exact thing a couple years ago in a nodejs native addon
trying to store a js buffer on the c++ side
Though you can also move the value (std::move) to prevent a copy
hmm i might give it a try later
what i was trying to do was store js data on the c++ side without copy
since napi supports buffer transfers without copy
but i could only get it to work by retaining the entire buffer object structure
when i only wanted the bytes it held
Also this has nothing to do with JavaScript alone, many programming languages allow this including C/C++
It's the comma operator (,) which allows for operations to be done in a compact sequence
var a = 1, a = a + 1, a = a + 1, a = a + 1
:^)
Most readable 🔥💯
honestly i really dislike such things, id rather do ```js
let a = 1;
let b = 2;
let c = 3;
than ```js
let a = 1,
b = 2,
c = 3;
Same, though the second way is preferred when there are lots of variables with the same type, or if there are a few but it's pretty readable and not bugprone
for (let i=1; i < 4; i++) {
globalThis[String.fromCharCode(96 + i)] = i;
}
imo the most readable method

ik it for variable declaration, but allowing it for return is...dirty
Many programming languages also allow that
It's basically an expression, evaluated then passed to return
it's the type of thing you'd spend way too long finding the issue
akin to the braceless if/while/for clause
In my opinion it doesn't really change anything in case of debugging, linters or debuggers will also tell you the issue regardless, but yeah that pattern should be avoided as much as possible
^ this guy should be avoided as much as possible
jesus christ
lmao
hi i am getting this although the command is working normally
[trigon-backend] [2023-06-07 11:34:07]
[trigon-backend] [2023-06-07 12:29:35] at async CommandInteraction.deferReply (/workspace/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:57:5)
[trigon-backend] [2023-06-07 12:29:35] at async Object.run (/workspace/src/commands/slash/tools/rarity.js:29:7) {
[trigon-backend] [2023-06-07 12:29:35] method: 'post',
[trigon-backend] [2023-06-07 12:29:35] path: '/interactions/1115980876489171046/aW50ZXJhY3Rpb246MTExNTk4MDg3NjQ4OTE3MTA0NjpxMTROT2sxSERUUFJlNzF5Z1VSMldiaUtKV1ZBQkFCbnFIVFFIb2pKYzlhd0RZQzVMWnZ5VWJYYzBjM0dKSWRoaDU5OUY3Y0JuNkt2SjJwbjMxNEU4TzBxc05nMGlmUzljeHhDWGR1ZEFIZXVweXhYR2hIWDBKakRlZmJhWGpIYg/callback',
[trigon-backend] [2023-06-07 12:29:35] code: 10062,
[trigon-backend] [2023-06-07 12:29:35] httpStatus: 404,
[trigon-backend] [2023-06-07 12:29:35] requestData: { json: [Object], files: [] }
[trigon-backend] [2023-06-07 12:29:35] }
[trigon-backend] [2023-06-07 12:29:35] }
[trigon-backend] [2023-06-07 12:29:35] reason: Unknown interaction```
keep in mind, the bot is ran on digital ocean, does that mean it could be running multiple instances of the bot?
lmao, djs giving an ssl error, thats a new one
does that happen randomly or every time?
random i would say, last time it happened was tonight (i guess the last instances went off now and online main is live)
and now its happening again as i updated the bot, fucking hell digital ocean is annoying
any idea where i can host my bot & backend api where it doesnt keep old instances of the app?
(i know we can do it on a personal api but would mean i would have to update https certificate everywhile)
yup 2 instances are running dang digital ocean sucks ass
anyone uses digital ocean in here?
Never to be honest
i mean, having two instances running should not be their fault, you're the one who controls that
yea
and how do you stop old instances?
there is no option to delete old instances
old instances just stop alone after a while
does it use linux cli?
u could try to shutdown the instance
as if you were shutting down a pc
how are you running your system?
are you using an actual vps? or some kind of app container?
He's using D
whose D
Deez Nuts
your D then

^^
app container
ah well... i have no idea about app containers, never used them
its the first time i use them as they have automated update for cerificates, well i guess i am gonna just switch back to a vps
@wheat mesa @quartz kindle yep
I'll try now to auto-adjust rotor rpm based on the configured range
I'd try to allow multiple sensors, but that'd require figuring out that matrix shit
what
wym by that
ok guys
i have a very technical question to ask soon
i will ask in a few hours
i hope you guys can help im stumbled
😮💨
dayum thats cool
old deployments are still running (till they automatically turn off)
made it mostly because the server I play at has 3rd person disabled
so navigating with a huge-ass ship only being able to see what's in front of you is terrible
its an existing game?
yep, space engineers
usually you'd navigate through cameras, but constantly switching between them gives motion sickness
you sadly cant link a camera to a screen
did chrome disable the ability to view individual cookies and values?
attempt to dumb it down and hide cookies id imagine
what version is that? 114?
im still on 113
well, it's not very in-depth indeed, but you do have to engineer your way into space
i think its an update to chromium not just chrome
kuuhaku can into space
im seeing it on other chromium browers too
dont see how chromium maintainers even allowed this 💀
edge's still fine
i know its google people but its still kinda open source
hmm im gonna have a deeper look
brave does it now too
yeah edge is fine
gonna try chromium
it's an edge case /s
finally microsoft has an advantage they can force down you to make you use edge instead of chrome
lmao
That has nothing to do with us Chromium maintainers, that's Google's doing
You can still check the data by going to the developer console and checking the "Applications" tab
There's a "Cookies" section
thats confusing then because brave has this too? i wouldnt expect them to copy this since majority of users are "more technically literate" ?
but its good to see its not a chromium thing#
to be fair actually it's a better move
move developer stuffs to the developer console
Correct
most people dont really need to see content of cookies
im using ungoogled chromium, still no update for me
i just thought they got rid of it completely
with us Chromium maintainers
ayo
how many OS projects are u into?
next step is becoming an employee
i wonder what its like to work at google
some people say its good some say its very stressful and pushy
yeah companies this days have this "culture" crap and many other annoyances
they dont let you be yourself anymore, you have to be like them
and they give you all sorts of benefits except actual pay, because they get tax exemptions from giving people benefits
my company has a culture of a pirate theme for some reason
the company is the pirate ship and were the "pirates"
i find it cringe but i dont say anything 😂
Many major projects at this point
I'm a member of
- Node.js organization
- V8 & Chromium team
- TC39
- OpenJS Foundation
- LLVM Developer Group
- IETF Management Council
- W3C
And I maintain
- Node.js as well as it's core utilities
- V8 JavaScript engine and the Chromium web browser engine
- LLVM compiler infrastructure
- The JavaScript programming language
- IETF standards (notably the ones that make up the internet, HTTP, HTTP2, HTTPS, UDP, TCP/IP, etc etc)
- W3C internal standards as well as some standards like CSS (from CSSWG)
how did you even get into all of that? you just made PRs and then asked to join? or did you join by some other way?
like are you some kind of top 10 graduate from some ultra hard indian university?
i could not be asked lmao just being part of one big project is too much for me
same lol, i dont even work on my own projects
bro made node.js
wtf
he has an IQ of 200
really?
I want to contribute to some open source stuff, I just have absolutely no idea where to start. It feels like you need a good understanding of the codebase you’re contributing to, and I don’t know how you achieve that without actually working with that codebase for a long time
I worked hard to climb up the ladder, contributed to many of them, dedicated most of my time to them, and finally became a member and a maintainer
I'm also an invited expert at some of them (TC39, IETF, and W3C)
well i kinda got to that level by working on a separate plugin, ie djs light
you can try making a plugin or extension or mod to some exiting thing, which will force you to learn the code base
and eventually you will know it well enough to suggest changes and PRs
yeah if you contribute enough and make high quality contributions youll probably be invited as a contributor then you can kinda network off of that with additional work
I’m also 0% confident that the code I write is up to standard with what people would accept in a PR
how many years have you been working in nodejs?
The final large thing I'll join to is the Unicode consortium, and to also maintain ICU (International Components of Unicode) and similar
I don't think I can handle more
please make tzdata updatable separately
kthxbye
Almost 3 years now
that's pretty cool i wish you luck on your future journey, how do you even find the motivation though especially since you dont even get paid for oss contributions? unless you join some board or whatever but thats another thing
hard to find projects i am really 100% on and enthusiastic about to contribute on
I don't get paid to do any of this work, my only motivation is to make the world a better place, and to also make things better for everyone, that has always been my motivation
yeah, especially when they are not yours, so you are not really given any credit for your work
Nothing less, nothing more
at some point i was the only maintainer of a lib, so i quit it and made my own version of it
you are jesus
why not just ask them to make you owner
god bless
why make new one
i made big changes
basically rewrote everything from scratch
what was it
sweph
I’ve never made a single PR in roughly 3 years of programming
but why
do you have any knowledge regarding unicode
(Granted I’m not super advanced for the amount of time I’ve spent programming)
your very advanced waffle
unicode is pretty simple tho, no?
simple?
sounds hard
I could probably make PRs to Java codebases except for the fact that they all use 35 giant patterns lol
i mean, its pretty easy to encode/decode utf for example
unless you mean something else
And even Google Bard predicts that I'm gonna work at Google :^)
https://lensdump.com/i/6SZ7uA
hahahah
how does google know your identity
read this and say simple again https://unicode.org/reports/tr9/
damn even chatgpt knows you

Google knows everything, but this one is probably because voltrex has an online presence
tbh why make open sourde when you can make closed source and make people pay
ah you mean the gramatical side of it, not the programatical side of it
(Considering the amount of things he works on)
you could make a lot of money doing that with nodejs
Because the world runs on open source projects
yes
Not everyone does everything for money you know
that's what you get in the unicode consortium
Why would I want to maintain something I have no knowledge about? That just doesn't even seem right
money is nice tho
only make it like $5
to support the deca
when you become ceo of google, give me a nice job? :3
Money is nice but it’s not necessary, if nodejs were closed source do you have any idea how many projects just wouldn’t exist
preferably one without too much work :^)
but its already big
Because it was open source
if they do it now theyll make lorsnof money
bc people wont wanna switch
yes yoy lose lots if people but make lots of money
trust me, people WILL switch
irs a win lose situation
The greedy capitalist mindset
I'll give you the job of "Google CEO's personal catgirl maid", $600,000/year
Gotta love it
deal
Dude LinkedIn tried to recommend that I apply for a level 6 position at Netflix… with an estimated pay range of 300k-900k per year
nope
only maybe like half will switch
💀 they really thought I was qualified
I mean, reddit is also big, and look at how many apps are simply ceasing to exist (unless reddit steps back)
just switch to bun
they support like 90% of the node api
Or deno
they wouldn't
idk what a bun is
another js runtime
yes they do
There’s tons of alternatives
they pay $10 and move on
no they wouldn't, buddy reddit is a living proof of that
Nobody is going to pay for nodejs except for maybe a few large companies that rely on it
dont call me buddy, bro
yes they will
$10 isnt mucu
okay buddy
if nodejs becomes a paid project, nodejs will literally die
Dude, you wouldn’t even pay someone 10 bucks to write code for you since you were too lazy to do it yourself, I doubt you’d pay 10 dollars for the ability to run code
tbh they should make me ceo of nodejs
ya really ignoring what I'm saying about reddit
but why did you decide to jump from llvm to unicode

resend it
i kinda just didnt read it cus
u wrote too nuch
"jump"?
reddit api will be paid, many big projects (including apps and 3rd party clients) are simply gonna die because nobody will pay
i would a lot of my projects rely on nodejs
Based
those projects do raise income for the devs, yet they're giving up
voltred be looking like that dude who become a doctor, enginner and astronaut, all before he was 30
yes but theyll make money
Ecen if people stop using
Yeah, you’re like what, 19 @earnest phoenix?
Correct
reddit will, but the devs of the projects wont
so, if nodejs was paid, nobody would pay
thats their issue
Bro he’s a little more than a year older than me with 35 years more experience than me
reddit isn’t responsible for their financial sotuationt
or something like that
Actual gigabrain
I'm just that good 😎
i know a guy from work that started coding at age 7 he can scan through lines of code like a machine now 💀
I started when I was 15
I don't know if your question makes sense or not, I'm just interested in the inner workings of Unicode and it's components, so I want to maintain them and make major/important decisions
nor is nodejs for its users
like what
Hm?
yes, but paid node = no users
major/important decisions like what
yea users
me at 14 get better
thre ones who paid
All I’m saying is that Oracle doesn’t even charge for Java, and if oracle doesn’t charge for something then you know it’s not easy to monetize
They’re dumb but extremely rich from the things they do
The next breaking changes, important design decisions, what new characters should be included, etc etc
Their CEO is one of the richest people on earth
yes
I got a good example for you battle, one I'm currently using daily
i will be richer than him
ever heard of delphi?
no
(Actually no maybe he’s not the CEO, the owner is)
to use the java length() function on a string, you must purchase java pro, run java_pro() in repl for more info
well, it's a language where both the editor AND the language are paid
w languagr
not exactly, as it's a dying language
😮💨
they milked it so much that they killed the whole thing
i would do it better
like java but they kinda revived it by removing the boilerplate for a simple hello world (kinda)
the only users left are those stuck to it from legacy codebases
nodejs is too big for large projects to switch
they rither pay or make all their code
💀
new users are nonexistent as the license price is extremely high (cuz they need to compensate for the lost quantity)
real ceo mindset
so it's literally a death spiral
if you think about it all programming languages have vendor lock in because different syntaxes
ok guys i hace a wuestion
the price will continue to raise until not even the most loyal developers will be able to afford
and then, embacadero dies (the owner of delphi)
this is why u don't put a price tag in a language
axtually i gtg
matlab
will ask soon
java didn't revive, it never really died
the boiler plate thing is somewhat justified - you're not supposed to use System.out.println for anything but debugging, use Logger for anything else
tho adding unnamed classes and removing access modifiers from main is somewhat good for quick projects
use log4j for everything else
:^)
now first thing you see on google for log4j is the vulnerability
how did that even happen
i never knew you could fuck up logging to the console
the java special
ok guys
lets say a user has 4 different xp
and for a role the user needs a specific amount of each to get it
and theres many different ones each with higher xp needs
how would i go about giving them the highest one they can get
like what, the highest of the 4 xp is the one that counts to unlock the role?
something like rpg stats and items? like to equip a sword you need 50 str and 25 dex
close enough
but its differiwnt cus theres lots of roles
so just check each of them
nothing but i think about it and i dont get how i can do it
because how do i determine which is highest one
is there a package thay can do it for me
yes
or of the roles possible?
each role has progressively higher xp requirement so like
but if your roles need a certain amount of a specific xp type, why do you need to know which xp types is the highest?
role 1
xp 1: 1
xp 2: 2
xp 3: 4
xp 4: 3
role 2
xp 1: 3
xp 2: 5
xp 3: 6
xp 4: 6
i want the user to get highest one
so if they hace enoutj in each xp they get 2
but if not they get 1
well, one easy way to do it is to loop over all roles, from highest to lowest, untill you find the first one where all xp requirements are satisfied
but how do i eo from highest to lowest
theres mutiple xpa
xps
wait
i get it
i thino
i do each one seperately from highest to low
i think
idk actually
thisbuurts
const roles = [role1, role2, role3, role4, ...];
for(let i = roles.length - 1; i > -1; i--) {
if(user.xp1 >= roles[i].xp1 && user.xp2 >= roles[i].xp2 && user.xp3 >= roles[i].xp3 && user.xp4 >= roles[i].xp4) {
return roles[i]
}
}
as long as the roles are ordered correctly, yes its that simple
yes
how do i unhardcode this
for the if part
😮💨
like if you want to add more xp types?
you can organize xp types in an array for example
and you can add more xp tupes in the config file
or loop over its objects keys
this is too unhardcodes
it depends on how the xp types are coded
but for example
// example structures
role1 = {
id: 123124124,
xp: {
type1: 45,
type2: 23
}
}
user = {
xp: {
type1: 99,
type2: 99,
type3: 99
}
}
const roles = [role1, role2, role3, role4, ...];
for(let i = roles.length - 1; i > -1; i--) {
const rolexptypes = Object.entries(roles[i].xp);
const userxptypes = Object.entries(user.xp);
for(const xptype of rolexptypes) {
...
}
}
considering battle is using sqlite, can't u simply use ORDER BY?
no
it's stored in a .json file
not the user data but the role data
can't u use the database for that?
i could
but config file is better
because
to edit database u need to use sql
or download sqlite database viewer
but
json
no need
just open and edit
can always write a program that automates that :)
make a json file to configure the program that configures the sql :^)
no
too much work
lolz
also why assume i use sqlite
maybe i used postgres
uh
also, pretty sure you would just say "too hard" at anyone suggesting postgres
uh
no
maybe
:^)
😐
does anyone have access to the alpha and know how the premium monthly subscription thing currently works? is there a new field in the interaction object that lets you know if the server is subscribed?
yoo can i set multiple custom values for buttons?
same customid but multiple values
i dont wanna create multiple custom buttons all for the same function with different values
wdym "custom values"?
like i want multiple buttons (all have same customid) but different values for the function to run upon,is that setable or no?
well, for start you cant have multiple buttons with the same id
they are required to be unique within that message context
thats stupid though similar to slash commands, they should have different setable values
and yes, if you could repeat the same id you can use the other properties of the button to differentiate between them
"id" by definition must be unique, else it's not an id
u mean customid? if yes yeah yeah ik that
i want just 1 button (1 customid) , for multiple values
how? any docs for that
so "multiple buttons" is actually one button but many uses
there's not a doc for everything, sometimes you need to come up with your own logic
module.exports = {
name: "bet",
description: "Coinflip, Double or Nothing",
ownerOnly: false,
run: async (client, interaction) => {
const mychoice = "heads";
const amount = "0.5";
await interaction.deferReply({ ephemeral: true });
const id = interaction.user.id;
const guildid = interaction.guild.id;
const fun = await f.bet(client, id, guildid, amount, mychoice);
interaction.editReply({ embeds: [fun.embed], ephemeral: true });
},
};```
i have multiple buttons with different ideas for different choices and amounts and i wanna change that to just have 1 button with interchangable amounts and choices
the interaction event gives u the component object
100%
use the given data to come up with a way to do what u want
in the interaction can i grab the name of the button?
in the interaction you have access to all properties of the clicked button
including id, color, name, emoji, link and message
huge!! i didnt know that haha
when in doubt console.log(interaction)
i can just use the names then, split the value "h = heads" and amount before |
Thanks alot! u helped alot ❤️
👍
hey guys i am back
I have a very good question
So i am working on this bot command (telegram bot) which will call another function and will have to await a confirm from that function in order to continue with the rest.
But the thing is i wanna reuse these functions without having to make timeouts one by one, what could be a solution to that
@neon leaf hey I have a question, are you good at systems management and networking?
Specifically with nginx and such
ehh, id call it enough for what im doing so yeah, kinda
why are you using timeouts?
ah you mean to expire the confirmation?
Can you help me figure out an issue i've been facing for a while?
what is it?
Well my mailcow instance is interfearing with anything else I reverse proxy through nginx. So I get a lot of SSL errors and pages not loading because it thinks its mail.aarondye.dev rather then what I am actually pointing it to.
I also think its a combination of nginx config and my cloudflare dns config
what do your configs look like?
module.exports = {
name: "bet",
description: "Coinflip, Double or Nothing",
ownerOnly: false,
run: async (client, interaction) => {
await interaction.deferReply({ ephemeral: true });
const id = interaction.user.id;
const guildid = interaction.guild.id;
const buttonLabel = interaction.component.label;
const choice = buttonLabel.split(" | ")[1];
const amount = parseFloat(buttonLabel.split(" | ")[0]);
let choice2 = "heads";
if (choice.toLowerCase() == "t") {
choice2 = "tails";
}
const fun = await f.bet(client, id, guildid, amount, choice2);
interaction.editReply({ embeds: [fun.embed], ephemeral: true });
},
};```
Thanks 👑 Saved me a tone of time instead of doing a different button for each
const interval = setInterval(async () => {
const invoiceStatus = await checkInvoiceStatus(invoice.id);
console.log(invoiceStatus)
if (invoiceStatus.status === 'Settled') {
sorry i meant intervals so this is how a normal file i have been working on looks like, but i am trying to reuse it and get rid of most of the things
no i am trying to get it all in one function but i really don't wanna use the intervals on all the files, i kind of want it dynamic:
// Check invoice status
await checkInvoiceStatusForDC(ctx, invoice, waitingMessage);
your nginx configs
try this
https://pastes.dev/GTSa6xAyAn
Actually don't know why that nextcloud stuff is still there thought I removed it, but that isn't the issue I don't think. Cause this was a thing before I even tried using nextcloud
I think the main issue is how I was using SSL certs cause it would always be an error about an invalid CERT or smth a long those lines.
Btw u could also use control characters for visually identical labels yet different values
Is there a way to sign a wildcard cert with letsencrypt cause what I was doing before was signing individual certs for mail.aarondye.dev and aarondye.dev
There are about 100 control characters iirc
I think thats what caused issues
All which have zero width
hmm
Also in the past when trying to visit my portfolio aarondye.dev it would show an error about an invalid cert name mail.aarondye.dev
why your portfolio broki
neither do i
idk how i do it for my customers
my own portfolio is hosted on vercel

my mail server is breaking everything tho and causing conflicts
ik a crazy solution
get rid of it
wdym
U don't need to use T or E or anything
U can keep the text visually the same yet different by using control characters
Like \u200B
oh its fine, it was in the name before anyways to seprate heads and tails! thanks alot though
Oh ok
tree man @sharp geyser
ok guys
right now i have this
how can i check if every value of requirements is above the users XP in that requirement
aren't you already doing that?
you are looping over requirements which will loop over everything in rank.requirements

i think this might work
maybe
i haven't tested
hmm do u guys think it'll work
try it and see
maybe something with requirements.lengt instead of .length?
looks fine to me
because whatever you are indexing is at -1
yes since it cant index a value in an array of tuples
oh
if(!userXP[key] <= value) will also coerce userXP[key] to a boolean before comparing. Prefer using if(userXP[key] > value)
yeah
i switched it
to >=
but am i using indexOf correctly?
wait i know why
how can i get the text before number
i know Object.values will put the numbers in an array
but idk the others
key will the the text value will be the number
so you doing userXp[key] is like userXp["trainings"]
if you want just the keys you can do Object.keys(rank.requirements) and loop over that
^ shaders are fun
ok so for some reason it only checks for the first rank in the array
like if i meet the requirements for the first one it returns it
but if i meet requirements for second one still returns first one
why is this being looped through an additional time???
am confused
there will be additional console.log statements down the line
there's not
otherwise this should only log 2 times
you didn't take screenshot of entire function block
why would does that matter
additional log calls after executing getUserRank
...
there is not
i only require two things above that function
which is xp
and getUserXP
If I change one of the ranks to 3 it also changes
why is this one looping twice
yeah for some reason
the last thing in the array is being looped twice
then you better start learning about it
first, stop the program
if you hover on the line number on the left side of the editor, there is a red dot: that's a breakpoint
ok
aka. in debug mode, upon reaching a breakpoint, the program pauses execution, allow you to inspect variables' value as well as the context at the time of pausing
after which, hit f5 to run in debug mode
if you are lucky, you don't have to fill out debug configurations
again, breakpoint on two spots:
what will this achieve for me
this so we can track the loop iterations
and this so we know the function done executing
to see what's causing the duplication
yeah, but what part is causing it
I still remember the "I don't wanna use Object.entries()" mimimi
and no dupelication
i don't gain access to your codebase anyway
it's my code
that code should loop only twice due to array length
if i add continue after console.log(rank) it doesn't loop through the last one twice
but if i remove it it does
that means you are indirectly modifying xp.rank
Yikes people being worried about u could steal their non working "code" 
bro what
hence i told you to run in debug mode
i already sent the code
😐
to inspect what's changing

