#development
1 messages · Page 201 of 1
Your gambling is not based on real probability
Ask waffle to give you the math on it
He loves statistics

Right?
I mean this is the one part of stats that isn't absolute dogshit
True meaning: he loves the casino
It's fake currency so chances are it's probably actually not favored poorly
If it was real currency the expected value of your winnings is always in the negative
It chooses 2 random numbers
From 1-10
If you get the bad number
Because if casinos have a game that is constantly in their favor, they may lose in the short term, but will always win in the long term
Exactly why I'm not cheating my players out yet, because then I can sort out the real gambling... 😈
There are some games where you can win based on some skill like poker or blackjack but at the end of the day there is always a predetermined probability at each game state
So you randomly choose 2 (unique?) numbers between 1-10 and your player guesses a number and hopes that it's not one of those two
What kind of return is that?
Are you just 2x'ing? If so, people will get bored quickly because they will make way more money than they lose
To keep a game fun, you can't just win with no effort
You have to do the math here to keep the stakes high
Randomly generated in between 1-10.
They aren't ready for what's next.
🤫
All I'm saying is that your game it's cool and all but if you intend it to have replayable value, giving 2x for a 4/5 chance of winning (assuming the losing numbers are unique), people are going to abuse it to make a lot of money
A "fair" game would be to pick 5 unique random losing numbers between 1-10 and give a 2x return
@sullen crater getting shown up
hey guys
i am looking into creating my own algorithm for compression for some reason
just doing some side tasks in life ig 
so this was my idea:
what did i do
You've attempted to share potentially unsafe content, which has therefore been blocked.
well no shit i can read
but why
how tf is this not safe
is it cuz of the bitstring?
yes youve effectively recreated run length encoding which looks for duplicates in data and prefixes it with a number to repeat with
but your idea of converting it to bits wont actually save any space
you should interpret it on a byte level
give me your money
Hello money, I'm roosa
owh damn i thought i was being smart for a moment 😭
really? How would that work though?
if youre storing each part of the file as bits you still have to likely store the data in bytes so youve effectively made a single bit use 8x the space
it gets a little tricky doing it in bytes since you have to distinguish the data in the file from actual data of the file and your compression algorithms repeat characters
i can use byte reconstruction, where i paste the bits together to fill the data?
I've done that in the past when working with mutexes for my OS course
sure but you wont save any space doing that
you cant really deal with bits in a byte world
memory addresses and storage minimum unit is usually a single byte so 8 bits
you can of course in theory compress and reduce things on a bit level but in practice youll end up using more storage
and that kinda defeats the point of a compression algorithm
you are right.
Damn
but on byte level, how can i ever reduce it?
like suppose i have 11111110 00000001
then i can read the bytes consecutively and increase the prefix number till i encounter a character that is not the same as the previous for example?
owh wait yeah that should work
what run length encoding does is literally do what you did with the bits
looks for the same consecutive bytes and puts a prefix with the number of them in a row to expand them
but you cant do it for all bytes in the file because youll likely end up using more space also
youd likely have to have some sort of header at the start of the data/file which indicates the locations of prefixes and data that has to be expanded
you cant really add a magic number at the start of the bytes to be expanded because what if the data happens to be the magic number
unless youre certain that number will never appear in the data which in that case can save a bit of space
hmm i see, i will have to investigate more about this. But pretty sure i want to implement it for fun starting today.
thanks for all the help Chloe! I will @ you if i run into problems.
sure, i'd also recommend experimenting with different variations and ways of doing it
maybe even instead of every consecutive byte its every byte after it thats a duplicate
it contains big numbers
don't remember if it was you before, but what you're doing is basically reinventing deflate compress algorithm
it's fairly good for text, but really bad for anything else since long chains of repeated bits become very rare
imagine finding a cve worthy bug/exploit and waiting for new year's eve to end so you can get the first assigned id 🗿
someone at 31/12 23:59 - finds that bug/exploit and reports it
Depends on the use case I'd say. Syncing the threads is a bit of overhead. Could make the operation async by only having an owner thread update entries and you just send an update op from one thread to another
Unless the results need to be immediate
Multithreading is painful, especially in Java. You can overcomplicate it pretty easily, it really depends on your use case
I would probably go with this as well unless you can’t for whatever reason
Probably don’t need a mutex, just use a standard lock
@quartz kindle
lmao
new ConcurrentHashMap<>()
same performance, slightly higher memory usage
that loses pretty much all of hashmap's upsides
but well, you could extend concurrenthashmap and use equals instead of hash for comparison
identity hashmap uses equals instead of hash for finding keys
so you could for example use a completely unrelated class to retrieve a value as long as both are equal
it probably stores entries under a hashtable
but for obvious reasons it isn't O(1) for retrieval
synchronizing the map would be the same as not using concurrency at all, since you force all threads to wait their turn to use the map
volatile doesn't work for this
the issue is that the map cannot manipulate the hash table when 2 or more threads are trying to add stuff at the same time
do note tho, you will lose a lot of performance by not using hashes for retrieval
it'll go from O(1) to O(n)
why do you even need an identity map btw?
ok but this doesn't need an identity map still
any specific reason to use equals instead of hashcode?
why not?
like, the only case where an identity map would be needed would be smth like this: ```java
class A {
int someKey = 1;
@Override
public boolean equals(Object other) {
return someKey == ((B) other).someKey;
}
}
class B {
int someKey = 1;
@Override
public boolean equals(Object other) {
return someKey == ((A) other).someKey;
}
}
var a = new A();
var b = new B();
var map = new HashMap<A, Object>();
map.put(a, 123);
System.out.println(map.get(b)); // wont find, as classes are different
simplified it for simplicity's sake
with a regular hashmap this would never work because both classes aren't the same type
they use hashcodes
all classes have a public int hashcode() implementation, hashmaps store entries by class and then by hashcode (which is why the above example fails)
it wont collide unless you have an ungodly amount of entries
and at that point you need to ponder whether there isn't a better way of doing whatever you're doing
actually, I need to correct myself, I pretty much confused IdentityHashMap with another different Apache implementation
dont remember the name of it, but apache's impl is the one that solely relies on equals, java's std identityhashmap is a different thing entirely
ihm (identityhashmap) ignores equals/hashcode entirely
it uses the pure version of them, which compares references themselves, not their values, and as such is faster
sync map is better if you can afford putting the threads in a queue for writing to it
idk, try to measure loading time, maybe the different is small enough
hey guys, so to authorize actions users will do on my site, i am basically saving the user_id on the client side together with email hash, password hash and username. Is this save? This is needed for my users to make actual actions to the database
i save it using localStorage btw
if youre saying that youre using that combination to authenticate users i'd say its okay but it would be considered unsafe
usually the industry practice is to have some kind of session token that the server ties to the user
then the user sends that session token to authenticate the user
if you want to store the users data on the client and have the server be able to see them you should use JWT's with a hmac
i see
To be fair, users can only get to specific actions anyways if they are logged in ya know using the hash, so i think i should be good.
no hashes should ever be stored client side
its always a session token or a jwt token
so how can i do that then? Like, how can i keep track to what sessionId a user ID belongs?
Suppose a user is in the home page of the website, how can my site recognize this user using it's sessionid? keeping track of it in a database?
when a user logs in, a session token is created and stored in your database and also in the client's cookies
in the database, the session token has an expiration date, and the user id
as well as other info like ip address and what not
ahh i see. I already indeed created such a timestamp after which a user MUST login again to prevent some type of attacks. But indeed, after a login and or register i can create a sessionToken that links to a user ID in the database.
so you can threaten to dos the users if youre unhappy
Instead of implementing a timer based approach i rather want to check the sessionid AND THE TIME IT after which theymust login again each action a user makes.
exactly
i am just repeating what you told me

no i know
@_@
but checking the timestamp after each action
I also never recommend such thing

I told you to do exactly what they said
Store a session token in the server and have the client compare
Or use jwt
That’s the only real way to do it now
JWT is meh though as they don’t rely on a server for confirmation and can’t be revoked/invalidated unless they naturally expire
I’d never recommend them for login persistence unless it absolutely needs to be stateless
but hold on
can't i just save a user id that my system automatically assigns a user upon registration?
Like fuck it, a user id is not even that important right?
That way i can query my database based on that user id which is also the primary key for all tables.
or would that still be stupid and dumb and stupid?
wdym
okay look
That’s how sessions work
hollup i will show you sum
You generate a session token, save it to the database alongside a user id (or anything unique to the user) and save that token to the client side to be sent over any subsequent requests
omg aaron i love you so fuckig fucking much
what i have rn is:
user registers and queries database -> database will now register user, it will save a specific random 50-char length code as sessionID. This will be linked to a user id. Now i return that sessionid back. A user can now using the localstorage query shit using the sessionID, by checkin the database session table and retrieving the actual user id. Using that we can execute what the user wanted to do.
++ it expires after 24h after which you must login again
That’s a typical way to do it yes
All it is just comparing session ids
frontend aint got shit on me lets go
Also
Just to note
You are checking to see if the session is expired right?
If so don’t delete sessions when they expire
Just mark a field as it being expired
gj
yeah upon each action a user takes
i am not deleting the entry, only updating it.
That way i can keep track to which user a session belongs, even when it renews.
That’s smart but also keep note of who uses the token after it’s been expired/revoked
A lot of people will bot requests using stolen tokens
As haku pointed out
keep a separate table for session tokens, dont save them together with the user data
since one user can have multiple tokens (one for each device/browser)
Also is it not smart to store the ip of the person logging in to compare with future requests?
I do
its largely futile nowadays because most people have dynamic ips which change constantly
but you can still do things like country detection yeah
if you primarily log in from the usa and suddenly log in from spain there might be a problem
why would there be a problem? people are rich, they travel around the world everyday
:^)
Rather invalidate their credentials or send a notification than to risk that
Especially if you’re a high valued company
💀
nah f u i dont want to have to relog every time i get out of a plane :^)
thats why these heuristics rarely work on their own but annoy the actual user
the attacker isnt really bothered by it all that much
minor obstacle if you can get that far
Sucks to suck
I don’t travel around the world every day

Logging every word Tim says since hes an oracle
make a tim markov chain
in case he gets banned
then we can have him forever
scary thing is nowadays if you have the hardware you can make a very convincing LLM of someone
lmao
it will talk exactly like them
even more scary is using AI to impersonate/fake/forge accusations
even though for some things you dont even need to go that far
laws will probably get more strict on accepting images or videos as evidence to compensate
right now theyre in a state where they can be detected if you look close enough but thats fading very quickly
its a double edged sword, will also be harder for actual evidence to be accepted
governments will probably instead try to limit LLMs and stop businesses from allowing people to do their own stuff with them but that wont work at all
back then if you messed with the wrong people you'd get beaten up, today you get falsely accused of random shit and canceled to oblivion
all you need is a bunch of gullible people to parrot your accusations away and suddenly millions of people hate you and you have no idea why
lmao
Oh boy sounds like the job for the internet alright
They’ll believe just about anything if it has drama behind it
They’ll pick a side and root for it without even knowing what’s going on
ye
and once the damage is done, they pretend they didnt do anything wrong
people are also getting less intelligent statistically speaking as time goes on
so hardly going to be a next einstein if you think hes smart
this sets up society becoming a totalitarian state
soon what china is doing will become normal
considering everything thats happening combined
What? That’s crazy bro never heard about it
america?
This reminds me of a movie I saw a trailer for about this guy going to prison for being the smartest one on earth
It’s some dumb movie
But it speaks facts that’s how I feel like things are going 😭
wouldnt be surprised bc the smartest thing isnt necessarily the most popular thing
if people disagree youre kind of screwed
That’s what I’m saying
a lot of people nowadays blindly follow social conventions and dont even step up and ask hey maybe theres more to this or xyz
That’s why I disagree with everything the internet has become for the most part
einsteins initial observations and theories were heavily discredited by scientists and people at the time for example
apply that logic to anything
Did you see the video of the guy turning plastic into fuel from a handmade machine
Bro barely looks 25
i have not
It’s pretty cool
I cherish your support! Patreon: https://www.patreon.com/naturejabDonate:https://www.paypal.com/donate/?hosted_button_id=K7BNSPZZWMRYEHere is the link to the...
being smart is a crime because its offensive to dumb people
its already happening
Yea
nice one google
should inserting a document with mongoose take this long?
(see difference between last 2 logs)
(empty collection.)
io write only goes to like 16 kb/s, no high usage
yes
performance.now
21.49 - 19.24 = 2.25 sec insertion time
its just a simple schema with one default function calling nanoid
What’s taking so long that it takes 20s just to validate
2s****
20,000 ms is 20s
nono
only look at the differences
performance.now returns the time since process start in nanosec or whatever
validate takes 7 ms
checking (read collection) like 21ms
Either way 2s isn’t terrible
Okay
And I have an empty pg table
And even with records it still takes 1-2s to finish creating
That’s where bulk of my endpoint time is

Redis™️©️
persistent by default 
Redis may persist records but they aren’t for lengthy storage
They are meant to expire
restart proof ig
🤔
crash proof then
I have no clue what you’re on about bro
Right immaturity shows with this one

Can we never have a normal conversation in this fucking channel
silliness*
even my custom made database is faster than that
come on postgres devs
Also pg is just a little bit slow sometimes 
there's always one
battless, noob, etc
At this point im convinced they are related
battleless is a gem
theyre the same account those 2

Or ItsOkayBae
use object relational mapping drivers then
Oh I know you guys just can’t prove it right?
though you can still use mongo its good enough
im not doing things on a scale
Honestly I could probably drastically improve my speeds
so even so
no rapidly changing things
But im in the prototyping phase so idrc rn
mongo is designed to run in production at scale anyways
probably by scaling horizontally on the atlas cloud and charging you 20x for that
scaling horizontally? i prefer diagonally
each time we brought it up they voided the topic 💀
plus noob hasnt been active since being called out 
Yes he has
who is this noob person
oh this dude
not super active
i remember
The chatgpt guy
Oh ofc
If I remember correctly Battleless had the same pfp at one point
Not exactly a slam dunk but yknow
They act the same and had the same pfp
i have not seen a single productive message come out of battleless or this person
Cause there is none
Do you remember ItsOkayBae
vaguely
i definitely feel the energy
its just something subconscious
you just feel it
him and battleless emit the same energy
ong
@harsh aspen thin ice buddy
Oh no he’s been summoned
Prepare for a 5 page ChatGPT essay on how he doesn’t know who this Battleless person is
what the fuck
sry internet bit shitty
cant select most bottom requests bcuz that status bar is blocking
what in the actual heck takes 2 hours to load
Yea okay
1gb in resources
Your mom
lmao
1.02 mbps coding
its js the same tab ive been working on the past 3-ish hours
(live reload)
lmao
What are you trying to store and is your app on the same machine as the pg db?
Yea and it varies
Mostly uuid and strings
Something is up then if it takes 2 seconds
Yea no sure I’ll do further testing later
No way you scrolled to post that
that is not worth the ping I think
i am sick of coding. Cs field not worth it anymore. No money, no women, no respect only grinding ):
dont have too high expectations
didnt have any.. just did coding in highscool as a hobby n then in college decided to pursue cs bc i liked it
i like coding dont like theory or math
i think i just contradicted myself
yeah sadly that's a problem for most new CS students
CS is often a lot of theory, unless the curriculum proves otherwise
yeah
Yey i have my green role
yeah i also had my green role for years, and havent coded a discord bot since sophmore year of highschool so
Yey you too have green role
discord api went full crazy and it was time consuming to keep updatinng the bot
The api didn't change too terribly much. Libraries like discord.js like to change a lot for some reason
yeah i meant discord.js specifically
but discord too the whole thing with removing bot perms to secure privacy & buttons, dropdown and so much more
I really want to thank everyone for helping me on my coding journey in here. Everyone’s been great with explaining and pushing me to do stuff out of my comfort zone. I remember asking to be spoonfed code, and now I have somewhat mastered Haskell, Java, js, (bootstrap, html, css not really code but still in my stack), c++, Python.
postgres question time again
so theoretically if i had 890 million database records, how would I make querying them fast? atm it takes just over a minute to query the count and 1-2 minutes to query any field
vm specs
i used https://pgtune.leopard.in.ua/ which sped up the query a bit but im still struggling to query fast enough
PgTune - Tuning PostgreSQL config by your hardware
Are you using any pkeys or b-trees?
i dont think so
some example queries i do are:
SELECT * FROM data WHERE addresses @> $1 ORDER BY timestamp DESC
SELECT * FROM data WHERE domain LIKE $1
SELECT * FROM data ORDER BY timestamp DESC LIMIT 1```
id
domain
addresses (array)
rcode
hostname
subdomain
ns (array)
timestamp
Hm. LIKE is pretty tough

