#development

1 messages · Page 127 of 1

earnest phoenix
#

Primitive conversion happens in operations where the primitive value of something is needed, an example is arithmetic operations

solemn latch
#
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

earnest phoenix
solemn latch
#

Yeah, I'll look over it. thank you

earnest phoenix
#

You're welcome

solemn latch
#

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

lyric mountain
#

@wheat mesa do u know how vectors work?

wheat mesa
#

Yeah

lyric mountain
#

I have absolutely no idea how to work with them

wheat mesa
#

Well, in what sense?

lyric mountain
#

programming

#

just a sec, I'll give u the context

wheat mesa
#

Vectors as in the list, or vectors as in the math vectors

lyric mountain
#

in math context

wheat mesa
#

Yeah

lyric mountain
#

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

wheat mesa
#

Oh yeah I know how to do that

#

Should just work with ```
atan2(dy/dx)

lyric mountain
#

ok, so, got the diagram

wheat mesa
#

oh boy 3d

lyric mountain
#

this is the WorldMatrix that each block has

#

so, first of all how tf do I even read this KEKW

wheat mesa
#

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?

lyric mountain
#

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)

wheat mesa
#

ohhh

lyric mountain
#

the hardest thing is that the only thing I'm given is the WorldMatrix of both

#

there's no GetAngle or anything

wheat mesa
#

yeah this is difficult

lyric mountain
#

this is what I'm making (a sonar)

#

the whole thing does work, all I need now is the damn angle

quartz kindle
#

cool

#

asci sonar

wheat mesa
#

So you would still be using atan2(dy/dx) somewhere, but you have to find dx for this scenario

#

hmmmmm

lyric mountain
#

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

quartz kindle
#

so you want the angle between two vectors, right?

wheat mesa
#

Yeah I'm not incredibly familiar with matrices, since I haven't done those in a while, but I am decent with vectors

lyric mountain
#

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

wheat mesa
#

Cast a unit vector facing from that angle out, and one towards your reference block, then atan2(dy/dx)

#

lemme illustrate

lyric mountain
#

oh, btw, it's a space game

#

so "up" is not always towards Z

wheat mesa
#

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

lyric mountain
#

this is what I managed to get (current code) by diving through forums

wheat mesa
#

<cos(angle), sin(angle)>

lyric mountain
#

but I'm not sure GetOrientation().Down is what I think it is

#

also, GetOrientation() is a matrix too KEKW

wheat mesa
#

Ah this is C# as well, nice

lyric mountain
#

yep

wheat mesa
#

I haven't done much with 3d vectors unfortunately

#

I'll get back to you after I finish my first linear algebra class 😉

lyric mountain
#

seriously considering taking a few linear algebra courses

wheat mesa
#

I might be able to help later, I'm trying to learn some 3d opengl which is gonna require that I relearn matrices

hushed robin
#

guys

#

whats the best library for

#

like

#

2d2h (2 days, 2 hours) -> ms

spark flint
#
hushed robin
#

thx

#

😗

spark flint
#
const parse = require('parse-duration')

const length = parse(length, "ms")```
lyric mountain
spark flint
#

just to save you coming back asking for help KEKW

lyric mountain
#

the scripting api math heavy af, and is c#

hushed robin
#

i can read documentation

#

i am not a bad programmer

quartz kindle
hushed robin
#

bruh

spark flint
#

wtf luca

quartz kindle
#

wait you are not battleless anymore?

hushed robin
#

i am

quartz kindle
#

you are the battle now

#

how violent

hushed robin
#

but i changed it to battle

#

because i want @hushed robin

#

username

wheat mesa
hushed robin
#

can a mod make my username battleless

lyric mountain
spark flint
wheat mesa
#

This summer I'm trying to learn a lot about that sort of stuff

hushed robin
#

NMOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

wheat mesa
#

When do we get to change our names, is that coming soon to older accounts

lyric mountain
# wheat mesa This summer I'm trying to learn a lot about that sort of stuff

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

