#development
1 messages · Page 296 of 1
It is for most users
It seems like you’re already GDPR compliant though, since you have an operational need to store the data indefinitely
There was a npm package for creating image from messages like discord chat anyone know it? I forgot the name of the package...
lmfao cursor ai writing unsafe code in something that can easily be done safely
guys, is it me
or is the worst part about ts the tsconfig
EACH IMPORT I MAKE I GET A NEW ERROR
the worst part of ts is ts
just migrate to dart :v
waddahel is dart
const { createConnection } = require("mysql2");
const { getSecret } = require("../../Agents/AWS/awsModule");
module.exports = async function createDB() {
try {
const dbName = (await getSecret("Data", "key")).toString();
// fetch other secrets in the same way
const db = createConnection({
host: "ip",
user: dbUser,
password: dbPassword,
database: dbName,
});
async function executeQuery(queryString: string, params: string[]) {
return new Promise((resolve, reject) => {
db.execute(queryString, params, (err: any, results: any) => {
if (err) {
console.error("DB Error:", err);
return reject(err);
}
resolve(results);
});
});
}
return { db, executeQuery };
} catch (err) {
console.error("DB initialization failed:", err);
process.exit(1);
}
};
hey guys, this is my database handler.
In my main.js, my entrypoint of the script, i have await createDb().
For some reason, the data returned by aws here is ALWAYS empty. Even my aws module logs data correctly, just this function doesn't seem like its awaiting?
the cooler ts
if i am learning a new language its going to be rust.
if u know js u prolly know dart
the only difference is that the latter has proper types
facts, i just like rust though.
It's syntax reminds me of haskel in a very very very vague way
put vague in that
my favourite lang is haskell and i'll die by it
loll i was right
i heard people say it's like a cult, seems like they're right 
it is
haskell is just simple.
rust is also a cult
i just like the way you must give a function signature in abstract format
it's also super fast, and has no side effects.
most of the compute stuff in my backend, i just wrote it in haskell for the funs.
MOVED
SECRET SENT
I did some logging, the moved is after the getSecret.
the secret sent in the aws module right before the return.
As you can see, my code doesn't await at all which is strange, as the module is async and i properly await it.
so MOVED is after const dbName and SECRET SENT is inside getSecret right before the return line?
that makes no sense at all
also why dont you use mysql2/promise
i mean its fixed now, after i uses Promise.all for some reason
but the whole thing is, it stillreturn an empty buffer.
I am absolutely stunned
all my other code is receiving their secrets nicely, only the connector of my db is not working.
ahhhhh ayayay
i know what's up
my encryptBuffer is encrypting the buffer and resetting the buffer
i am using aws secrets manager. but i absolutely despice the idea that the keys are stored in my memory. Hence i am receiving a buffer and setting that buffer to 0.
requesting from aws each call is fucking expensive, hence i created a cache that i encrypt.
So eventhouhg that stays in memory, its encrypted.
i am mainly scared for memory dumps, not sure why.
Using another secret lmao
But that secret isnt stored on the machine, just at modt a few seconds in memory
But nothing to do against that
Unless i create some sort of signing algo such that the key never leaves the environment
or quit the never ending game
yup
I wont tho
Moving yo privy made it a lot safer tho
No more private keys on my server
All signed by a trusted third party
😵💫
try an ML
OCaml or F#
both are mostly functional but also let you do some imperative stuff when performance would benefit
you are worried about nothing basically
if that were an actual real world concern, nobody would be using secrets/keys/passwords anywhere in their programs lol
also, if you're using js, pretty sure any string you create will be cached in the engine for performance reasons
nodejs has string deduplication built into the engine, any string you create, even if temporary, will be stored in a string table
of course there are cases where it doesnt kick in, but thats up to the engine to decide
TimJS when
all copies of that string have the same address, so its all the same string, even if you write it literally, the engine checks if it already exists in the table
(rope strings)
Damn interesting!
I mean i got a cache for private keys.. it just feels super exposed hahaha
you're obsessing over the wrong things lol
there isnt a single software in the world that isnt vulnerable to memory dumps, if thats what you're worried about
I know lol
A lot of them actually 
lmfao
i realised because i was working and the service we use stopped working so i messaged everyone asking if theyre having an issue too
messaged the dev and he told me its cloudflare
Yeah someone just shared this to another server I’m in
Cloudfare: "aight peace out 🤞 "
Cloudfare status: "wait wat about me"
Cloudfare: "dw, u will join me later"
Real
Thankfully my website isn’t affected 
same, what is the use for cloudflare even TwT
i honestly never did research into it
Hiding origin IP, ddos protection, free SSL cert and hotlinking protection in my case
currently i host my site with nginx, how would i be able to use cloudflare?
Do you really want to use it after today's outage? 
I mean for ssl you can just use cert bot but cf's dashboard is also cool I guess
I use it for global load balancing
if not ctx.author.guild_permissions.kick_members:
embed = discord.Embed(
title="Missing Permissions",
description="You do not have the permissions to execute this command!",
color=EmbedColor
)
embed.add_field(name="Permission Needed:", value="`Kick Members`", inline=False)
await ctx.send(embed=embed)
Anyone that can spot a mistake i made in discord.py?
im guild owner so no clue why it does this TwT
It’s going off the permissions, yes guild owners have them but it’ll return as false unless you have a role with it
ive given the role ive got (already had admin perms) kick member perms
still same issue