I'm not too sure. I've only dealt with predictable conditions so you can easily make a b-tree on a specific column
i could do a full text search index
and query using that instead
since LIKE doesn't work with FTS
what does @> do
array contains
for the first query, i would have a separate table for address+id and index the address
for the third query, try using the MAX() function instead:
SELECT * FROM data WHERE timestamp = (SELECT MAX(timestamp) FROM DATA)
for the second query, try using a trigam index, although it only works with minimum 3+ character queries, but it supports both LIKE and ILIKE queries
there are a lot of other techniques for fast text-queries depending on the type and format of strings you store
for example check the last answer to this question for something specific to domains: https://stackoverflow.com/questions/59500932/how-to-index-variable-character-column-for-pattern-matching-in-postgres
it also shows how you can use a GIN index to speed up your first query
this discussion is encouraging me to work on my project
Hi
mhm
JNI is a PAIN
Have fun
You’ll probably spend more time debugging your Java JNI stuff than you will working on the actual rust part lmao
regarding this, it's actually a good thing to also add to my name lookup, but I've got a lil question: "actual total time" is supposed to be in seconds right?
I created a gin index on my materialized view, currently comparing fuzzy search options to see which one performs better
levenshtein dist is the one that got the best actual total time atm
why
nvm this, raw mode returns a simpler view of the results
and when did you see a groovy codebase?
ps: build.gradle isn't groovy code, it's just declarations and settings
I'm 120% sure it either wasn't groovy or they didn't know how to use it
saying that it looked like java is why, especially saying prehistoric java
I've used java 1.4 before, trust me
it's not lmao
took me about a day to get used to jni
JNI binaries are essentially just dll files
Yes but you’re assuming that the binary you’re using doesn’t have issues
like what?
If you’re writing your own DLL, you’ll probably be doing a lot of debugging unless you’re not doing something complex
I’m not sure how it works with Rust but I know running into segfaults with C++ DLLs fucking sucks
well if you're using Rust the library does most of the heavy lifting for you
while you also get Rust's safety features
crazy how gen digital (owner of norton and avast) also owns ccleaner
very interesting
malware
true
malwarebytes better though
windows defender is good enough
disabled that shit
at least i want to
it no no let
shit uses too much of my system for no reason when its enabled
yeah especially you own a low end pc
(this happened with a mid-end)
im not in fckn switzerland
first ireland then switzerland 😭
demanding websites to comply with every single country's regulations just because some people from there access your website
its the stupidest thing ever
oh man people from north korea are viewing my website, i better change my website to cater to their demands
imagine needing an antivirus ☕
index time
the hell you're making a regex index