Price

$19.99

Recommendations

89406

▶ Play video
#

this game

quartz kindle
#

lmao

lyric mountain
#

there were psychos that made a fuckin gameboy emulator in that shit

wheat mesa
#

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 😭

lyric mountain
#

well, what about computer engineering?

hushed robin
lyric mountain
#

you dive into low level stuff all the time

wheat mesa
#

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)

quartz kindle
#

trust me im an engineer

#

oh shit what just happened here

hushed robin
#

@spark flint

#

what return if invalid

wheat mesa
#

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

lyric mountain
#

there's also embedded systems

#

code a smart fridge

drifting widget
#

How do I reload my bot and I can't find the reload button?

wheat mesa
#

lol

hushed robin
#

!reload bot

lyric mountain
hushed robin
#

uh

wheat mesa
#

I might do the traditional CS track

hushed robin
#

what happened to luca

#

@gilded plank

wheat mesa
hushed robin
#

why is it different icon now

drifting widget
quartz kindle
wheat mesa
#

looks like it's a pretty robust option for going into something I'd like to do

hushed robin
lyric mountain
drifting widget
quartz kindle
#

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

▶ Play video
lyric mountain
#

wait what tf

#

the 0.999... = 1 I already knew, but that multiplication thing is wtf

quartz kindle
#

honestly i didnt understand shit

#

lmao

#

math too hard

hushed robin
#

how do i get a member from a guild in discord.js

deft wolf
#

Depends

hushed robin
#

on what

deft wolf
#

By his id or his name?

hushed robin
deft wolf
#

guild.members.fetch("memberid") should work

hushed robin
#

this doesnt work for some reason

#

even tho i think it should

digital swan
#

try guild.members.fetch

hushed robin
#

why do i need to fetch

deft wolf
#

Maybe member is not in cache

hushed robin
#

i have guild members intent

digital swan
#

if its not cached youll need to fetch

#

fetch tries cache then fetches from api

earnest phoenix
deft wolf
#

Guilds and channels should always work with cache.get but members you need to cache yourself

earnest phoenix
hushed robin
earnest phoenix
hushed robin
#

that has nothing to do with it 🫥

earnest phoenix
#

what

#

use await if your fetching

deft wolf
#

Also fetch gonna put member into cache so next time it's not gonna fetch him from api

hushed robin
#

thanks @digital swan

#

works

digital swan
#

xoxo

hushed robin
#

i know that

#

i am not stupid

#

why does everyone think i'm stupid

deft wolf
quartz kindle
#

if everywhere you go the same thing happens over and over again, maybe you are the source :^)

still storm
#

why doesnt my custom html want to work on topgg description

lyric mountain
still storm
lyric mountain
#

like <html>, <head> and <body>?

lyric mountain
still storm
#

only <style>

lyric mountain
#

try applying the styles directly on the browser

#

see if it works as you expect it to

still storm
#

aint gonna work cause of what i have

lyric mountain
#

then that's the reason it's not working

still storm
#

i have bg animation

#

but the boxes should work

lyric mountain
#

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

still storm
#

i dont use any js

lyric mountain
#

are u importing the css?

still storm
#

just

<style>
  css stuff
</style>
html stuff
lyric mountain
#

yes, but did u write the css or are you importing from somewhere else?

still storm
#

written

#

removing bg animation also doesnt solve it

lyric mountain
#

copy the styles block, press F12 and paste in the page's head

#

don't use a separate file for that

still storm
#

wdym

#

its all one file

lyric mountain
#

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

still storm
#

i did that and it broke topgg

lyric mountain
#

then u pasted in the wrong place

still storm
#

and its not my css fault cause it works in the browser

still storm
lyric mountain
#

it's hard to give u any help without seeing the css

still storm
#

can you take a look at the code yourself

lyric mountain
#

if it's too long use hatebin

#

else just paste it here

still storm
#

okay

#

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

lyric mountain
#

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

civic scroll
#

💀

