#development
1 messages Ā· Page 117 of 1
an API endpoint requires me to post a file alongside the body, what would be the best way to do this? I thought converting to a base64 but js can't handle converting larger files like that (I dont think anyway)
The answer for any question is Pi
I dont think that will work for large files
alright
or this if you want to build it yourself https://github.com/kelebek333/rtl8188fu
how do i install it on my kali linux if i dont even have any internet
i would have to prob put it on a usb drive first
you will have to go for the second option
no guides?
do you have access to a virtual machine?
no
let me show u when i put the iso on the vm
oh
where do i find
do you know what is bios?
yes
so enter bios
somewhere in there you should find an option to enable VT-X
it may also be called "intel virtualization technology"
ok
oh
back
how do i install it on my flashdrive tho
eh
that doesn't work
kali linux uses linux 6.1.0
this is only for 6.0.x
looks like i would have to use vm
what's the best site to generate ads for my projects?
some are requiring me to redirect my domains which is stupid
i'm in the process of trying https://www.clickadu.com/
they seem good
and supports banner ads and video ads (what i need)
you probs have adblocker on
Oh yeah lol, good point
idk any one of the wandbox.org api thingy
couldn't find any documentation or something on google
what
try disabling this
Don't select a range
You see the small squares, there are the requests - and you've selected a range where there's none
how
Close and reopen it
alright
You selected a range manually, don't do it again
i see it

spidermonke
I use tio
tio 
can i use Joi to get rid of (test@gmail.com | test+1@gmail.com)
Is it just me or does Electron have to warm up a little whenever you start your pc
what's wrong with it lol
it does the job well
also guys where should i store the user sessions on express? memory or save them on the db
My mind went to a different kind of "joi" first
oh i am not sure
it's nsfw so dont look it up anywhere compromising if you're curious
watch
figured out so lmao
i am at work
š«
https://joi.dev š¤
WHAT
@earnest phoenix
What is this landing page lmao
anyone?
Iām less interested in this joi than I am what I originally thought of
whats your scale
lmao i don use it
kilogram
i just use mongoose cuz yeah
because if its going to be large scale then a database will kinda be necessary
well i am expecting not more than 100 users a day
js a few
mongoose has nothing to do with joi
so what u are saying is that it will eventually eat my ram
but if i use the database at this point its gonna use more processing power
should i make a session schema then
just a few
Whatever's necessary to interface with your database of choice
thats one months data
tf are u storing
šØ
The reason that happens is because compilers replace infinite loops with a function called unreachable when optimizing, here's a comparison between unoptimized and optimized run and difference
yo u got my domain in there too?
and u are doing that with mongo
probably
astrid.exposed
if you have issued an SSL certificate in the last month
at that size i would move to postgres
oh i can't query it rn
nerd
i might eventually
i just migrated VPS so need to transfer all that data
2 days worth of data
this new vps can handle shit must faster
how much are u paying for it
the old was $3.50 a month
this new one is $8 a month
but moving to $15 a month
i chose the 8gb ram 80gb storage for now
that's plenty
and then will move to 16gb ram 160gb storage
for now lmfao
80GB is nothing at the rates ur db is moving
purely because there are 4 cores now not 1
i might do
my projects are hosted on microsoft servers under the water
The what forums
they are seized
Never heard of it
um i need a lil bit of help here
im trying to make a points system .. everything is correct and the coed is indeed able to read the file.. but when i use smth like
const 1 = ganyu["member1"]
ganyu.points++
the points don't go up .. even tho i can read them by ganyu.points .. i get no errors.. why?
Variables names starting with numbers is invalid, and if that's just an example, is the issue that the value in the file not being updated or?
ik that's just an example
yeah its just not being updated
Showing your actual code is more helpful than random non-working, as variables can't be named with a number, example code 
but infact it got updated the first time i used the command then it just stopped š«”