nah, more like linux is too decentralized to be able to make viruses for
windows is easy cuz there's only one windows
also clamav is good
thats pretty much what the whole xz attack tried to do
i dont think it actually affected anyone iirc?
cuz of smth stupid like bad code which errored
there's no difference!!!
the fact that the page's texts isn't uwuified is a sin
fr
Reawct is the librawry fowr web awnd nawtive uwuser interfawces. Buwuild uwuser interfawces owuwut owf individuwuawl pieces cawlled cowmpownents written in JawvawScript. Reawct is designed tow let yowuwu seawmlessly cowmbine cowmpownents written by independent peowple, teawms, awnd owrgawnizawtiowns.
it failed only because it was detected unexpectedly early by accident
in its current state, it would only affect very specific builds and distros, presumably for testing
but since it piggybacked on a library that builds for a shit ton of distros, it could easily spread to other builds later on
too much of a change for the site
lmao
my autism doesnt like that there arent any new lines here
and unnecessary curly brackets...
code that belongs together together, seperate else
use coffeescript
js is good for what it can
ew
yo guys check this out
ip grab
nearly 30m later and its still indexing 
tbf mongodb index was fast af
this is 890 million records and like 15% of a 1.5tb ssd
thats why indexes are supposed to be created before adding data
hue
lol fairs
what about nim, julia, crystal, zig, D
so guys my bot is hosted on vps and uses a sql file to store databases
dunno about all of them
what about c#
its really good
its literally java
😭
yeah because it loves u
is that a question or?
is that good or bad
because what if alot people use a command tha changes their user varianle
gotta love watching all my 502 and 304 errors
and random ips tryna find vulnerabilities
by sql file i assume you mean you're using SQLite
sqlite is a very powerful database, it can easily handle thousands of operations per second, as long as its configured correctly
what about postgres
same thing pretty much
Okay but that’s like impossible to compare
@sharp geyser good morning!!
At that point it comes down to your use case
SQLite is a disk oriented database, whereas Postgres is a cloud database which requires a server running
ah i see
postgres for scalability
Sqlite is limited to read/write speeds of the disk and Postgres has no such limits other than tls connection limits
sqlite for anything else
lmao
Not to mention because of how SQLite is, the data types it supports is also rather limited where it only supports the basics
Like you won’t get any relational tables from it, which to most is fine but it is also annoying for anything large scale where you want to be able to tie data to each other
mongo can be selfhosted
So can Postgres?
p sure
i mean, "cloud" is not really the correct term, as you will most likely run pgsql yourself in some vps
not hire a managed service