#

you abuse !important?

#

then you are in for a bad time

lyric mountain
#

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

quartz kindle
surreal sage
#
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?
quartz kindle
#

yes, it would be called twice afaik

#

finally should run in both cases

surreal sage
#

ill change some things then

#

wanted to make sure

#

js realized

#

easy ig

lyric mountain
#

or is that a typo?

quartz kindle
lyric mountain
#

return a, b would return b?

quartz kindle
#

ye

lyric mountain
#

...ok, this is the part where you try to justify their design choices

quartz kindle
#

its a pretty dumb thing but you can use it to do stuff like return dosomething(), result

lyric mountain
#

so it's just a one-liner for ```js
dosomething()
return result

quartz kindle
#

ye

#

its possibly a side effect from supporting stuff like var a = 10, b = 20

lyric mountain
#

that smells like 2 weeks of debugging to find

quartz kindle
#

expecto D

wheat mesa
#

yeah that seems like a terrible idea to use

surreal sage
#

welcome to js 🔥

quartz kindle
#

gotta love it

#

:^)

surreal sage
#

good but also shit

lyric mountain
#

are u still one-lining everything?

wheat mesa
#

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

quartz kindle
#

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

#

:^)

lyric mountain
#

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)

wheat mesa
#

👍

lyric mountain
#

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

wheat mesa
#

niceeee

lyric mountain
#

but that's for tomorrow, enough math for one day

wheat mesa
#

I'm so glad I'm done with that java certification exam

#

my god

#

the questions are so cancerous

lyric mountain
#

btw, unnamed classes in java 21

#

they already confirmed for the update

wheat mesa
#

Some of the questions aren't even hard, you just wouldn't know them unless you've done specifically that thing before

#

Thankfully I knew this one, but only because I've gone through hell with these shitty syntax rules for enums

#

another one

surreal sage
wheat mesa
#

lol

surreal sage
#

i hate this.

wheat mesa
#

so specific

lyric mountain
#

only B is illegal no?

surreal sage
#

beautifier

wheat mesa
#

no default ctor on D

lyric mountain
#

ah yeah

#

missed that

wheat mesa
#

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

lyric mountain
#

honestly, those exams are meaningless in measuring knowledge

wheat mesa
#

100% true

#

Some of the brightest kids in my class took it and failed

lyric mountain
#

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

wheat mesa
#

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

lyric mountain
#

those exams usually have a ton of false-positives

wheat mesa
#

Dude some of the questions were literally wrong

surreal sage
#

so common

wheat mesa
#

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

lyric mountain
#

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

wheat mesa
#

Asked something about What outputs "hello: world!" but there was absolutely no colon anywhere

#

I passed with a 75%

#

Super happy about that

lyric mountain
#

lul

wheat mesa
#

Most of the stuff I got wrong was on exceptions, I always forget the hierarchy and shit

#

But it doesn't matter

lyric mountain
#

a proper test would be to ask yall to do X and see which ones did it better (or did at all)

wheat mesa
#

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

earnest phoenix
quartz kindle
#

shaderCode = raw.c_str();

earnest phoenix
#

Oh nevermind it seems like I read it wrong, they're reassigning the pointer address, not the value

quartz kindle
#

im as confused as waffle here

earnest phoenix
#

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 ^

quartz kindle
#

ah so the block scope of the try catch ends the life cycle of the variable?

earnest phoenix
#

Correct

quartz kindle
#

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

earnest phoenix
#

Yep

quartz kindle
#

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

earnest phoenix
#

That's not possible without a copy

quartz kindle
#

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

earnest phoenix
#

Though you can also move the value (std::move) to prevent a copy

quartz kindle
#

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

earnest phoenix
#

It's the comma operator (,) which allows for operations to be done in a compact sequence

quartz kindle
#

:^)

earnest phoenix
#

Most readable 🔥💯

quartz kindle
#

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;
earnest phoenix
#

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