You need to write the updated value to the file, just updating the value in your code doesn't interact with the file on it's own
im using fs to read/write in the file
Then show your actual code
client.on("messageCreate", async message => {
if (message.content.startsWith(prefix + "point")) {
const ganyu = JSON.parse(fs.readFileSync("./ganyu.json", "utf8"));
if (message.member.roles.cache.some(role => role.name === `Ganyu's Prems`)) {
const args = message.content.split(' ').slice(1).join(' ')
//declares.. like 20 of them
if(reg.some(word => args === word)) {
if (mond.some(mond => args === mond)) {
message.channel.send("__role mention.. __ **Got a point!**")
m.points++
} else if(liy.some(liy => args === liy)) {
message.channel.send("__role mention..__ **Got a point!**" + " " + liyue.points)
liyue.points++
} else if(inz.some(inz => args === inz)) {
message.channel.send("__role mention.. __ **Got a point!**")
} else if(sum.some(sum => args === sum)) {
i.points++
message.channel.send("__role mention.. __ **Got a point!**")
} else if(fot.some(fot => args === fot)) {
message.channel.send("__role mention.. __ **Got a point!**")
f.points++
} else if(nat.some(nat => args === nat)) {
message.channel.send("__role mention.. __ **Got a point!**")
n.points++
} else if(sn.some(sn => args === sn)) {
message.channel.send("role mention..**Got a point!**")
sen.points++
}
}
}
}
})