Astrid you have no opinion once you stated you were going to use redis as a database
you can tie tables to eachother on sqlite
redis is literally just const database = {}
I mean, that's the whole point of sql
Not in the same was as a conventional relation database
SQLite is limited in that regard
what's the diff?
need me a kv http db that is not couchdb
nothing wrong with that tbh
Pretty sure SQLite doesn’t support join statements
it does
it does lol
yes, that's the point of sql
Then I was wrong :^)
Either way, SQLite is still limiting on scale
So anything big I would never use it for
because its lite :^)
according to the better-sqlite3 author, there are 3 cases where using sqlite is not recommeended:
If you expect a high volume of concurrent reads each returning many megabytes of data (i.e., videos)
If you expect a high volume of concurrent writes (i.e., a social media site)
If your database's size is near the terabyte range
on the opposite side, if your database size is near a terabyte, you need to rethink whether you really need to store all that data
likely
If your database's size is near the terabyte range
scaling on raid required right there
SQLite3 is very very fast. With proper indexing, we've been able to achieve upward of 2000 queries per second with 5-way-joins in a 60 GB database, where each query was handling 5–50 kilobytes of real data.
the only thing I miss on sqlite is that you cant make functions
our*sql
it has to be implemented through external means
Our
many sqlite libs implement that for you
better-sqlite3 does
yes, I mean raw sqlite
ye
I love Cassandra
cassandra classic
Never met her before but she sounds nice
pgsql + caffeine = s p e e d
to send raids to your colony /j