You could check
if ctx.author == ctx.guild.owner:
i hate dev lmfao
If you want guild owners to always have access to using?
I think that’s the right way for that
the warn command should be for users with kick_members perms
thats the whole thing
as simple as that
but for some reason discord says "fuck you"
Yes but guild owners will always have those perms by default anyway?
Exactly
why tf aint it working then TwT
Does the bot have the intent?
bot has all intents, and the bot has its own perms
ive done discord.Intents.all()
bruh
when printing ctx.author permissions (mine), it returns an empty string
What happens if you print perms of the author to console?
Beat me to it
Have it print the type of author
If it says user then that’ll be why
try using channel.permissions_for for checking permissions
they have so many of these that its a wonder how they are still #1 in the sector
i dont use it in any of my project because of that
rather have uptime than "protection" lol
its probably because they are so big, "sure my site is down, but so is everyone else's"
even if your site is up and its something people use for work, chances are they alreasy have the day off becuase all their work stuff is bricked. Not a good mentality but would you rather deal with some more downtime, or have to pay people to fix the issue while you are loosing money from it as well?
either way, cloudflare does not concern me, floor desktops have me covered.
added stat displays to my top.gg page which was fun
shoutout to claude for making the svg for me 
Looks clean
#jealous
really putting faith in me with that one 
boys i am kinda tweaking.
What's the difference between export and module.exports?
for example, when i use export, i must import it.
If i use module.exports i must use require.
I know that it has to do with the fact that import is web based and require is a nodejs thingy, but never really looked into it.
Ty will check that later
Currently done it with a decorator
And [cmdname].error event
judging by what u said here, the former is esm, the latter is cjs
also @quartz kindle wtf is happening with google auto-translate lmao
who tf is snapstromegon
wtf lmao
export is an official standard: ESM / Ecma Script Modules
the rest is not official, commonjs (module.exports + require) was created by nodejs before any standard existed
back then js had no concept of modules, all js was loaded into the global window scope
so a lot of people invented ways to simulate a modularized environment, among them was nodejs's own require system, which later became known as commonjs.
other similar systems worth mentioning are AMD (asynchronous module definition), requirejs and systemjs
pretty much all of them are obsolete and ESM is the one and only official standard now, although it does have its flaws and limitations, which is why a lot of people still prefer using commonjs in node
i used to use cloudflare for everything but recently also dropped them completely (except for domain registration since theyre cheapest)
mostly for dos protection but i'd rather have the independence over getting dos protection that sometimes works sometimes doesnt for a site that isnt targeted by them anyways (and even if it does there isnt really a loss for me)
i think hetzner offers some ddos protection for free so thats good, an improvement over galaxygate which charges for it
yeah thats pretty much what im doing now as well, but im using porkbun for domains, then hetzner for hosting
i use cloudflare turnstile and sometimes analytics though
What’s the turnstile do?
last i checked, cloudflare's analytics does not require cookies, so you dont need a cookie banner for using it
modern captcha
while most other analytics do
OHH
its a bit clunky to work with, but it works pretty well, and often verifies by itself without user interaction
you can also hide it from view and only show if the user did not pass the automated tests and needs to interact
Fair enough
you can also set it up to protect the entire website by redirecting you do a full screen captcha, but i dont like that one
its better than google captcha at least
yeah better than anything that uses "please click on all cars/buses/bycicles"
but im not a fan of captchas in general though i prefer defence against bots/automation by design instead (but sometimes i acknowledge thats not really possible or easy)
yeah there are many ways to protect yourself, but for something public/production-ready this is the safest bet i guess
i use it in login forms and all public facing forms
once the user logs in i disable it though
which then takes 15 seconds to load the new images
pretty much
i also have a honey pot in my forms for another layer of protection but its w/e at this point
let-else iirc
no but it doesnt surprise me considering rust allows for weird combinations like this
but i do use if let Some(x) = y {} else {} which looks a bit cleaner esp to people that dont do rust
then you can get a power trip by locking them if they spam
i wish js had pattern matching expression like php 8 has
const a = switch(x) {
case 1: return "a";
case 2: return "x";
case 3: {
dosomerthing();
return false;
}
}
that'd be neat
there is a proposal to bring this to js, but the proposed syntax is ugly as hell
WHat is it?
its still in stage 1 (hasnt moved in 5 years lol), so its not finalized
match(<subject-expression>) {
when <pattern>: <value-expression>;
when <pattern>: <value-expression>;
...
default: <value-expression>;
}
idk i like that ngl
match (command) {
when ['go', let dir and ('north' or 'east' or 'south' or 'west')]: go(dir);
when ['take', /[a-z]+ ball/ and {let weight}: takeBall(weight);
default: lookAround()
}
i thought it'd be
I like how rust does it but wont really work with js sadly
const direction = match(command){
when "north": "West"
...
}```
match (res) {
when isEmpty: ...;
when {data: [let page] }: ...;
when {data: [let frontPage, ...let pages] }: ...;
default: ...;
}
it has some weird form of destructuring built in
match (res) {
when { status: 200, let body, ...let rest }: handleData(body, rest);
when { const status, destination: let url } and if (300 <= status && status < 400):
handleRedirect(url);
when { status: 500 } and if (!this.hasRetried): do {
retry(req);
this.hasRetried = true;
};
default: throwSomething();
}
like how does this even make sense
yeah, this doesnt really work without a static type system
i need to check if im actually allowed to use external c++ libraries for my assignment 
if not then i cant read/write to json for saving and loading 
Ive gotten so used to types this nested at this point
create a new proposal now and maybe when you're 90 years old with children that are adults and the world has moved on from JS completely the ES proposal would be merged by that point
the rust experience
200 byte structs as well 😍
do you want to see something that will make you cry?
dop i have a choice
your heap must look like a barcode atp
well atleast these objects usually live for the entire programs duration
but it is a mess ye
need to get ram usage down
50mb idle is too much for my liking
rust technically isnt the problem here but it encourages these types of patterns in some cases
instead I'm writing a website where my chrome tab is taking up 300mb of ram to run it
also I found that the rust xz crate leaks memory if you dont read the sys crates docs
because when you enable mt, it does the compression completely outside of any of your logic
and its buffer never fills up
so you end up using 400gb ram
i got my frontend down to 40mb somehow with svelte but it doesnt do anything too special like editors or anything which use lots of memory
uh ill check
'Droid Sans Mono', 'monospace', monospace
thank you
so this is my genius solution
impl<'a, W: Write + Send + 'static> Write for CompressionWriter<'a, W> {
#[inline]
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
match self {
CompressionWriter::None(writer) => writer.write(buf),
CompressionWriter::Gz(writer) => writer.write(buf),
CompressionWriter::Xz(i, writer) => {
*i += 1;
if *i % 64 == 0 {
writer.flush()?;
}
writer.write(buf)
}
CompressionWriter::Bz2(writer) => writer.write(buf),
CompressionWriter::Lz4(writer) => writer.write(buf),
CompressionWriter::Zstd(i, mt, writer) => {
if *mt {
*i += 1;
if *i % 64 == 0 {
writer.flush()?;
}
}
writer.write(buf)
}
}
}
#[inline]
fn flush(&mut self) -> std::io::Result<()> {
match self {
CompressionWriter::None(writer) => writer.flush(),
CompressionWriter::Gz(writer) => writer.flush(),
CompressionWriter::Xz(_, writer) => writer.flush(),
CompressionWriter::Bz2(writer) => writer.flush(),
CompressionWriter::Lz4(writer) => writer.flush(),
CompressionWriter::Zstd(_, _, writer) => writer.flush(),
}
}
}
(same issue on zstd)
huh? does it just continuously allocate heap buffers
seems so yeah
I mean the frontend I'm working on right now isn't super simple, but it probably doesn't justify 300mb of ram
the sys crate say it just continues without stopping
and the xz crate seems to not know that or something
flushing does force it to stop and finish though
never use php jk its a bit dated but its ok still
I hhate both
I spent like 2 days working on setting shit up because I had to go in and manually modify my php.ini file to get something working
And then I had to find some random ass library binary online and tell php where to find it and shit
Honestly worse than setting up a C++/C lib
I thought the whole purpose of a language meant for web dev was to make it fucking easy
So glad I'm being moved to a different project next week
did you do it on windows or what?
Also not to mention the intellisense for php is awful
never had these issues
Yeah windows
that explains it
All the machines at my work are windows
I'm sure it's not as big of a pain in the ass on linux
But we recently switched to using laravel for most projects because they found it "made us more efficient"
Which is a total lie, I've been slower than ever using PHP due to lack of intellisense and terrible language features that aren't consistent
would probably consider setting up wsl2
Can't run it through WSL
but yeah the language itself is a total mess
Can't remember why, but there's a reason I can't
me when I explode and implode a string
strrev and then str_contains
"split"? nah, EXPLODE
at least laravel reexports most of these with more sane apis and names
laravel is horrific
I hate everything about this framework
We're using it combined with Inertia Vue
So at least the frontend is somewhat tolerable, but god the whole laravel model is NOT meant to work with an SPA
it's funny because laravel has official templates for spa
Yeah but the whole idea of laravel just doesn't work well with SPAs
-# any of you use c++
yeah
It's just SSR disguised as an SPA
occasionally
sometimes
exDee
any experience with json with it 😭
yes
a bit
how difficult would it be to create a header allowing nested variables (idk if this is worded right)?
Like your own JSON parsing library?
kind of? im not entirely sure if im allowed to use external libraries but im wanting something like this:
{
"overall": {
"draws": 1,
"total_games": 4
},
"player1": {
"losses": 0,
"name": "Noah",
"piece": "N",
"wins": 3
},
"player2": {
"losses": 3,
"name": "Noah2",
"piece": "C",
"wins": 0
}
}
i know external libraries would be easier, however if im unable to, id rather learn how to make my own?
heh, i think your expectations are too high for c++
It depends on your level of comfort with C++ and with language parsing
This isn't necessarily a super difficult task if you are familiar with C++ and parsing in general, but could prove to be very difficult to make it efficient
external libraries, its easy - i just dont want to use them if im not allowed
oh im not lookign for something extreme, will literally only store minimal data
The general pattern to handle JSON in statically typed langs is to have some sort of recursive structure of classes
ill be asking my tutor if thats allowed tomorrow anyway just to be safe, just also need to look at other possibilities if not
E.g.
JObject -> holds Map<String, JObject>
And at some point you'd have some sort of disciminated union to be able to convert a JObject to a JString or a raw string, etc.
This is just a general pattern, you may want to look at how popular libraries actually handle this
any youd recommend to look at?
It's been a while since I've done anything with json in C++, you can probably find a billion libs by just searching "C++ JSON library"
alright
does anyone know an online service for saving secrets?
I don't want to have my shit in a .env
i know aws secrets manager, i am still in shock cuz i didn't understand shit. You got iam policies, iam identity center, resource policies, resources, roles, roots, brah, so rather want a diff one
Don't know why but Discord keeps ignoring my X-Audit-Log-Reason specifically on role deletes 😭
What's so bad about env?
Just have a self implode button on your desk
I use Cloudflare Workers, they have secrets. Works perfect for me. If I ever reset my bot token I just update there and GitHub and refresh/clear clipboard to erase traces of it. As long as bad code isn't pushed and neither get breached it won't be exposed.
I've even considered a separate worker to autonomously rotate it every x days, but that might be overkill.
Apparently this is intended behavior by Discord??? 🤨
https://github.com/discord/discord-api-docs/issues/4046
Description When trying to delete a Guild Role with a reason (as the docs says), you can use the 'Audit-Log-Reason' header. But when using it, it succesfully deletes the role, but without a...
Hmm, i will look into it! Tyy
Hello
Just keep in mind it's designed to be used on Cloudflare's systems, not remote code. Kind of defeats the purpose and makes it more vulnerable otherwise.
@shell tundra
.ban @wild shoal 7 scammer
Banned mummyrose0864
i really don't know why datalix has no secret store.
or a way to store secrets alongside your vps
only feature i feel like is missing
anyone that used anything else than .env and can vouch for a cloud based secrets manager?
since we host stuff on azure, its keyvault is kinda nice
hmm, you got nothing else you used in the past?
I don't want to just google stuff w/o knowing which one to trust.
haven't used others nope
heard good about hashicorp but can't say anything about it personally
actually i read about doppler, their process is super sick
https://www.youtube.com/watch?v=wOkow-qb_Ys check this
Doppler is the multi-cloud secrets management platform developers, and security teams trust to provide secrets management at enterprise scale.
Learn more about Doppler:
👉https://www.doppler.com/
👉https://www.doppler.com/careers
👉https://x.com/doppler
👉https://www.facebook.com/dopplerHQ/
👉https://www.linkedin.com/company/dopp...
that's not something you'd put next to a VPS, you'd put it in the VPS
some larger companies might have something to support it though but your basic VPS providers likely won't. At least not for a while I'd think
i ended up managing to get it to write to a file, but i was struggling to figure out parsing - my tutor said as long as he can understand how to use the programme and can see it working (he wont be able to test mine without macos) then we werent limited to only those built in libraries so problem was solved 
this is so cool btw
you can run your node with the doppler built in cli, this will then inject a process.env into your program. So sick.
looks like a react native/svelte clone lol
Not really, I was dizzy all day 
I'm stuck monitoring our webcrawlers today. At least all i have to do is watch charts
@steel oxide check dm please
use #staff-tickets please
proof that we can't trust AI fully:
casually just pinged 305k+ members multiple times

Cheat network server totally not sussy baka 
🤫 🤫
lmao
it's literally react pre-hooks era
looks fun though. cross plat is always welcome
reading on it a bit i think its main selling point are the features you cant see, more efficient
but tbh anything is more performant than react/react native at this point
i've been using tauri lately. it isn't a "native" library. in a sense that it just wraps webview2
but it still does it very well and I get to keep using JS/TS on the frontend
and the build sizes are reasonable
js and small build sizes? impossible
ah it uses webview
makes sense
Tauri is really nice, I got into it to contribute to a project but have used it more for personal projects and I like it a lot
If only chromium could be installed as a runtime once and used everywhere instead of each app bundling their own entire thing 
dont forget windows using electron for the start menu :v
🤢
I thought it was react native
it is
this is more accurate
need to make a really simple mobile app that just reads nfc tags and calls some apis, does anyone have recommendations that are easy to develop with (including nfc support while developing!!!!)? android only
Wait what start menu is electron hu?
flutter
should be pretty quick to get something up and running
it's similar to js, in a way
but well, just create a project and read the tons of comments it'll include in the example
react native actually
how does testing while developing work? adb?
emulator and adb
I use intellij, but vsc also has a good integration plugin
dont recommend doing it raw
You can do adb using cable or android 11+ has adb over wifi
My phone is rooted for adb wifi 
bro u dont need root for wifi debugging 
With older android versions you do sadly
ah right
maybe consider custom roms then?
hm?
I do but it's still a higher android version
I wouldnt want to upgrade to 11/12 anyway those versions had issues and restrictions like the stupid obb block
mmm, im running rooted stock nothing os on android 15
Have fun when google annoys you with sideloading 🙂
too bad you lose access to lots of useful apps if you root/unlock bootloader 😦
youd think so
google and developers when i want to actually own my phone:
but 2h later and safetynet is completely fixed
can even download banking apps
and run them
yeah i use the play integrity fix on an old phone i rooted too, but its a cat and mouse game at this point because they rely on leaked TEE certificates from older android devices with less security and google constantly bans them so you have to keep rotating
and eventually we'll probably run out of insecure android devices to leak those certificates from
although i'll still choose owning my device any day of the week over bs restrictions
by the way think google is starting to cave into the pressure over the sideloading restrictions, i think they'll allow you to install unverified apps if you do some "this is unsafe do you want to enable this" typa shit
although i have a feeling there will be some curveball to this as with everything google does
beautiful sketchiness
yeah
i just hope the EU will ensure its atleast still usable
albeit i think the EU is actually part of the problem, at least for bootloader unlocks so not exactly related
samsung recently removed all bootloader unlocking mechanisms from their devices and its speculated its because of the EU's new radio law which requires manufacturers to lock devices down to prevent people (including owners) from potentially tampering with radio equipment on the device
waaaaaaaaa
truth is 90% of devices dont allow tuning the radio even with root since its encoded in the firmware/radio chip itself but might be an overkill solution just to comply
i mean its not hard to just buy radio equip
yeah, and just like that samsung completely alienated their entire root/custom rom community they've built up over a decade with not even a newsletter or post as to why
rust is finally catching up 🙏
pog got it working with websocket and message sending
Alright I'm desperate I need a py library that can reliably detect the language of a string and:
- handles short strings
- handles all langs
- returns country code/name
I've tried about 8 and all aren't great at all
true
i still remember how carbon banged on about being the successor and replacment to c++ (everyone forgot about it)
I mean its not released yet is it
then in that case the hype and claims they made was way too early because its been ages
They never really did
- Lingua
- pycld3
- langid / py3langid
- fast-langdetect
- short-language-detection
Tried 3 of those
They always said, IF it becomes to a stage where it can be production ready, it wil be a successor to C++
which 3
Lingua
Fast-langdetect
Pycld3
And the production ready stage was always said to be in years from now, if at all - it's an experiment
Will try the rest tho
i guess try the other 2 then
Yeah
You should read the entire thing
It's an experiment they do to see if a language successor to C++ can be done
It never claimed like other languages do to be the successor and replacement of a language
It first goes by its initial experimental phase to see if it's even possible
Unlike other languages that straight up say the opposite
cough V cough
the readme strongly suggests that as the intention to me but if you say so
You should read the entire project's ideology and phases/development stages
They may stop it tomorrow because they consider the experiment to not be a success
Production ready was always said to be in the years, with no deadline or specific year, exactly for the reason that it may not continue
the best thing that could happen for C++ is just a preprocessor that denies usage of older C++ features
my c++ code would probably fail almost every lint lmao
i sorta use c++ like c with classes and on steroids but thats starting to change after using rust more
i started out jumping into c++ without actually learning any of the modern mechanics and interfaces in it so at the moment its a mess of c and c++ apis, random mallocs and news etc
ive only learned about RAII a few months ago... after using c++ for 2-3 years lol
oof
in all fairness i started out c++ when writing embedded code so no standard library so got used to the old legacy c constructs to do everything
I started c++ this year with my assignments 
ong tim fell into ai hole
My goat disappointed me 
it is 
the results...very good
but admittedly it's made me a lazy programmer 💀
o kurwa
hmm - why not GPT Plus or Gemini Pro (just curious)
because claude is best for coding
couldve got the chatgpt 1 month trial or cursor pro
every ai company copying each other's $20 a month lol
i still remember how sam altman did a poll on how much people would pay for chatgpt pro and according to them it came to $20 a month
i tried cursor pro with a friend's account and also checked out gpt but claude is generally viewed more favorably
Claude is goated
sad because im gonna have to tell my work to take me off their copilot seat so I can use my own so i can have claude
or I just get cursor
cursor has all the major llms and includes most of them in their pro plan so its worth it if you want the best bang
has claude too and the latest sonnet models
although doesnt github's copilot include claude as an option too?
I'm in a C++ course at uni and it's actually pissing me off so much because I want to write like modern good C++ and the shit the prof is making us do is anything but
we're mixing references and pointers with no rhyme or reason
like something that logically should be nullable must return a reference????
I think some people get caught up in their own ways of programming, which is true for just about everyone unless they can break out of that and become "agile". People find whatever works for them and aren't always about how to do things "properly" or in the most efficient way because of how they're able to apply their logic or because of past experiences. I taught a few people entry level JS and I'm certain I did things in a decent enough manner as they've gotten relatively good at it, but I'm certain what I told them is a bit dated or not the most uh... Ideal I guess for lack of a better word.
I think it's really hard to teach people your own ways of logic as you have that fundamental understanding, but not everyone applies logic the same way
i'm not even saying she should be using smart pointers and RAII everywhere
pointers and references are fundamental C++ features and the fact that she's mixing them with no purpose is insane
what kind of code did she show? maybe shes just demonstrating the difference between pointers and references idk
but you still probably wont get away from using those in your course since many c++ codebases still use them without RAII/safe alternatives so probably just preparing you for reality of c++ codebases
we're given function prototypes we cannot change as part of a project we must build
remember this is end of term too so she has very much explained how they should be used properly
Did you choose to do C++ or?
Could have learned a modern language instead that can land a job.
c++ slander detected opinion rejected

i really hope this is sarcasm 😭
its a bit funny tho lmao
if you posted that on the c++ subreddit youd get slaughtered
the majority of roles I have seen are C#, Java, JS or C++
C++ was the only weak link for me and I also needed to take either cpp or some fuckass networking course
learning any of those in the big 2025 when we have chatgpt? wild
I’d rather cpp than networking too
C++ is more suited for lower level jobs with more experience required so it's a higher barrier of entry compared to C#, JS, Python
yeah but that's also a major weak area of mine
I didn't really have any systems language experience
yeah c++ is incredibly powerful but very easy to get wrong
rust makes it a lot harder to get wrong at the cost of some power (but lets you do a lot of that using unsafe)
does anyone happen to know if the GuildEmojiDelete event fires when a server loses extra emoji slots? (from losing nitro boosts) 
it doesnt, it should only be firing if an emoji is actually removed from the server. when servers lose the extra emoji slots the extra emojis get locked to stay within the limit
the ones locked when sent, just send like this :emojiname: instead of the actual emoji
i figured it probably behaved that way
yeah this is unfortunate bc i allow users to select the emojis they want to use
it's just a pet peeve of mine when they look like :emoji: 
ty for the answer 
youre welcome
yeah, those extra emojis do unlock if you regain the slots again which is great since you dont need to readd them to the server
reuploading 100 emojis each time u unlock new slots sounds so fun! 🤣
i know right!!!
hey guys is the ip of a vps @ datalix a /32 or /24 mask?
/24
i set up trusted policies to make sure only my ip can access it, i added the ip as a /32, but i get rejected lol
ah i assumed so, i gotta allow /24 on my ip
if you set it to /24 it will allow everyone on the ip block
depends where you use the mask in
for networking /24 is correct
for whitelisting /32 is
a /24 block costs like 500€/month
ipv6?
my home network gets in though
that's what i don't get
Doppler Error: Your IP address is not allowed to access this config. Please contact the workplace owner for access.
no ipv4.
really strange dafuq
may it actually be cuz of the ddos mitigate portal that datalix is running?
turned out i had to add ipv6 as my vps somehow prefers that or sum?
yes
How long does it take Discord to approve intents? I thought it was quick but I'm going on 4 days now and hit the 100 limit. Can't join any new guilds. Heck I can't even add it, which is wild because it's mine lmao
It used to be a few months, so I wouldn't complain if it takes like a week or so 
When did you submit?
if u asked for any privileged intent it might take longer
I think for me, it was 33hrs after applying? Could be wrong but I also believe it’s only M-F they deal with the requests too
a couple of business days
and good hekkin luck lmao
fr fr
Thursday
I saw mention of 5 but I'd assume holiday would push that to next week.
Probably depends on demand
true
Kinda sucks because there's nowhere to check the status to know. Bot page still shows the need for the application, but it said that ever since I submitted it and I got the email about it so I know it went through.
I’d say you’d hear back by the end of the week, next week possibly at the latest?
😄 forgot to update the server header static value oops
Looking nice!!!
Another win for app commands
yo uh, is it possible to send 60k users dms from discord bot?
im doing a christmas event where users get some reward but I want to dm them
to make them aware of the reward they received
is it possible?
Is it? Yes. Should you? Probably not unless you know they dmed your bot first
yeah these are all players who registered/played on my bot
Sending that many messages at once is definitely how to get your bot's account flagged
but dont you get rate limited if u send 5 dms a second or seomthing.
yea
worried about that
Rate limited =//= flagged no?
You'll have to spread it out over a considerable amount of time. If you need to update your users that care about something, I set a status
The rate limit is 5 messages per 5 seconds per channel but sending the same message is sus
so the scenario is. when users receive a gift they get a dm from the bot. and I've decided to gift everyone for my bot's anniverary
and theres like 60k players on the bot
not sure how to approach this 
Just set a status. Dont send a message for that. If the user later finds out they have it, sufficed it's in an obvious spot then they'll see it
hmm but the goal also is to bring back inactive players
You could inform them when they use your bot next time that they received something
If they don't care about your bot do you really think "gift" would make them come back?
If people don't bother to check of their own accord then I take a stance that you shouldn't get in their way and try to force your way back into things
Honestly I could check how often ppl use my bot regularly but I don't care tbh. Will only get me worried over nothing tbh
Could always do it as an announcement, first time they interact with the bot since you added it, the bot will tell them in the channel that they have a reward they can claim?
but i wonder how do these ticketing bots work?? i assume 100k+ users use it and they get dms from this bot no
yeah pretty much going with this
The messages are usually different
i see
some bigger bots have relaxed limits as well
Ticket bots usually send an ephemeral (hidden message) to say the ticket was created and usually only dm if a) user has them open b) ticket was closed but that’s also something that is setup server side for the dming part
Not all servers have it where it’ll dm the user once it’s closed
gotcha
you'll very likely get it banned
Ye I won’t be sending dms
I'm hoping today but if not then likely Monday or Tuesday. Not sure if they count Saturday as a business day or not, but since tomorrow is a holiday, hours are likely laxed today and tomorrow, and maybe even Friday.
Tomorrow is a holiday?
Oh right yeah I forgot it was TG tomorrow
Someone mentioned it yesterday actually despite us being in the UK
then Black Friday/Cyber Monday chaos ensues
Yeah I know Black Friday is this weekend
although it's never like it used to be lol
well Black Friday is always the day after Thanksgiving 😛
?verify

Polish users 
hey guys, how do i pass a whole ReactNode as a data prop ?
I basically want a main function that wraps my children in a header and footer to mitigate repeated code.
o kurwa
@deft wolf i really dig your profile pic
my attempt at one of those community pixel things
1 star per ip per hour (so with mobile data that’s 2 an hour 👀)
Most vpns allow for ip rotation
initializing my botnet to start placing stars as we speak
-# The preceding statement contains figurative or humorous language and does not describe any real or intended use of automated systems, “botnets,” or any activity that violates Discord’s Terms of Service, Community Guidelines, or applicable law. I do not operate, condone, or participate in unauthorized automation, distributed control networks, or any activity that could compromise platform integrity or user safety. Any interpretation suggesting otherwise is incorrect.
be gentle 😂
dude I swear some companies deserve to go under
I got access to a companies full network with a basic path traversal exploit, and now they are denying it
so I have to go to the state now because they have to report this and are refusing
@frosty gale did you see that hetzner has different plans now?
they have a "cost-optimized" section and a "regular-performance" section
cost-optimized has 4gb ram and 2 vcpus for 3.5 eur
i would like to run some benchmarks on these lol
yeah i saw that they say my current plan is deprecated now
might switch over because the old plan im on now is slightly more expensive than the new ones
but dont know how it compares on performance
have you tried benchmarking on ovh's cheap vps? that $4/5 ish for 8gb ram 4vcore
current plan vs new plan
not sure if its worth it
im on the CPX11 plan because USA location
so im stuck with higher price and only 2gb ram lol
for now
no i havent
let me look at them, but i dont like OVH's reputation lol
ah, that's fine
what happen with them 💀
my friend's been using ovh for their business and it's been working just fine
they had the datacenter fire that destroyed a bunch of stuff
but idk
wow
here is a public benchmark for them: https://www.vpsbenchmarks.com/yabs/ovhcloud_us-4c-8gb-20251114-0f2a3b
Yabs.sh benchmarks results for OVH US LLC (OVHcloud US) - VPS-1
I dont think that actually does much to their reputation nowadays
it was a long time ago already
here is side by side for OVH (right 4 cpu 8gb) and hetzner (left 2 cpu 4gb)
this particular benchmar has weird results
here is another benchmark for the exact same hetzner plan
you get widly different numbers depending on your luck, since the company is free to provision you with whatever hardware they have available at the time, as long as it fits the specs
which is utter bullcrap imo
but you pretty much have to create/delete instances until you get one with good performance lol
you can see all the latest public benchmarks people do on these servers here:
https://www.vpsbenchmarks.com/compare/performances/yabs
i'll try test mine see what i get
man i really want to get a better server but logically it doesnt justify the cost given my traffic and stuff i have on there
im basically the only one aside from a few occasional outside people using stuff on there since its mainly private so bottom hardware makes sense
oh you have to enter ssh credentials 💀 i'll just do some benchmarks manually
just call the yabs script
imagine if they temporarily increase your specs if they detect youre running a benchmark
lmao
honestly from looking at these benchmarks i dont see much gain in paying for more expensive plans, the results are so wild you often have cheap plans outperforming dedicated plans
wildly different results in different instances of the same plans as well
this cant be real
well, these are user submitted benchmarks, we dont know the context nor environment they did it in
but still
network speed is totally unreliable, since it further depends on testing servers being used
bottom line:
buy cheap intel/amd hetzner vps, check if you got AMD EPYC, if not, delete and remake untill you get it
my bench for cpu finished
https://browser.geekbench.com/v6/cpu/15261580 @quartz kindle
Benchmark results for a Hetzner vServer with an Intel Xeon (Skylake, IBRS, no TSX) processor.
will try do a disk bench later too
Do you remember my tests?
Did quite a few. All were worse on the dedicated plans. Most by a significant margin.
Just get a shared plan if you're on hetzner.
Or like 0x7d8 said, arm is surprisingly good.
i have a free 24gb ram arm server from oracle with like 4 cores so if i paid for a static ip i could probably use that
but ive never used an arm server for anything major so id have to do a lot of porting
but it is incredibly fast, we losing out with ancient x86
Fex I think it's the nail in the coffin for x86
just wait till gabecube gets traction
one of the selling points is that it supports any x86 software despite being arm
sounds cool
but yeah in general x86 is just a dated architecture as much as i love it, decades of backwards compatibility and design decisions behind it, it has served us well but we might want to move to arm/riscv or something similar in the future
sir
the gabecube is x86 (zen 4)
you are talking about the frame (snapdragon 8 gen 3)
Oh right
I will (hopefully) be buying an 80-core arm server from 2021 soon™
will be fun to play around with
run bungeecord
I was indeed thinking of resuming my crazy player tests
got to 5000 players on a single 7443P
but the bottleneck was the cpu
which instance is this?
Ampere?
I want
yes Ampere Altra
How da hell do I import commands from discord
in python?
js
oop, not sure about .js sorry
wrong place
this is the channel to ask for coding support
#support is for help with the website
aight
Detailed Guide on how to post your discord bot commands to Top.GG using NEW v1 Token - TermuxHackz/Commands-to-Top.GG
thack you!
Thank*
@frosty gale i recommended hetzner to a friend, they created an account, got asked to send documents (they are from ukraine), they sent them, and 24 hours later the account was gone, deleted, blocked, no explanation, no email
lmao
so now i have to recommend them a new host
OVH, DO, or any other recomendation?
dont want contabo, dont know if datalix is reputable enough but it does look good on paper (they want to build an actual business, they are not devs)
@pearl trail i guess you vouch for OVH?
im leaning towards the Datalix EPYC servers right now, but still waiting for the friend to say what they want to do
wait whats wrong with contabo
im one click away
They are german 
last benchmarks i saw from them were not too good, they are very cheap so you just have more cores, but per-core performance and also their ssds were not the best
but might be different now
i still remember their old website, used to be so bad xD
website from early 2000s
ohh now they got a new website and panel and everythingive just gotten. 48GB ram and 12cpu from them i think
if it works it works
thats a beast regardless xD
all my vps's are ~5 usd/eur ones
my Ampere Altra Q80-30 server should be ready in max 2 weeks, very excited to benchmark
ayyy
sadly I was only able to buy 16gb ram for now, im not paying the inflated prices (Ill just take 128gb from my epyc)
are you gonna offer hosting?
i dont think you want that with my network speed
xDDDD
apparently this cpu is crazy in multithreading though, even compared to my 7443P and 9900X
which will hopefully make up for the 1000€ motherboard cost...
ahhh fairs fairs
datalix EPYC is sold out @_@
they are also suffering from the ram pricing
cant build any new nodes
for all product lines
since all of them use ddr4
You should read this
(disclaimer, I wrote this)
theyve actually improved with their customer service since now they have a live chat support, plussss...it is what it is, 
Great their customer support has improved, but should a VPS have 2 major outages lasting almost half a day
might not even take 2 weeks after all
I just hope I dont need to buy 100€ import fees again
i think that was before though ? i meann i cant say there are times services might go down and what not, thats like normal id say, so far, i think u for the price i can kinda tolerate it, so far it hasnt happened and they have better plans, theyve really improved iwl ,

Bot stuff done 😄
@harsh nova scam
yeah my friend has been using their dedi and they never get any problem (they use it to host public mc servers with ~300-700 players)
i also use it and it's price is really good for the specs that i need compared to other providers
my friend tried OVH, and got an error while trying to pay lol
banned from hetzner, payment refused from ovh, things are not looking good for him xD
Servers out of stock on Datalix 😔
what crime your friend has committed 💀 joke
War crimes
xD
Hey i have a question regarding being listed on top.gg
my set-up is primarily web-based, my bot has no commands, it simply sits there to gather message timestamps, and user IDs. I'm not sure if my bot qualifies, due to this, can anyone confirm?
document the main feature, ideally you'd still have a help command that links to the dasboard or give information about the bot
ah, this makes sense thanks
it was the cheapest one you could get for x86, dont know the plan name now because its deprecated
no ukranians allowed on hetzner
well, not sure, but he is ukranian, maybe vps companies think hes a hacker
ye hetzner is annoying to use outside of germany
Ive never had to provide any identification in 2 years
is it CX23? if yes, delete it an remake it until you get an AMD cpu
you can get either cpu, but intel always has worse perf than amd
why is there always so much lore to these cheap hosts
Holy scam
its funny but this is true for a lot of hosts out there, if they make no guarantee of which cpu you get, that means its a mixed hardware pool, and you get wildly different performance results depending on your luck lmao
well that was quick
i reported this exact same casino scam site to cloudflare, absolutely no action was taken
Well they won't do anything if they are using them as a proxy only
i would try this but moving everything over on my server again might be hell
so like 90% of the reason people use cloudflare? 😭
yeah not worth moving an existing server for little gains, but for the future if you're ever gonna get a new one, always check perf first and if bad, delete and remake xD
nice
oof
get some swap
memory is fine
1gb swap should be fine
instruction list for free ram
sudo fallocate -l 2G /swapfile || sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab
sudo sysctl vm.swappiness=10
echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf
disk is easy to get more no? you should be able to increase your disk size for a few cents more
download more ram
I dont think so
I can buy block volumes but too slow for db
zram >>>
my swappiness is at 60, what does reducing it to 10 do?
zram is a life saver
barely touches performance and usually over 50% compression ratio
NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 zstd 46G 41.2G 18G 18.2G 24 [SWAP]
i think a lower swappiness makes the kernel much less likely to use swap and only use it when memory pressure is really high up to a critical point
otherwise with higher i think it swaps earlier but not sure
nice
might try it for a low memory server but for my hetzner vm im not even using all of it for multiple services
i think android uses zram too
nice, i prefer zswap, but zram is also cool
I mean even on lowest settings its going to be insanely effective
due to all the padding in modern programs
but i think the compression ratios you get will depend on what kind of stuff your programs are storing in memory
if its primarily zeroed buffers or predictable bytes it will probably be much better than disk swap
indeed
especially because the decompression reaches over 9GB/s easily
so even if it doesnt have a high ratio, it wont slow stuff down more than a few %
so never bad to have
9 gigaroonies?!
you're using zram as half of your physical ram?
i've seen people say that you can safely set zram to double/triple your physical ram lmao
I don't trust it that much yet
i've spent the past hour reading all sorts of articles on zram, zswap and what not lmao
testing it at 1.5x ram right now
the interesting/tricky part is that zram only cares about logical memory, ie if your zram is 2gb, its 2gb uncompressed, even if the actual compressed data only uses 10mb ram, zram will simply refuse to compress more data
thats the reason you can set it to 2x safely
so your actual ram usage for 2gb physical + 2gb zram (with 100x compression ratio, hypothetical) would be 1980mb + 20mb compressed
What is the best hardware for a bot that has every feature a server needs, like music and most Mee6 and Dyno features?
literally anything from the last decade until it's big
Every server dosen't need music also music features have become very annoying 3rd party wise so you shouldn't deal with that headache
is there still no properly maintained rust library for yaml with serde ?????
I mean the current ones work but why does noone have a maintained one
@solemn latch
tyty
i try and run it on my old thinkpad
because json 🔛 🔝
what do you mean you aren't obscuring your app configuration behind 20 undocumented environment variables
people still make music bots? those are such a heavy mess to maintain since youre sort of implementing a mini scale music streaming platform.. with discord's quirks
on top of that no local caching like spotify can so you have to stream constantly
I just use ytdl and FFmpeg it's not that hard.
Yes, breaking ToS is not hard
i wonder how windows swaps memory. i used to reach >70gb swap on 32gb ram when i ran ai models
i dont know anything other than that it has a system-managed swap file by default
and we would often configure it to a fixed prealocated size to prevent it from dynamically resizing the swap file, because slow as fuck on HDDs
xDdd that’s why old laptops with small ram + hdd often find their disk is at 100%
i didnt say it was hard its just not scalable or efficient
windows in general dies on hdds
they really havent optimized ntfs for hdd use at all
ext4 handles hdds much better mostly since it actively tries to prevent fragmentation while ntfs just dumps parts of files anywhere where theres free space on the disk
Thats true
good old era of defragment your pc to improve performance
cool
you can run YABS or something but its for sure gonna be a beast

So apparently I submitted my privileged intent request incorrectly and referred to the wrong API endpoint (get guild member vs list guild members). Since I technically don't need this right now (still WIP), can I disbale the intent but still get approval for it the same way, or do I need to request it a different way? 👀
yeah im fairly sure you can request an intent later on once you have a use case
but once you have it you cant disable it (not that youd probably want to anyways)
You can also exclude the privileged intents from your gateway identify at no consequence
I broke typescript
Is that what happens with strict mode off
sigma boy
😄 🔫
import sigma 😭
sigma boy
im actually unsure if this is brainrot or math
its brainrot in this case
a friend of mine (same guy that was banned from hetzner and ovh) said his website is broken and the css is all screwed up, and asked me to help fix it
turns out someone changed the main css file and broke it by adding "na" at the beginning of the file, im guessing by accident? or some AI did it? idk
literally first line was changed from @import ... to na@import ... and turned the entire css file invalid lmao
🙏 still waiting for this feature https://github.com/microsoft/TypeScript/issues/32063
I have had this happen before by like typing in the wrong file and not noticing if it was something like that?
guys ussaly how many minutes will it takes that discord uplaod / global slashcom?
use ctrl + r to restart the discord client and is uploaded
After they're synced, Ctrl R discord and they should be there
Pog added friends, requests, ignored and blocked
I'm also adding friend flags for important (bypasses do not disturb notifications) and pinned 😄
I got accepted 🤞👍
@cunning current
@quartz kindle
ayyyy
you guys saw nvidia's new cpu? or rather "gaming cpu"
wa
they do?
Nvidia has confirmed the development of its first desktop CPUs, the Nvidia N1X and N1, which are based on the Grace Blackwell Superchip (GB10) and will be integrated into mini-PCs, notebooks, and KI workstations.
The Nvidia N1X, featuring 20 ARM cores (10 Cortex-X925 and 10 Cortex-A725) and a Blackwell GPU, delivers a PetaFLOP of AI performance and supports up to 128 GiB of LPDDR5x system memory.
These processors are expected to launch in devices running Windows 11 on ARM and Linux later in 2025, though a traditional desktop form factor is considered unlikely.
https://www.nvidia.com/de-de/products/workstations/dgx-spark/
I guess?
not sure if tims referring to these
visiting nvidia page for my country ❌
translating the nvidia page ✅
since hosting is a big topic here:
- i currently host my bot and dashboard on a raspberry pi.
downside: therefore if anyone is mildly tech literate they can find my IP
upside: the location for IP isnt that exact and ive shared general location in other servers so its not a big deal
**question: **is there a way to host the dashboard in a way on eg. oracle cloud free that doesnt show my ip?
all of it routes back to a py file integrating via ipc smth into my main bot
i have no clue how it works but it does, sooo if you have questions feel free?
upside: they can see that you used a based ISP
you could use cloudflare tunnels
^
or route through cloudflare with ddns
and make it so that the webserver can only be accessed through cf ips
benefit of cf tunnels: you dont even need to port forward
ill look into that, thank you
define based
Zen are cool
oh yeah
i get pretty good speeds
the fact then therefore you can see that is the issue i want to prevent
i will keep dreaming of fiber
downside is the plan is up to, not guaranteed
planning to get some ubiquiti gear towards the new year psobs
smh
ye these
do i want to publish an application to the Internet or connect a private network?
assuming the latter?
alright im at https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/private-net/cloudflared/connect-cidr/#2-set-up-the-client fun times
ts too complicated
tomorrow
Living in this hell while u guys get arnd 1gb
Ha, what a nerd. Snowflakes falling. I laughed tho lmao
haha i had a smirk on my face when i saw it too
bruh
get one of these next year xDDD
looking good
const id = String(lowerRange + i);
if (id.length % 2 === 0) {
const mid = id.length / 2;
const left = id.slice(0, mid);
const right = id.slice(mid);
if (left === right) {
totalWrongIds += parseInt(id);
continue;
}
}``` this is part of my solution for advent of code today, it works no issues, but looking at it is just kind of looks ugly and I was wondering if anyone knows of a better way to do this
what is it supposed to do?
I just did
ranges
.into_iter()
.flat_map(|(start, end)| start..=end)
.filter(|&n| {
let s = n.to_string();
let (l, r) = s.split_at(s.len() / 2);
l == r
})
.map(|n| n as usize)
.sum()
basically you're given like
"99-111" and that's a range so 99, 100, 101 etc you have to check if any number is just made up of a repeat, so like 99 is just 9 and 9 or 1111 is 11 and 11 or 12341234 is 1234 and 1234 etc, so i turn the number into a string, if it's even, get the middle number, slice by it, and check if the left is equal to the right
This was the explanation I gave someone else
the part 2 was interesting, did a small google search and magic
const doubled = id + id;
const substring = doubled.slice(1, -1);
if (substring.includes(id)) {
totalWrongIds += parseInt(id);
continue;
}```
Part 2 was easy
yeah
.filter(|&n| {
let s = n.to_string();
let ss = format!("{0}{0}", s);
ss[1..ss.len() - 1].contains(&s)
})
I was wondering if there was something like that in javascript specifcally let (l, r) = s.split_at(s.len() / 2) instead of having mid, left, right, and then the comparison
You probably gotta make a small helper library
Funnily I edited mine before AoC and added ranges parsing 
const id = lowerRange + 1;
if (String(id).match(/(.+)\1/g)) {
totalWrongIds += id;
}
Now today I see ranges, banger
I thought about regex, I know I saw people in the reddit having solutions in JUST regex
that is just regex lul
So getting ranges was just
let ranges = aoc_rs::regex::ranges(&aoc_rs::input::read_file_first_line(
aoc_rs::input::get_path(2, test),
));
I mean, idk if I can remove that if
console.log(
(await Bun.file("input.txt").text() as string)
.split(",")
.map(i => i.split("-"))
.reduce((acc, [start, end]) => {
for (let i = +start; i <= +end; i++)
acc += +((/^(\d+)\1+$/.test("" + i)) && i)
return acc
}, 0)
)``` i just stumpled upon this
ah it's reading from a file?
makes sense, I just don't have a helper library
yeah, it looks like: 11-99,200-2020,5948-2349832 etc
import * as fs from "fs";
type Line = `${number}-${number}`;
const inputFile = "input.txt";
const fileContent = fs.readFileSync(inputFile, "utf-8");
const lines = fileContent.trim().split(",") as Line[];
let totalWrongIds = 0;
for (const line of lines) {
const [lowerRange, upperRange] = line.split("-").map(Number) as [
number,
number
];
for (let i = 0; i <= upperRange - lowerRange; i++) {
const id = String(lowerRange + i);
if (id.length % 2 === 0) {
const mid = id.length / 2;
const left = id.slice(0, mid);
const right = id.slice(mid);
if (left === right) {
totalWrongIds += parseInt(id);
continue;
}
}
}
}
console.log(totalWrongIds);
my full solutoin
if you have money to throw, go ahead