i can't send the msg with the declares ..
no nitro
but they are all just words
and for the letters before "points" theyre just like
const i = ganyu["I"]
@earnest phoenix 
is it that bad?
it's what we call "yandev code"
yandere*
yandere developer
isn't is just yandere code
Bro um what the hell
idk
nah, it's just the game's developer that has the bad habit of if-else-if-else-if-else-if-else
json storage is a bad idea, but if you really wanna go down that road, at least use a cached copy for reads
for example
you would be surprised
i know it's useless and kills the cpu but im just used to it at this point
else if
nah, cpu doesn't care much
like, it's fine to use if-else where it's due, just don't use it where avoidable
well when my server cpu dies from chrome
yeah it does
const ganyu = JSON.parse(fs.readFileSync("./ganyu.json", "utf8")); // top of the file
client.on("messageCreate", message => {
// use ganyu here
// whenever you update a value in ganyu, you need to use fs.writeFileSync("./ganyu.json", JSON.stringify(ganyu))
// to save the changes to the file, otherwise the next time you restart your bot the changes will be lost
})
it's more of a readability thing than performance (nothing is faster than if-else anyway)
šØāš³
whenever you update a value in ganyu
isn't the largest asset in that yandere game a toothbrush?
I'm YandereDev! I worked at a video game company for 3 years, then left to become a freelance programmer and pursue my dream of becoming an independent game developer.
poor companies
yandev is just an AI developer disguised as a game dev
people wouldn't make a meme out of him if he wasn't such a douchebag
sounds like someone we know
Yeah, it was like hundreds of megabytes, and had to be re-rendered almost every millisecond
???????????????
the game ran at like 15fps on best rigs
i could've sworn it had like 300 parts to the asset that made up the brush part
You haven't seen the video?
wait
1 mesh for each strand 
OH it was 5k polygons
Hello good sires, today we are taking a look at the yandere simulator coding. and the programming that yandere dev uses to really BOOST his game into fluoridation
Thank you to my friend AJ for helping out with the video:
https://www.youtube.com/channel/UCbZE8KZL1mfFHpvkUY68L-A
0:00 Intro
1:54 Coding
11:00 Framerate
14:42 Pathfinding
16:51 Ass...
21/20 video
oh, he used the hair generator for it
but 5,000 polygons tho
Sometimes I wonder how people get as far as they do
He took āfake it till you make itā to a whole new level
yep, hair generator -> high detail -> convert to mesh
plus the handle looks subdivided
and oh god that normal conflict on the head
The Dark Story of Yandere Dev
Yandere Dev, Yandere Simulator's creator is known on Reddit, Twitter, 4chan, Gaia and other platforms for his controversial behavior. There are documentaries about him and his patreon, connection with games like Watashi no Mono, Love Sick / Love Letter and other games, but very few Rise and Fall creators did a vide...
Also super interesting
chad XD
still
Unrecord is a single-player FPS that tells the story of a tactical police officer from the perspective of his body camera. As you work to solve a complex case, you'll need to use your tactical and detective skills to succeed.
Disclaimer: The gameplay footage you are about to see is from an early version of Unrecord and is not indicative of the ...
holy shit
does not update the value at all
then you are doing something wrong
show where you actually update the value
and im here to know what is it
like json? or the code?
the code
sorry not the best english speaker 
If your code is pretty long then use a bin like https://sourceb.in/
im just using it like that
const ganyu = JSON.parse(fs.readFileSync("./ganyu.json", "utf8"));
const i = ganyu["I"]
i.points++
that is the problem
numbers are considered a "primitive" value in javascript, and all primitive values are passed by "copy", which means that if ganyu["I"] is a number, then when you do const i = ganyu["I"], then i becomes a copy, not the original
can you console.log the value of ganyu["I"]?
json file
"i":{"points":0,"id":"role-"}
i have it wishisted
so its an object, not 0
Just looking insane
yeah but it does return a 0 when i try to console.log
do this ```js
const i = ganyu["I"];
console.log(i);
i.points++
console.log(i)
"i" not "I"
^
keys are case-sensitive
?
^^
const i = ganyu["I"]
yes
i is the declare
that's an l
or wait a sec
ganyu["i"] is not the same as ganyu["I"]
yeah im stubid
but not the case tho it doesn't read the rest too even tho they are correct
k one sec
to update the file you need to use fs.writeFile
it deletes everything 
dw its for other use
ok so lets say I have an array, it has 100 elements, exactly 100 every time or another multiple. lets imagine the array as a field thats 10x10, how would I always know the value of the field above my index? Its hard to explain
but nvm anyway i kinda fixed it @spark flint @quartz kindle 
you are trying to work in 2d with a 1d array
ty
it's not hard, you just need to know how to transform it
the formula is (floored) ```
x = index % width
y = index / width
so I should have an array with 10 items and each item is an array with 10 more?
ignore that
assuming python?
the formula I sent is 1d -> 2d
u just need to reverse it to get the index
index = y * width + x
alternatively simply use a 2d array
I think a 2d array would be the better choice here
hey, i have a client created in my index.js. Is it possible to actually export client using module.exports?
and then just do const client = require("file)
yes
pretty much
huhh it tells me it's undefined
what is undefined
Where do you need it?
this should be the correct approach for a 2d array and just finding the current state, correct? if so then I get it
const array = [
[true, true, true, true],
[true, false, false, true],
[true, false, true, true],
[true, true, true, true],
]
// y ^
// x >
const position = {
x: 3,
y: 1
}
const row = array.reverse()[position.y]
const place = position.x
console.log(row[place])
file2: const client = require("../index.js")
file1: module.exports = client
in file2:
console.log(client)
literally outputs undefined
why are u reversing?
because I want y to go up, not down
oh right
ur creating a new copy on each operation
found online:
There is nothing inherently wrong with this, assuming that index.js exports client.
However, it's important to note that console.log(client) will only work if client is defined in index.js and exported properly. If client is not defined or not exported, console.log(client) will output undefined.
in index.js i exported it correctly, and i imported it correctly in my second file
so it should work?
it has no idea what client is basically
but i am exporting the whole object so how tf
dont rely on gpt for everything
but it is correct
yeah but in this case i couldn't fix it on my own
BRO
./index or really ../index?
i said 'client is not defined'
Also, most events in discord.js already contain a client if i remember correctly
../
../ worked fine?
chatgpt how do I not use you trying to resolve issues
I still suggest not using it at all for literally help you can look up yourself
good
from the internet
inb4 #development enforcing disallowing ai usage on answers like stackoverflow did 
Thank you
stackoverflow completely banned chatgpt
good
Make it a bannable offense without warning
How many stuff do u guys store in the user schema usually?
agreed

asking the wrong guy
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'fetch')
i tried the exports after the login, as well as changing the path
What node version are u using
v18.15.0
Stack Overflow banned OpenAI ChatGPT answers from being posted to their site. Is this fine?
#chatgpt #softwaredevelopment #stackoverflow
ā¶ļø Visual Studio 2022 on M1 Max | First Look - https://youtu.be/Ad39jwkBLnk
ā¶ļø My Parallels 17 first impressions | Windows 11 on a Mac - https://youtu.be/Mw2of0OEJJ8
ā¶ļø M1 MacBook Air Running Visual Studio a...
I mean, I use gpt too, but to explain complex concepts like ai building for games
not for fuckin code
Can you show me what u did. please
i don't use chatgpt for answers
i literally have a message from a week ago that said "i wouldn't recommend chatGPT for advice"
or 2 weeks idk
trying to understand concepts like monte-carlo are often very technical on explications
gpt can dumbify it enough to be more understandable
when in doubt use code from stackoverflow š„²
file 2:
const client = require("./../index.js")
console.log(client)```
index.js:
```js
client.login(token);
module.exports = client;
```
SO cant help for concepts, really
people there are way too elitist to make things simple enough
and sometimes the answer simply isn't there yet (not going to ask it myself)
first question i have is. is there any errors?
I mean it comes up to the person using the AI if they want to understand what they are doing they kind of have to limit the usage
not sure u can import client like that
or should
You're sure the path is right?
Going one folder back relative to file2
only error is that it's undefined
how could i else use client in another file?
i am trying to fetch a channel by id, but yeah i will need a client for that
pass by parameter
Im not sure too, since logging in is a promise he didn't await
or static access functions
anyway, what ide are u using?
most reputable ides would tell you if the path is wrong or not
if u ctrl click the import, does it take u to the file?
Would u show us a screen of the folder structure to make u aren't wrong?
yup
sure

is this answering me?
do not roast my database.json
yes
then the path is correct
What's file 2?
vsc wouldn't find the file otherwise
file2 is the test.js
Roger
const channel = await client.channels.fetch(config["starter"].channel);```
this is where the original error came from
one moment
at least rename that database.json to database.db 
lol
hahaha well yeah i got bigger issues to solve 
The error is simple I guess
You're trying to fetch the channel before the client is logged in
As you don't await your login process
Channels doesn't exist at this point as property of client
hmmm
both what fake and i said
use await before assigning the result
to the channel i mean
wtf what
async function startBot() {
await client.login(token);
}
startBot();```
honestly this still fucks me in the ass with that error
that's the next answer i had
what the heeell
snippet from online: client object you're trying to call channels.fetch() on is properly defined and ready to use.
but probably incorrect
Make sure to fetch whatever u do after/with the REAFY event
fock
aight
thanks i will try!
hmm is it possible to do client.on(ready) in the file2?
because maybe client would still be undefined?
why does this 2d array end up full of trues OR falses? like there isnt a mix, the complete array is either true or false
type Maze = boolean[][]
const randomBool = () => Math.random() < 0.5
if (isNaN(parseInt(process.argv[2]))) throw new Error("Usage: tsx mazer.ts <size>")
const size = parseInt(process.argv[2])
const maze: Maze = Array.from({ length: size }).fill(Array.from({ length: size }).fill(randomBool())) as any
console.dir(maze, { depth: null })```
honestly let me just save the whole fucking channel object in a json file
would that fucking work?
could i then do channel.send
it's the randomBool() function
oops
it generates a number between 0 and 1 and returns 'true' if the number is less than 0.5 and false for everything else
yes
fill() isn't called once per index
it's the equivalent of (js cuz idk python) ```java
void fill(value) {
for (let i = 0; i < array.length; i++) {
array[i] = value;
}
}
Technically yes but saving the ID and fetching it of course is better
probably not
Because it Could be gone meanwhile
u could map it
tho it'd not be in-place
why is it so consistent? i Have never seen that before
well, random is random
is there a more "random" way? like this doesnt seem random at all
Because you set the "random" value to a const