cinder patio
#
for (let i=1; i < 4; i++) {
  globalThis[String.fromCharCode(96 + i)] = i;
}

imo the most readable method

earnest phoenix
lyric mountain
earnest phoenix
#

Many programming languages also allow that

#

It's basically an expression, evaluated then passed to return

lyric mountain
#

it's the type of thing you'd spend way too long finding the issue

#

akin to the braceless if/while/for clause

earnest phoenix
#

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

quartz kindle
#

jesus christ

#

lmao

winged linden
#

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?
quartz kindle
#

lmao, djs giving an ssl error, thats a new one

quartz kindle
winged linden
#

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

winged linden
#

anyone uses digital ocean in here?

deft wolf
#

Never to be honest

quartz kindle
earnest phoenix
#

uhh

#

is there any header files for Threading and Multi threading

#

in windows

hushed robin
winged linden
winged linden
#

old instances just stop alone after a while

lyric mountain
#

does it use linux cli?

#

u could try to shutdown the instance

#

as if you were shutting down a pc

quartz kindle
#

are you using an actual vps? or some kind of app container?

earnest phoenix
quartz kindle
#

whose D

earnest phoenix
#

Deez Nuts

quartz kindle
#

your D then

earnest phoenix
winged linden
#

app container

quartz kindle
#

ah well... i have no idea about app containers, never used them

winged linden
lyric mountain
#

@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

hushed robin
#

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

#

😮‍💨

quartz kindle
winged linden
lyric mountain
#

so navigating with a huge-ass ship only being able to see what's in front of you is terrible

quartz kindle
#

its an existing game?

lyric mountain
#

yep, space engineers

quartz kindle
#

ah

#

cool

lyric mountain
#

usually you'd navigate through cameras, but constantly switching between them gives motion sickness

#

you sadly cant link a camera to a screen

frosty gale
#

did chrome disable the ability to view individual cookies and values?

quartz kindle
#

doesnt sound very enginner-like

#

:^)

frosty gale
#

attempt to dumb it down and hide cookies id imagine

spark flint
#

its annoying

#

i use a plugin for it now

quartz kindle
#

im still on 113

lyric mountain
frosty gale
#

i think its an update to chromium not just chrome

frosty gale
#

im seeing it on other chromium browers too

#

dont see how chromium maintainers even allowed this 💀

lyric mountain
#

edge's still fine

frosty gale
#

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

lyric mountain
#

it's an edge case /s

frosty gale
#

finally microsoft has an advantage they can force down you to make you use edge instead of chrome

quartz kindle
#

lmao

earnest phoenix
#

You can still check the data by going to the developer console and checking the "Applications" tab

#

There's a "Cookies" section

frosty gale
#

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#

frosty gale
#

move developer stuffs to the developer console

earnest phoenix
#

Correct

frosty gale
#

most people dont really need to see content of cookies

quartz kindle
#

im using ungoogled chromium, still no update for me

frosty gale
#

i just thought they got rid of it completely

quartz kindle
lyric mountain
#

how many OS projects are u into?

quartz kindle
#

i mean

#

once you are inside google, you are inside everything

frosty gale
#

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

quartz kindle
#

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

frosty gale
#

the company is the pirate ship and were the "pirates"

#

i find it cringe but i dont say anything 😂

quartz kindle
#

lmao

#

thats much better than the typical "high productivity culture"

earnest phoenix
# lyric mountain how many OS projects are u into?

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)
wheat mesa
#

Not to brag but I maintain my sanity 🥱

#

(I don’t)

quartz kindle
#

like are you some kind of top 10 graduate from some ultra hard indian university?

frosty gale
#

i could not be asked lmao just being part of one big project is too much for me

quartz kindle
#

same lol, i dont even work on my own projects

quartz kindle
#

he has an IQ of 200

hushed robin
#

really?

wheat mesa
#

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

earnest phoenix
quartz kindle
#

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

frosty gale
#

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

wheat mesa
#

I’m also 0% confident that the code I write is up to standard with what people would accept in a PR