Well I figured that much
But how is it different from the other dbs
Everything is better than mongodb
wait so i don't have to worry about it?
like if 5 people do /work command in one second
that's the expected speed if you do worry about it
but yes, 5 people is nothing
even with the worst possible database setup it'd still be far from the bottleneck
Oh so i don't have to worry because i don't think i will ever get 5 people at one time
bruh why did two people said nah bro is using sql file for databases
in different server
When its good
well, it's all relative
sqlite is good but if you have too many writes per second you might start noticing performance issues
yeah 5 people is nothing, most sql queries literally take 0.1ms
as long as its correctly indexed
and WAL mode is enabled
also helps to disable sync
I have some transcation
What is it
Like i open it and its a random string code
in it
what is?
ye i found it in database folder
its called transcation
It says its used for sql
dont you mean transaction?
yes
transcation lol
did you clone some project?
why is there a file you dont know about then?
transactions are used to batch queries together
yes that
i got it with sql
cassandra is a girl?
It was a joke
which library are you using for sqlite?
Cassandra is a database
aoi.js
never knew libraries can have pronouns
does aoi.js have sqlite bundled with it?
yes
It has a database wrapper
it comes with more stuff
Let’s you connect to various dbs
that i don't know about
SQLite being one of em
Oh
idk i want to make something i always dreamed
bot where you get a living creature for your population
idk how to explain it
a tamagotchi
like usa population live count
but instead its a bot and you race to be first on leaderboard
sqlx my beloved 🫶
im looking at the aoi.js repos and cant find any reference to sqlite or dependencies to sqlite libs
aoi has wrappers no? not necessarily the database implementation itself
open your package.json and search for anything containing sqlite
It uses another lib
i checked @akarui/aoi.db as well
no sqlite there
did anyone here dip their toes into 3D game development? it's been peaking my interest for a while, but I find it too intimidating to even begin. I've fiddled around with UE for a short period, it seems like a powerful engine but I generally always end up being lost in whatever I'm doing. visual scripting seems nice but I'm aiming to write actual code so I can have fine grain control
I'm looking for engine suggestions for a first timer, heard about godot. if anyone has personal experience with game dev, I'm all ears
idk its called .sql file
All I know is it allows you to connect to various dbs from my research
I did, kinda
really?
I really dont recommend UE as a starting engine, it's powerful and fancy yes, but REALLY hard to get the hang of
so like aoi.js
also it's heavy af
yeah, the interface is intimidating too. it's totally out of my comfort zone so I'm having trouble picking it up
If you know C++ go for Unreal, its learning curve is steeper but once you get the hang of it, it’s very powerful. You can use blueprints or you can use their scripting api with c++ files.
or you can use their scripting api with c++ files.
didn't know that, so you can mix&match cpp and blueprints?
Unreal is a "industry" grade engine as some would call it. Unity is also popular but it’s in hot water right now unless they’ve fixed their problems
I recommend trying godot as a start, it supports gdscript (python-like), c# and c++ so you can raise the ceiling if you prefer lower levels
and the engine is a few hundred mbs
You can use both in the same project technically
javascriptless ahh bot library
Godot is awesome for beginners. Unreal is very difficult to get the hang of, not to mention it’s very big in size
i didn't even know aoi.js would work perfectly with vps just like @timber hatch told me
Godot is a few hundred mb and opens super quick. Runs on basically anything
I only recommend unreal if you’re serious about game dev tho
Otherwise don’t bother
my pc doesn't even support godot 💀
just make your own graphics engine smh
Astrid we are trying to give good advice
that's very hard to achieve
Shut up
i love you more
Honestly if you want to make your own game and it’s not something you want to get out quickly, make your own engine for it
It’s not that hard and you just add things as you go
Depending on the game sure
Teaches you a lot
godot seems like a match then. I am looking to get serious with game development as it's kind of the next milestone in my career, but I'd rather pick it up on my own terms
Imagine implementing multiplayer
real
Multiplayer really isn’t super complex
Geometry dash 💀
ask robtop that
you need whole team bruh...
Godot is a good engine as well, it’s grown over the years
3d in 2d game = gd
I mean the idea is your client sends info to the server, the server sends info to another client
Idk how it’s 3D space is but it’s 2D is definitely well developed
lmao
Or if you don’t really care about cheating you can do peer to peer
yes gd is for no lifers
said by a gd player
I’d still let a professional engine handle multiplayer for me
yep, it's not like you were going to make a best-seller right from the start, it's not worth the productivity loss over going with something more familiar
i don't play it i just check what cool levels community made @surreal sage
discord added a reply feature u can use btw :3
I often saw people on gamedev subreddit who started on UE just because big games are made on it
I’d definitely check out unreal at least once in your game dev career once you get used to game development though
then a few weeks later they gave up because UE doesn't care for your feelings
Its combination of blueprints and c++ is powerful
Some games even use exclusively blueprints
starting with a simpler engine does help building skills till u reach the more complex engines
I learned a ton from making my own mini engine, 10/10 would recommend if you have the time
in js with canvas 🗿
also gamedev will require skills in 4 different areas, the lower stress will help developing them
that is, coding, 3d modelling, audio and image editing
Modeling, sfx, coding and one other
Other than coding they are the bane of my existence when I was doing game dev