That will never change
it's a function
change the array to double and assign the value to each index, just so we can see what's being returned by Math.random()
if you mean double as in the datatype that exists in java, not ts, sure
double, float, number, whatever decimal type u have
see that math.random returns
use the same data type
[
[
0.9473456942576997,
0.3122881440948011,
0.22850317090401484,
0.9333467014999379,
0.40312894603266014,
0.46176922317408287
],
[
0.9473456942576997,
0.3122881440948011,
0.22850317090401484,
0.9333467014999379,
0.40312894603266014,
0.46176922317408287
],
[
0.9473456942576997,
0.3122881440948011,
0.22850317090401484,
0.9333467014999379,
0.40312894603266014,
0.46176922317408287
],
[
0.9473456942576997,
0.3122881440948011,
0.22850317090401484,
0.9333467014999379,
0.40312894603266014,
0.46176922317408287
],
[
0.9473456942576997,
0.3122881440948011,
0.22850317090401484,
0.9333467014999379,
0.40312894603266014,
0.46176922317408287
],
[
0.9473456942576997,
0.3122881440948011,
0.22850317090401484,
0.9333467014999379,
0.40312894603266014,
0.46176922317408287
]
]```
Oh yeah forgot that garbage annotation is a thing
woah
well, there we have it
could i save the channel object in a json file and later on call it from the file to use channel.send()?
Because then i will remove the existing client exporting..
i've done that before but not with module exports
lemme go see how i used to do it
you would need fs
issue is ur using fill for the inner arrays
It's not a webhook, isn't it? So no the client has to be logged into the gateway to send messages if I'm not wrong
same issue as before
onst guild2 = client.guilds.cache.get(config["starter"].guild);
const channel3 = guild2.channels.cache.find(c => c.name === 'š£-stock-notifications');
config["starter"].obj = channel3;
fs.writeFileSync("./config.json", JSON.stringify(config), (err)=>{
if(err) console.log(err)
})``` i've used this. But yeah if i then call it with .send it wouldn't work
onst
oh right
remember: fill does not call the function every time
shit yeah i figured that already as we ofc are only saving text now
but i don't have any other solution
yeah, now it works
oof
the client still returns undefined
thanks!
You export client after awaiting login()?
async function startBot() {
await client.login(token);
}
startBot();
module.exports = client;```
yeah
I think thatās not the full code
FakE driving as always
Try exporting any const like const timStinks = 69; and import it to see if that's working

:^)
Just 4 fun
sure!
LMAO
let timStinks = require("./../index.js")
oops
this is the result
first one is timStinks
should be 69
let timStinks = 69;
module.exports = {client, timStinks};
Dont u need to import the property of the object then?

gpt tells me to use { var }
Donāt use GPT
tf should i use else
gpt has been saving my life when i was sturggling with processors
passed it with a 10/10
no flex tho
GPT is also wrong a surprising amount of time
ops.
That's what I wrote here #development message
(when exporting it as object)
As u did here #development message
We should have a pinned message regarding ChatGPT-like answers
Javascript
CMs will argue it's a good way as a newbie to get information
Just like the average things
Fair
honestly i will just create a 2nd client in my file2.js
Average development servers ban people for GPT answers 

Dude just pass client by parameter
i instead wanted to now pass a channel
module.exports = channel;
but honestly it still fucks me by returning {} which contains an object
š if you have the client passed, just get the channel from the client.
wdym with pass by parameter
creating a function for it like in java?
function doSomeShit(client) {
// use client
}
Wherever u need client simply add a param for it
Every event will have client as a param
Unless ur using client outside events
In which case you'd need to set a global constant for client and access it directly
i probably need to do this.
i will create a variable like: let var1 =... and then use a method that takes the client to set it?
Const
let channel;
async function setChannel(channel1){
channel = channel1;
}``` no way this would work
would it
Don't set channel
You only ever need client
Entities should never be stored long-term in variables as they can change any time
i see, i will try it! Thank you
me using global state in a singleton for my game:
i mean entities as in discord entities
since they change without reflecting to references
so i am trying to make a session handler,
req.session.account = result[0].id;
req.session.account comes as undefined evrywhere else, besides the function where it is inserted
so, it's either being assigned after or the requests are being duplicated
wym by duplicated requests
when i log the session elsewhere it just shows me this:
Session {
cookie: {
path: '/',
_expires: 2023-05-20T23:19:24.473Z,
originalMaxAge: 2592000000,
httpOnly: true,
secure: false
}
}
The Session could be a different reference is what I mean
@lyric mountain do you think it's worth the effort to try to parallelize my ECS
I want this to be pretty optimized but rendering still needs to maintain order which kinda sucks
use the fire-and-forget method
wdym?
idk how to explain, basically u let the processing happen as much as it wants, and the renderer simply asks for the last rendered frame
the issue is that I need certain things to be rendered before others so that I can maintain proper layers
u can still use it
how so?
it looks to me like it's just one thread running the rendering
yes, note how I'm passing a Consumer
basically the processing updates the consumer with the latest frame
as to not have two thread using the same resources at once
So are all of your entities drawing themselves to that consumer?
no, see Game
I'm updating the render task itself, this way it's impossible to have two things using the swing renderer at once
I could have 100 threads without a single CME
the synchronized is also important on access methods
you'll get the logic once you start doing it
Yeah I understand it for the most part I'm just trying to think about how to properly implement this into my engine
there are other ways to achieve it, this is just one of them
I think the issue would still persist
Because the order you render here still matters
If you render in the wrong order, something can still get drawn over something you don't want it to be
For example, I have layers implemented so that an entity on layer 1 would get overlapped by an entity on layer 2
use a Map<Integer, BufferedImage>
Since it goes in order
then render according to the key
I think my system is a little too complex for something like that
This is essentially the API that every system gets
The list being the layers, and the set being the actual entity IDs
And this is the render method of my canvas class, I just update each system with the created graphics
(As for whether or not this is efficient, I'm not sure)
just finishing a game, will come help later
hell, the majority of my CPU time for the render system isn't even spent rendering, it's spent looping over the hashset
(Granted I was looping over like 80 thousand entities, which would make some sense, but even then I don't think it would be that heavy since it's just HashSet<Integer>)
I'm not having performance issues yet (I maintain 60 fps until I hit roughly 80 thousand entities) but I'm just worrying about when I have to implement more extreme algorithms like collision
try to understand this, will come back to explain it
maybe multithreading rendering is too much
I should multithread physics if possible though
since collision is going to be expensive
K back @wheat mesa
This class was an attempt I did to have parallel threads coalescing into one result, in an ordered manner
The concept is having each thread individually complete it's own task, returning one specific result. After all threads finish executing, the "merger" function is called to compose the final value
You could use this concept to split your map into smaller pieces and having each thread process its own piece
Hmmmm
I could have a thread for each layer
That would significantly speed things up
Yes
I think I have a significant problem though, my ECS is not built for multithreading
Should not be too hard to implement it
You can also make a custom iterator
And simply extend hashmap to use your iterator
This should affect every loop (and method) seamlessly
The biggest problem being that my ECS is very intertwined in its respective classes, I donāt know if it would be easy to parallelize
There isnāt a whole ton of shared state but it mainly relies on one big array of bitsets
Could try synchronizing it
That way no two threads would be able to access it at once
Yeah
By using semaphores, I mean
I might try that in a bit when I finish eating
Iām going to have to learn a lot of multithreading to do this lol
We did multithreading in my cs class but it was very basic and pretty much only went over locks and signals, which I donāt think would be optimal for this
That would be hell to program
I am facing so many technical challenges with a minecraft server and looking at performance metrics is a lot of back and forth trying to tune config so that server tick times don't exceed 50ms
also trying my hands at making my own mods for it like one where you cannot eat pork because that's haram
java is so hard imo
lmao
Usually Minecraft servers (like hypixel) use their own hardware such as large server rooms. Thatās how their servers have good connections with large players
I met Hypixel and asked him directly how most servers work
Hardware doesn't really play into things because any hardware would struggle with more than like 150 players just running a vanilla mc server.
Some projects like paper really make a huge difference, although I'm not using paper because the bukkit api is REALLY limited
I settled on fabric which allows me to use mods like C2ME for multithreading chunk loading and detaching it from the server thread
What Minecraft version are you running on your server? That plays a major role in the performance
1.19.2
I know a lot of big servers settle on 1.12
and use mods like viaversion to allow new players
I really think I have a really optimized server rn though
even when users are elytra flying generating chunks, tick times are a stable 50ms
From what I remember giant servers like 2b2t did testing on 1.16 and 1.18 and the server ran pretty well, not sure about 1.19
1.19 is pretty good. I'd ask people to help stress test but :^)
You should try 1.19.4, there seems to be bugs that are fixed and some technical changes
I have some mods that fix the bugs dw
minecraft: the game where players have to fix the bugs themselves
kind of like Bethesda games
what no never
not like there is unofficial patches for every one of bethesda's games that supports modding
Tbh, it'll be easier if you start over
Like, the first attemp got you far enough, but implementing multithreading midway is much harder than simply starting again
This time it'll be much easier as you already got experience from it
To practice parallelism you could make a simple test project where many threads try to process something together
Yeah I donāt have the time for that right now, Iāll probably just skip over multithreading. For the thing Iām making I think it should be just fine
I mean, if it handled well up to 70k entities
you hardly will ever reach that count in a normal game
btw @wheat mesa
if u dont need random access, u can use ArrayDeque
it's much more efficient for head-tail access than Set or List
I started using an arraylist of sets, is the iterator on ArrayDeque even faster?
yep
but it's worth doing some benchmark
deques are entirely made around being iterated
and obviously cant have random access
Actually I only store like 4 sets of stuff, and I do need random access so I can delete specific objects
(In the sets)
ah
you could use a map instead of a list to store the sets
tho I don't think it should make much difference for only 4 ovjects
fair
hey, I'm learning about app connections. I'm missing something though.
how do I do the "platinum" part get added?
https://i.imgur.com/NAMnzKx.png
or even the text next to it
op, sounds like its a Boolean field.
The text though? š¤
Figured it out, its platform_username
I'd just buy an already made one 
but you gotta remember: that aint the goal 
trying to control it over bluetooth serial and shit, control the lights and the driving
current topic around vocational school
BluetoothSerial runs better than I expected, trust me
Man I wish we got to do stuff like this
Weāre using something called a pitop in our electronics class and itās fun but itās so limited
(And it forces you to use python)
We never did anything enjoyable 
It comes with a bunch of different peripherals that are easy to set up like LEDs, potentiometers, buttons, a buzzer, etc
But all of the outputs on those are basically just on or off, no in between
nothing stopping you from getting a small electronics kit and either a esp32 or arduino
I have an rpi at home but I havenāt really done anything with it
do stuff with it, its fun asf
rip it in half
Been too busy with other stuff to try much š
surprisingly hard
Basically all the free time I have rn either goes to working on my game engine that I need to finish for school or sleeping
I hope to be able to build a proper physics engine over the summer though, I found a course online for like 60 bucks that shows the āproperā process for building something like that
(And itās been suggested to me by experienced people in a graphics programming discord)
Yeah that aināt an option š
Already getting like 4 hours a night for the past few weeks
Good days more like 6
Itās not crazy expensive and I have it for life
Thereās tons of content and I donāt mind paying for it
Considering one semester of a course at the university Iām going to costs a whopping 50 times more, I think itās worth it
it's probably leaked somewhere on the internet
Plus it really does look good
The content itself looks great. I donāt mind supporting someone who isnāt charging a crazy amount for something as complex as this
6000, and believe it or not 6k is not a lot for making a ton of content
If you created educational resources for a living and people just pirated it you wouldnāt be very happy
Sure itās good, but like heās genuinely providing good content
Itās not scammy dogshit that doesnāt work
it's bound to happen
This isnāt some super ultra popular course either
me personally i would just go work for google
Itās not like the dude is a millionaire from this
sounds like i'd make more moneu
Might not be possible for him
why
Could live somewhere remote with family
Yeah me when I just go work for google
It is totally as simple as just going to work for whatever company you want
š¤Æ
well
Move and leave his family
yes
Sounds pretty heartless
The arrogance is crazy but Iām trying to be a more wholesome person so Iām just gonna leave now š
why
this is my first conversation here in 3 days
cutting it off short 
but i think this guy should work for google
imo
Hello, I have a command that generates a canvas and it takes a long time to finish. Is it possible to do multithreading to make it run faster?
(instead of making one thread at 100% make two at 50% which would make execution much faster)
canvas is not thread safe so no
u need to find out what's the bottleneck to begin with
because it's not threadsafe
i means two threads will compete against eachother
instead of helping
why is it not threadsafe
sounds like a very big limitation š«£
Because it wasnāt written with threads in mind
Multithreading is very complex and can be near impossible to implement in some cases
bruh
Also more threads does not always mean better performance in every scenario
In most scenarios itās pretty good but sometimes itās not worth the complexity in the codebase for the performance you squeeze out
are threads and cores the same thing
No
whats the difference
Cores are physical CPU processing units
Threads in a programming sense are used when you need to do things in parallel
More cores usually means more physical threads
can javascript do multithreading
But most threads are āvirtualā threads in the sense that the CPU simulates execution in parallel by swapping between tasks on the cores really really fast
Javascript has worker threads but the language itself is single threaded
being able to split the task
^
or having something running in the background without affecting the main flow
Most CPUs have more than one physical thread available for processing
but you can't
You can take advantage of that
in js
(and python, dart, etc)
but other langs can can leverage threads to a whole new level
java?
yes, for example
bruh
why would the makers of those other languages limit it so much

l javascript
because some langs are just not meant for it
js was made for sites, but people made node
because it'd not be js anymore
v8 is an absolutely MASSIVE engine
node has worker threads, which is as close as js will get to actual threads
Adding threading would take likely hundreds of thousands if not more than a million lines of complete reworks to the engine
to ELY5, they're side processes basically
I can contribute one line.
^_^
where do i find javascript source code
Iāll give you half a line take it or leave it
so
google can probably pay people to do that
you underestimate how big such a change is
ecma didn't even remove var out of fear of backwards compatibility
how would it help google anyway?
cus
plus js is supposed to be lenient and lightweight
google use javascript
adding multithreading would fail at both
they use languages with proper threading when they need to
what about this
i wanna see it
i can't find on github
it's like asking to add a screwdriver head to a hammer
you use a hammer when u need a hammer, and a screwdriver when u need a screwdriver
just add it on the bottom
very easy
except it'll be a terrible hammer and screwdriver
why
languages are tools for a certain goal
you don't need a language that does everything
so what should javascript be used for
websites
it can be used for everything, but excels at websites
so should i not use javascript to make my bot
you can, it's just not the strongest area of js
IIRC nodejs excels in a ton of requests, but very small requests. š
you wont find js sourcecode at github
it's like trying to find the pope in a rock concert
lmao
where do i find then
you don't
Javascript itself is not centralized, itās a standard. Different engines implement the standard differently
The East Coast Music Association (ECMA) is a regional collaboration of people in the music industry of Atlantic Canada. We are a registered non-profit association dedicated to the music of Atlantic Canada.
wtf
node is open source tho
There is a v8 mirror on GitHub, and node is also on GitHub
not that ecma
I've not really thought about this tbh
You wonāt be able to contribute to it unless youāre a fucking wizard tho ngl
why not
can anyone here contribute to it
Voltrex does
fr?
Yes
he said a bunch of times
Heās a maintainer of nodejs
he should give me access
And LLVM
i wanna see the source code
it's open source smh, everyone can see it
bruh
I donāt know if he has DIRECT commit access, but I know he contributes
broooooooooooooooooooooooo
I said js wasn't
Javascript isnāt open source because thatās not a thing
wym
Javascript as a language is not maintained in some central place
Thereās just people that define what javascript should be like, and different engines implement those specifications
what language is javascript coded in
in javascript
really
what
No
Most engines use C++ to implement javascript
Nodejs is a little special because they use both C++ and a custom language called torque
javascript is a language, by itself it does nothing
how do you make a language
javascript is made out of javascript, it's up to the engines to interpret it
so whats the javascript compiler coded with
^^
JavaScript is a multi-paradigm, dynamic language with types and operators, standard built-in objects, and methods. Its syntax is based on the Java and C languages ā many structures from those languages apply to JavaScript as well. JavaScript supports object-oriented programming with object prototypes and classes. It also supports functional prog...
Like I said 14 times
^^^
no, node is
No š¤¦āāļø
bruh
for example, I have my own language for command syntaxes, it's called shirosig
Javascript by itself is a specification, it is up to individual developers on how they implement that specification. If the engine doesnāt match that spec, then itās not javascript
it does not need any engine, I parse it with my own interpreter
the language itself is made out of shirosig
this doesn't make snse
which part doesnt?
that's because you're thinking js is executable
bro
how can you code something without code
you don't, languages aren't coded
with paper and pen
You canāt. Thereās a reason itās called a ātech stackā. Everything is an abstraction at some level, and it āstacksā up
Commander, we've lost a soldier
lmao
javascript, or what we think of as 'javascript'
is an idea, not code.
The "idea" is then turned into something like nodejs, which is made with code.
^^^^^^
Thats how I think of it
Best way to put it tbh
you can make a language yourself, it doesn't need to be a programming language, you don't need any code
so... javascript is nothing without node.js
you just need to say "X means Y" and ur done
Well, yes and no
no
Thereās obviously other engines besides nodejs, but if nodejs were the ONLY engine, then yes
Noā¦
let's say "abadaba" means #development
but
Javascript is IMPLEMENTED with code
if I say "go to abadaba" you know I mean "go to #development"
done, that's what a language is
that means javascript = C++
No
yes
node.js isn't a language