quartz kindle
earnest phoenix
#

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

quartz kindle
#

kthxbye

earnest phoenix
frosty gale
#

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

earnest phoenix
#

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

quartz kindle
earnest phoenix
#

Nothing less, nothing more

quartz kindle
#

at some point i was the only maintainer of a lib, so i quit it and made my own version of it

hushed robin
#

why not just ask them to make you owner

quartz kindle
#

god bless

hushed robin
#

why make new one

quartz kindle
#

basically rewrote everything from scratch

hushed robin
#

what was it

quartz kindle
#

sweph

hushed robin
#

whats that

#

?

quartz kindle
#

bindings for the swiss ephemeris C library

#

for nodejs

wheat mesa
#

I’ve never made a single PR in roughly 3 years of programming

radiant kraken
#

do you have any knowledge regarding unicode

wheat mesa
#

(Granted I’m not super advanced for the amount of time I’ve spent programming)

hushed robin
#

your very advanced waffle

quartz kindle
radiant kraken
#

simple?

hushed robin
wheat mesa
#

I could probably make PRs to Java codebases except for the fact that they all use 35 giant patterns lol

quartz kindle
#

i mean, its pretty easy to encode/decode utf for example

#

unless you mean something else

earnest phoenix
quartz kindle
#

hahahah

hushed robin
#

how does google know your identity

quartz kindle
#

damn even chatgpt knows you

earnest phoenix
wheat mesa
#

Google knows everything, but this one is probably because voltrex has an online presence

hushed robin
#

tbh why make open sourde when you can make closed source and make people pay

quartz kindle
wheat mesa
#

(Considering the amount of things he works on)

hushed robin
#

you could make a lot of money doing that with nodejs

wheat mesa
wheat mesa
#

Not everyone does everything for money you know

radiant kraken
#

that's what you get in the unicode consortium

earnest phoenix
hushed robin
#

only make it like $5

#

to support the deca

quartz kindle
wheat mesa
#

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

quartz kindle
#

preferably one without too much work :^)

hushed robin
#

but its already big

wheat mesa
#

Because it was open source

hushed robin
#

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

quartz kindle
hushed robin
#

irs a win lose situation

wheat mesa
#

The greedy capitalist mindset

earnest phoenix
wheat mesa
#

Gotta love it

hushed robin
#

peopoe will just pay and move on

wheat mesa
#

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

quartz kindle
#

nope

hushed robin
#

only maybe like half will switch

wheat mesa
#

💀 they really thought I was qualified

lyric mountain
hushed robin
#

switching if you have a big project would be difficult

#

so they just pay

quartz kindle
#

they support like 90% of the node api

wheat mesa
#

Or deno

lyric mountain
hushed robin
#

idk what a bun is

quartz kindle
#

another js runtime

hushed robin
wheat mesa
#

There’s tons of alternatives

hushed robin
#

they pay $10 and move on

lyric mountain
wheat mesa
#

Nobody is going to pay for nodejs except for maybe a few large companies that rely on it

hushed robin
#

dont call me buddy

#

buddy

quartz kindle
#

dont call me buddy, bro

radiant kraken
hushed robin
#

theyll pay and get lifetime access

#

to amazing tools

#

n things

#

nodejs does

quartz kindle
#

if nodejs becomes a paid project, nodejs will literally die

wheat mesa
# hushed robin $10 isnt mucu

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

hushed robin
#

tbh they should make me ceo of nodejs

lyric mountain
#

ya really ignoring what I'm saying about reddit

radiant kraken
earnest phoenix
hushed robin
#

i kinda just didnt read it cus

#

u wrote too nuch

earnest phoenix
lyric mountain
# hushed robin resend it

reddit api will be paid, many big projects (including apps and 3rd party clients) are simply gonna die because nobody will pay

hushed robin
wheat mesa
#

Based

lyric mountain
#

those projects do raise income for the devs, yet they're giving up

quartz kindle
#