that's what I'm aiming for 🫡 UE's been peaking my interest ever since nanite was announced
in reality I know the first couple of projects will be rough, aiming for beautiful visual storytelling regardless of the engine though
image part is becoming pretty good with introduction of stable diffusion
and modelling is also becoming easier for coders because blender's geometric nodes
UE if you don’t value your sanity, godot if you value your sanity and want to build good practices
oh, right, I forgot about it - 5 different areas then
I assumed you already had game dev experience (because you picked UE)
I forgot storytelling
So I recommended UE
But if you have none go for a lower risk engine like godot
It’s more user friendly
i've used it for a really small amount of time, just tried fiddling around with the default project templates
As for the reasons we’ll haku and waffle already end preached that part
I’ve used UE off and on now, it’s a massive engine
It’s learning curve is STEEP because of what it offers
godot it is for now, I hope I'll check back in here every once and a while to show off my monstrosities
only thing about godot, I do recommend using an external editor
for code, that is
their own editor is a bit too basic
yeah I use rider for everything c# related anyway, I sold my soul to jetbrains
rider does have official integration to it
and I mean like, truly direct integration
you just need to disable the built-in editor and set rider as external tool and ur good to go
hey guys how can i portect against bruteforce attacks?
this is the only thing i haven't implemented yet.
for the site?
yuhh
ratelimits or captcha
it's hard to bruteforce when you can only do it 5 times per min
(Server side ratelimits, client side can always be bypassed)
also enforce strong passwords
If you keep hashing a hash the hash grows into a stronger hash
:D
wait u might've just solved security
I know I’m a genius
db still indexxing 2 hours later
pfft nah
yep!
Oh
i mean indexxing 890 million records will take time understandably
You’re db is still indexing
yes
I thought you meant my hash hash hash hash db
gin is 3x slower than gist for generating indexes
you better leave that overnight
😭
btw, shouldn't u be using the trigram thing?
idk 😭
i dont use postgres enough
i am a mongo person
but i was persuaded to use postgres for this
Also what’s the proper steps to setting up a vps to be secure
HUH
ssh key auth, maybe IP whitelisting?
live laugh mongo <3
bun uses mongo
CREATE INDEX index_on_domain ON data USING GIN (domain gin_trgm_ops)
which is what tim mentioned earlier
What da heck is gin and create index
ERROR: operator class "gin_trgm_ops" does not exist for access method "gin"
I’ve used pg for years but never ran into it
u need to enable pg_trgm
ah
CREATE EXTENSION pg_trgm
smh
cancelled old index
I’d read that but quite frankly
I’m too lazy rn