voltred be looking like that dude who become a doctor, enginner and astronaut, all before he was 30

hushed robin
#

Ecen if people stop using

wheat mesa
#

Yeah, you’re like what, 19 @earnest phoenix?

earnest phoenix
#

Correct

lyric mountain
#

so, if nodejs was paid, nobody would pay

hushed robin
#

thats their issue

wheat mesa
#

Bro he’s a little more than a year older than me with 35 years more experience than me

hushed robin
#

reddit isn’t responsible for their financial sotuationt

radiant kraken
wheat mesa
#

Actual gigabrain

earnest phoenix
#

I'm just that good 😎

frosty gale
#

i know a guy from work that started coding at age 7 he can scan through lines of code like a machine now 💀

wheat mesa
#

I started when I was 15

earnest phoenix
# radiant kraken or something like that

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

lyric mountain
radiant kraken
#

like what

hushed robin
#

nodejs charge money

earnest phoenix
hushed robin
#

oirs if people leace

#

ut also make money

lyric mountain
#

yes, but paid node = no users

radiant kraken
#

major/important decisions like what

hushed robin
#

yea users

frosty gale
hushed robin
#

thre ones who paid

wheat mesa
#

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

hushed robin
#

or theyre dumb

#

they dont have the ceo mindset

wheat mesa
#

They’re dumb but extremely rich from the things they do

earnest phoenix
wheat mesa
#

Their CEO is one of the richest people on earth

hushed robin
#

yes

lyric mountain
#

I got a good example for you battle, one I'm currently using daily

hushed robin
#

i will be richer than him

lyric mountain
#

ever heard of delphi?

hushed robin
#

no

wheat mesa
#

(Actually no maybe he’s not the CEO, the owner is)

frosty gale
lyric mountain
hushed robin
#

w languagr

lyric mountain
#

it's a very popular enterprise language

#

yet u didn't hear about

hushed robin
#

yeah so they makenlots of money?

#

which is good

#

your procing my point

#

🫥

lyric mountain
#

not exactly, as it's a dying language

hushed robin
#

😮‍💨

lyric mountain
#

they milked it so much that they killed the whole thing

hushed robin
#

i would do it better

frosty gale
#

like java but they kinda revived it by removing the boilerplate for a simple hello world (kinda)

lyric mountain
#

the only users left are those stuck to it from legacy codebases

hushed robin
#

nodejs is too big for large projects to switch

#

they rither pay or make all their code

#

💀

lyric mountain
#

new users are nonexistent as the license price is extremely high (cuz they need to compensate for the lost quantity)

hushed robin
#

real ceo mindset

lyric mountain
#

so it's literally a death spiral

frosty gale
#

if you think about it all programming languages have vendor lock in because different syntaxes

hushed robin
#

ok guys i hace a wuestion

lyric mountain
#

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

hushed robin
#

axtually i gtg

frosty gale
#

matlab

hushed robin
#

will ask soon

lyric mountain
#

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

quartz kindle
#

:^)

frosty gale
#

how did that even happen

quartz kindle
#

they fucked up big time

#

thats what happened

frosty gale
#

i never knew you could fuck up logging to the console

quartz kindle
#

the java special

hushed robin
#

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

quartz kindle
#

like what, the highest of the 4 xp is the one that counts to unlock the role?

hushed robin
#

no

#

each role u need a specific amount of each different xp

quartz kindle
#

something like rpg stats and items? like to equip a sword you need 50 str and 25 dex

hushed robin
#

uh

#

kinda ig

frosty gale
#

close enough

hushed robin
#

but its differiwnt cus theres lots of roles

quartz kindle
#

so just check each of them

hushed robin
#

but

#

its hard

quartz kindle
#

everything is hard for you

#

lmao

hushed robin
#

i tried wnd i don’t get it

#

its complex thing

quartz kindle
#

what did you try?

#

what is so complicated about it?

hushed robin
hushed robin
#

is there a package thay can do it for me

quartz kindle
#

highest one what?

#

of the 4 xp?

hushed robin
#

yes

quartz kindle
#

or of the roles possible?

hushed robin
#

each role has progressively higher xp requirement so like

quartz kindle
#

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?

hushed robin
#

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

quartz kindle
#

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

hushed robin
#

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

quartz kindle
#
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]
  }
}
hushed robin
#

uh

#

is it reallt that simple

quartz kindle
#

as long as the roles are ordered correctly, yes its that simple

hushed robin
#

wym by ordered correctly

#

like from low to high?

quartz kindle
#

yes

hushed robin
#

ok

#

thx

#

i will see if i can get it working when i tet home

#

also

#

nvm

hushed robin
#

for the if part

#

😮‍💨

quartz kindle
#

like if you want to add more xp types?

hushed robin
#

there can be a dynamic amount too

#

like you can only require 1 xp type

quartz kindle
#

you can organize xp types in an array for example

hushed robin
#

and you can add more xp tupes in the config file

quartz kindle
#

or loop over its objects keys

hushed robin
#

this is too unhardcodes

quartz kindle
#

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) {
    ...
  }
}
lyric mountain
#

considering battle is using sqlite, can't u simply use ORDER BY?

hushed robin
#

it's stored in a .json file

#

not the user data but the role data

lyric mountain
#

can't u use the database for that?

hushed robin
#

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

frosty gale
#

can always write a program that automates that :)

quartz kindle
#

make a json file to configure the program that configures the sql :^)

hushed robin
#

too much work

#

lolz

#

also why assume i use sqlite

#

maybe i used postgres

rustic nova
hushed robin
quartz kindle
#

also, pretty sure you would just say "too hard" at anyone suggesting postgres

hushed robin
#

previous project

#

😐

rustic nova
#

ok

quartz kindle
#

:^)

hushed robin
#

i will try later

#

but now no

hushed robin
proven lantern
#

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?

winged linden
#

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

winged linden
lyric mountain
#

well, for start you cant have multiple buttons with the same id

#

they are required to be unique within that message context

winged linden
#

thats stupid though similar to slash commands, they should have different setable values

lyric mountain
#

and yes, if you could repeat the same id you can use the other properties of the button to differentiate between them

lyric mountain
winged linden
#

i want just 1 button (1 customid) , for multiple values

lyric mountain
lyric mountain
winged linden
#

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
lyric mountain
#

the interaction event gives u the component object

lyric mountain
winged linden
lyric mountain
#

in the interaction you have access to all properties of the clicked button

#

including id, color, name, emoji, link and message

winged linden
lyric mountain
#

when in doubt console.log(interaction)

winged linden
#

i can just use the names then, split the value "h = heads" and amount before |

lyric mountain
#

it'll show u everything it has

#

yes

winged linden
#

Thanks alot! u helped alot ❤️

lyric mountain
#

👍

slender wagon
#

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

sharp geyser
#

@neon leaf hey I have a question, are you good at systems management and networking?

#

Specifically with nginx and such

neon leaf
#

ehh, id call it enough for what im doing so yeah, kinda

quartz kindle
#

ah you mean to expire the confirmation?

sharp geyser
neon leaf
#

what is it?

sharp geyser
#

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

neon leaf
#

what do your configs look like?

winged linden
# lyric mountain 👍

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
slender wagon
# quartz kindle why are you using timeouts?
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);
sharp geyser
neon leaf
#

your nginx configs

sharp geyser
#

here is the correct mailcow conf

neon leaf
sharp geyser
#

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.

lyric mountain
sharp geyser
#

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

lyric mountain
#

There are about 100 control characters iirc

sharp geyser
#

I think thats what caused issues

lyric mountain
#

All which have zero width

neon leaf
#

hmm

sharp geyser
#

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

sharp geyser
#

Cause I fucking know nothing about systems administration or networking

slender wagon
#

idk how i do it for my customers

#

my own portfolio is hosted on vercel

sharp geyser
#