tldr, they're to make text indexing faster
I’m still getting over the feeling of being sick
if your data changes too much, or too many new rows are inserted all the time you might want to make a materialized view instead
or use gist, which is faster for updating indexes

materialized views are like a snapshot of whatever query u put inside
you can add indexes to them
but it requires refreshing to retrieve new changes
hm, is there an easy way to manage all this?
@spark flint referring to you mention ssh keys and ip whitelisting
for some reason it didn't reply to your message

i use termius for ssh if it involves keys
since you can set and generate ssh keys per host
If the development team ever grows i'd like to be able to easily add or remove users to allow them to connect
for IP whitelisting, only do this if you have a static IP or a VPN to connect
its not that hard iirc
It'd require someone already connected to the vps
Which means they'd already need to be both sudo perms and have their ssh key on the server
As password auth will be disabled same with root login
Someone also recommended https://github.com/warp-tech/warpgate to give an additional layer of security
It can record ssh sessions, so anything you do during that session gets recorded
Though this seems overkill 
Cool project tho
syslog can do this
log4j
Yea I think the entire point of warp is to make it easier to manage ssh sessions though
Which is meh tbh cause it’s not like it’s important for any small scale servers
But if you’re running a server that allows multiple people to connect to then I guess it’s a viable solution
Idk what it does entirely as I’ve only just learned about it a few days ago but it does a lot more than just recording sessions
still indexxing 
currently going into a deep dive of i18n
trying to make it nice as possible to maintain
so, i can define a command like this and just wrap it in the _() function
dpp::slashcommand bio_command::register_command(dpp::cluster& bot) {
return _(dpp::slashcommand("bio", "Update player biography", bot.me.id)
.set_dm_permission(true)
.add_option(
dpp::command_option(dpp::co_sub_command, "picture", "Set a custom profile picture")
.add_option(dpp::command_option(dpp::co_attachment, "image", "Image to upload", true))
)
.add_option(
dpp::command_option(dpp::co_sub_command, "text", "Set custom biography")
.add_option(dpp::command_option(dpp::co_string, "biography", "Biography to set", true))
)
);
}
then, define my strings in my lang.json:
"CMD_NAME_BIO": {
"en": "bio"
},
"CMD_DESC_BIO": {
"en": "Update player biography"
},
"CMD_OPT_NAME_BIO_PICTURE": {
"en": "Set a custom profile picture"
},
"CMD_OPT_NAME_BIO_IMAGE": {
"en": "Image to upload"
},
"CMD_OPT_NAME_BIO_TEXT": {
"en": "Set custom biography"
},
"CMD_OPT_NAME_BIO_BIOGRAPHY": {
"en": "Biography to set"
}
if it works first time, i'll be shocked 
i found a nicer way to do it 🙂
I am in visual studio but when I get in it just says that my MODULE_NOT_FOUND. This is because my Visual Studio Code isn't finding my Node.js files. How do I change it in VSC so it can find it so i can start building my bot. It would mean alot if someone could help me.
I looked on Google for over 2 hours so I thought I would come here because most of you own bots
that means you did not install the required dependencies
How do I do that
npm install
In the node.js command?
in the vsc terminal
why not
Just says that message
show the full error
Ok
I ain't on it but I can basically say it
it can't find app.js
you said you cant run npm commands but you can
Sometimes it doesn’t autosave
instead of node app.js you first run npm init
I do
And it says that thing
what thing
I don’t see your package.json
in your picture you dont have a package.json
package.json is created by running npm init
in the same place you typed node app.js
Everything with the word npm doesn't work
why not
I don't know
show what happens
show full error please
then ask for help when you are
and no thats not the full error
that's part of the error
Above that is just me typing Npm init -y
We need to see the full stacktrace
doubtful
i've never seen npm init -y telling you module not found
Wdym

above that is the path of the file that is the source of the error
thats what we need to see
Well ig you did now
tim correct m eif I am wrong, but npm init literally cant respond with that kind of error no?
ah
usually reinstalling node fixes it
ig i've never installed node incorrectly
or seen anyone who has
since its literally simple asf
well ig if that error does happen when node is installed incorrectly ig try reinstalling node is a good first step, unless tim still wants to see the full error
literally cannot help if dude is not at the pc to run the necessary tests
Well the file that VSC is trying to find isn't a thing
true enough
Sir, please request for more help once you are at your pc, there is nothing we can do for you otherwise :)
I can tommorow.
Tim can I ping you tommorow
what if no ones available