Mine is hosted on my vps

#

Along with my mail server

slender wagon
#

yes i saw from the nginx config

#

I have never setup a mail server

sharp geyser
#

my mail server is breaking everything tho and causing conflicts

slender wagon
#

get rid of it

sharp geyser
#

Nah

#

Its something I don't need but definitely want

lyric mountain
#

U can keep the text visually the same yet different by using control characters

#

Like \u200B

winged linden
lyric mountain
#

Oh ok

hushed robin
#

tree man @sharp geyser

hushed robin
#

ok guys

#

right now i have this

#

how can i check if every value of requirements is above the users XP in that requirement

sharp geyser
#

aren't you already doing that?

hushed robin
#

no

#

that will only check for the first one

#

there's mutiple

sharp geyser
#

you are looping over requirements which will loop over everything in rank.requirements

hushed robin
#

yes but it will return the rank on the first one

#

it won't check them all

sharp geyser
hushed robin
#

i think this might work

#

maybe

#

i haven't tested

#

hmm do u guys think it'll work

harsh nova
#

try it and see

hushed robin
#

your right

#

😆

#

ok

#

it doesn't work

#

it's always returning false

harsh nova
#

maybe something with requirements.lengt instead of .length?

hushed robin
#

yeah i noticed that lol

#

not the issue but lemme try to fix it

wheat mesa
#

stop using semicolons after every closing bracket

#

it does nothing and is distracting

hushed robin
#

why

#

i like to

sharp geyser
#

looks fine to me

hushed robin
#

i think i found the issue

#

indexOf ain't working

#

it's returning -1

sharp geyser
#

because whatever you are indexing is at -1

hushed robin
#

no

#

impossible

harsh nova
#

yes since it cant index a value in an array of tuples

hushed robin
#

oh

wheat mesa
hushed robin
#

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

sharp geyser
#

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

hushed robin
#

omg

#

I DID IT

#

YAY

#

nvm

sharp geyser
wheat mesa
#

^ shaders are fun

hushed robin
#

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

civic scroll
hushed robin
#

there's not

civic scroll
#

otherwise this should only log 2 times

hushed robin
#

i can assure you i'm not blind

#

1 of 2

#

u can see the 2 there

civic scroll
#

you didn't take screenshot of entire function block

hushed robin
#

why would does that matter

civic scroll
#

plus there could be additional log calls outside of the call

hushed robin
civic scroll
#

additional log calls after executing getUserRank

hushed robin
#

...

#

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

civic scroll
#

insert breakpoint on this statement and run in debug mode

#

and another one here

hushed robin
#

idk what debug mode is

#

or what a breakpoint is

civic scroll
#

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

hushed robin
#

ok

civic scroll
#

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

hushed robin
#

i determined my code is doing it

#

but idk what is doing it tbh

civic scroll
#

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:

hushed robin
#

what will this achieve for me

civic scroll
#

this so we can track the loop iterations

#

and this so we know the function done executing

civic scroll
hushed robin
#

my code is

#

bc i add continue after console.log(rank)

civic scroll
#

yeah, but what part is causing it

boreal iron
# hushed robin

I still remember the "I don't wanna use Object.entries()" mimimi

hushed robin
#

and no dupelication

hushed robin
#

my code is perfect

civic scroll
#

then why would you complain about its buggy behaviour

hushed robin
#

because

#

nothing could case it to loop twice

#

it makes no sense

civic scroll
#

a console.log outside of function call

#

that's my suspection

hushed robin
#

broo

#

it's not

civic scroll
#

i don't gain access to your codebase anyway

hushed robin
#

it's my code

civic scroll
#

that code should loop only twice due to array length

hushed robin
#

if i add continue after console.log(rank) it doesn't loop through the last one twice

#

but if i remove it it does

civic scroll
#

that means you are indirectly modifying xp.rank

boreal iron
hushed robin
#

bro what

civic scroll
#

hence i told you to run in debug mode

civic scroll
#

to inspect what's changing