#development

1 messages · Page 10 of 1

civic scroll
#

react

quartz kindle
#

check with dev tools inspect element

#

see if the css is being applied

hard wraith
#

I’m gonna throw up… I hate react because idk why. Just I tried to use it and just cringed.

stuck dawn
#

it has

quartz kindle
#

just looking at it gives me nausea

hard wraith
#

I think that’s my favouritism of php over express

#

And react.

civic scroll
hard wraith
#

Wait I thought react did something different…

stuck dawn
#

doesn't work either

civic scroll
quartz kindle
# stuck dawn it has

play around with it in dev tools, add/remove styles, change colors and sizes, see if the text is actually being affected

civic scroll
#

target the said FontAwesomeIcon element in the DOM

eternal osprey
#

I found the syllabes online, so we are starting with artificial intelligence???

hard wraith
#

I mean the shadow is literally so close to the text you will barely see it.

civic scroll
#

nah

#

it's visible

#

since

#

0px blur

eternal osprey
#

Quarter 1
SOW-BKI135 Introduction
Artificial Intelligence A
(3 EC)

boreal iron
#

damn... sayuri allowed to give css tips again?

hard wraith
#

Ye but if it’s like 1px depending on your screen resolution it might not be visable.

quartz kindle
#

straight to jail

boreal iron
#

aye

quartz kindle
#

right away

civic scroll
#

@stuck dawn also i don't think it applies to the text itself if said FontAwesomeIcon doesn't resolve to only one span element

stuck dawn
#

like the only way is to use filter: drop-shadow

#

but it doesn't give a solid

civic scroll
#

you have to find the actual element that renders the text

stuck dawn
#

color

civic scroll
hard wraith
civic scroll
#

texted font element

hard wraith
#

Wouldn’t it just be shadow?

civic scroll
#

text-shadow

hard wraith
#

I’ll try with mine… cus that should work.

quartz kindle
# stuck dawn wyd?

check the html side of the element inspector, see how the element is actually rendered

civic scroll
#

in my case it worked

hard wraith
#

Like text-shadow: 1px 1px #000; should work.

civic scroll
civic scroll
#

we don't know what FAontAwesomeIcon resolves to

#

either a collection of components or single span

quartz kindle
#

FAont is awesome

civic scroll
hard wraith
#

It’s <li>

quartz kindle
hard wraith
#

Fontawesome uses li

civic scroll
#

why list item

#

w

boreal iron
#

damn... tim's trolling is on point today

quartz kindle
#

i have a huge svg project coming soon

hard wraith
#

Idk it’s in their docs

quartz kindle
#

gonna be annoying af

civic scroll
#

@stuck dawn can you find it in the dom btw, if that code you use happens to be a library

quartz kindle
civic scroll
boreal iron
civic scroll
#

i had to write the svg commands from scratch

#

💀

#

for a whole logo

quartz kindle
civic scroll
#

even aurel died watching me writing them

quartz kindle
civic scroll
#

if it's written in react / angular

quartz kindle
#

im writing svg with text templating

#

in js

civic scroll
#

vanilla sure

#

totally fine

boreal iron
civic scroll
#

since my upcoming university's web dev class

#

is probably gonna teach vanilla anyway

civic scroll
#

ballin rn

drifting kelp
#

is it even necessary to add moderation commands?
i just noticed you can do it in discord itself to ban or kick users via slash commands.

civic scroll
civic scroll
quartz kindle
civic scroll
#

cool

#

maybe this is my opportunity to play with svelte

boreal iron
stuck dawn
#

like i am new to this so idk how i can check how it is rendered xD

quartz kindle
#

how much would you charge if i hired you?

#

xD

stuck dawn
#

yes

drifting kelp
boreal iron
civic scroll
#

@stuck dawn

#

then

quartz kindle
civic scroll
#

you click on the element that you want to inspect

boreal iron
#

rich bitch

quartz kindle
#

yeah why do you thing im asking

#

because i cant really pay much lmao

boreal iron
#

imagine paying 2,4k taxes

civic scroll
stuck dawn
#

what i am supposed to see? the svg attributes?

civic scroll
#

do you have the site live somewhere by the way

#

OH wait

#

since you are developing in react

#

do you have react devtools

stuck dawn
#

no but i can install it

civic scroll
#

install it in chrome plugin market

quartz kindle
civic scroll
stuck dawn
quartz kindle
#

but well have something to start with

#

and can navigate through the html if needed

stuck dawn
civic scroll
stuck dawn
#

ok..

boreal iron
#

should literally be f12 in your browser

stuck dawn
civic scroll
#

okay

civic scroll
#

click on the "<>"

#

then screenshot me the entire element

#

oh

#

wait wrong button

stuck dawn
#

ok

civic scroll
#

click on the eye icon

#

i forgor

stuck dawn
civic scroll
#

those are svgs

#

you can't apply text on em

quartz kindle
civic scroll
#

which means you can only use either filter shadow or box shadow

stuck dawn
#

:|

quartz kindle
#

you can use filter drop shadow

civic scroll
#

OR, outright insert svg shadow filter

#

feGussianBlur and all that stuff

quartz kindle
#

example ```js
svg {
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
}

civic scroll
#

what is this division

#

ah opacity

stuck dawn
#

how i can use that

#

but

#

give it a solid color

#

like if i use that i has blur

#

and i can't remove it

quartz kindle
#

0.4 is opacity

civic scroll
#

see this shadow edge

quartz kindle
#

change it to 1 to remove transparency

stuck dawn
#

it looks bad i want to look similiar to the other text

civic scroll
#

so i would use the filter if i were you

#

can't believe i had to define this myself

civic scroll
#

but blurred right?

stuck dawn
#

no

#

not blurred

#

a solid color

civic scroll
#

only outline

stuck dawn
#

like the text

civic scroll
#

you can use border

#

or stroke-width and stroke-fill and fill in this case of svg

stuck dawn
#

like this?

civic scroll
#

@stuck dawn OKAY

#

i have an idea

#

try this

#

in css

#

what's the id of the element

stuck dawn
#

i can just apply to all of them by using the div

civic scroll
#

can i ask

stuck dawn
civic scroll
#

for the element id

#

alright

stuck dawn
#

xD

civic scroll
#
.phone-header-icons g g path {
  stroke: black;
  stroke-width: 10;
}
stuck dawn
#

doesn't work :(

civic scroll
#

oh wait i haven't seen how many layers it's encased in

civic scroll
# stuck dawn

you can remove the --webkit-stroke-fill property, the transpiler will polyfill that in for you

civic scroll
#

then let it be that way then

stuck dawn
quartz kindle
#

@civic scroll u're a pro, rate this svg

civic scroll
#

bro 💀

civic scroll
stuck dawn
civic scroll
#

gimme a moment

civic scroll
stuck dawn
#

it looks like this

#

looks a little scuffed

#

even if you increase stroke width

quartz kindle
#

when you open an old js project after you enable strict type checking for js in vsc

civic scroll
#

@quartz kindle gimme a moment to optimise the screenshot code btw

boreal iron
#

god bless notepad++ for missing all this crap

quartz kindle
boreal iron
#

quite nice tbh

stuck dawn
#

wtf

#

that's so cool

quartz kindle
#

this was a commission i made for someone 2 years ago

#

but im gonna use part of this code on my thing too

boreal iron
#

a bit hard to see the triangle borders for similar colors

quartz kindle
#

yeah, all colors are customizable via css

#

and radiuses/sizes via js

boreal iron
#

does this like tell you the future? :P

#

like reading my hand

quartz kindle
#

sort of, but no

#

there are many things that can be read from charts like these

#

the most common use is to tell you about your personality, what to do to be happy and what to avoid

boreal iron
#

yikes, better not

quartz kindle
#

but you can also use it to see why something is happening with you at a specific moment

#

or why something happened the way it it

boreal iron
#

xD

quartz kindle
#

and of course you can try to plan your future with it

#

but things often dont quite work as you would expect when you try to control it too much

#

@civic scroll question, i have a font file made with one of those font creator softwares, that contains the icons and symbols for these charts, is it a good idea to use it as a font in svg? or should i try to convert the symbols into svg paths/objects and use that instead?

civic scroll
#

just specify correct unicode chars

quartz kindle
#

yeah thats what i did

civic scroll
#

i do use text and so far no issues

quartz kindle
#

i want the symbols to be customizable via css, but i was also thinking about letting the user change them into custom symbols

#

but thats a bit tricky if the symbols come from a font file

#

like if a user wants to upload a png of a symbol, i have no idea how to enable it for use in the svg

civic scroll
#

it's not a concern if the code matches

#

oh

#

that

quartz kindle
#

i might have to force the user into providing an svg-compatible path or something

#

instead of an image

civic scroll
#

you can specify something like uh how you would use images

#

you can still display images in svg

#

convert it into base64 dataurl

quartz kindle
#

but they wouldnt be css'able, like color and stuff

civic scroll
#

mmm

#

for that use filters

quartz kindle
#

hmm

civic scroll
#

hue-rotation, saturation, brightness

quartz kindle
#

good idea

#

but then there is still the issue of scalabillity

civic scroll
#

that's inevitable tbh

quartz kindle
#

welp, i'll see to it when i get there

#

in like 3 years at the current pace

#

:^)

civic scroll
civic scroll
quartz kindle
#

most path tracers are garbage tho xD

civic scroll
#

lmao [object Object] transition

quartz kindle
#

xDDD

vivid fulcrum
civic scroll
# quartz kindle <@520964894279860224> u're a pro, rate this svg

tim here's the result of hell optimisation

// ...

svg += '<g class="planets chart1">';
chart1 = this._correct(chart1);

for (const planet of chart1.planets)
{
    let { name, longitude, drawPosition, sign, house, speed } = planet;
    let h = highlight ? (highlight[0] === name || (highlight[1] === name && !chart2)) : false;
    let [sin1, cos1, sin2, cos2] = [longitude, longitude, drawPosition, drawPosition].map((v, i) => Math[i % 2 ? 'sin' : 'cos'](v * Math.PI / 180));
    let {
        glyphPosisition: r1,
        degreePosition: r2,
        lineStart: r3,
        lineEnd: r4,
        helperStart: r5,
        helperEnd: r6
    } = conf.planets;

    const notEmptyString = v => !!v;

    svg += [
        '<g class="',
        name.toLowerCase(),
        Object.keys(glyph.signs)[sign].toLowerCase(),
        house ? ` house${house}` : "",
        h? "highlight" : "",
        '"',
        `data-longitude="${longitude}"`,
        `data-speed="${speed}"`,
        '>',
            [...[
                `<path d="M ${r3 * sin1} ${r3 * cos1} L ${r4 * sin1} ${r4 * cos1}"/>`,
                `<path d="M ${r5 * sin2} ${r5 * cos2} L ${r6 * sin1} ${r6 * cos1}"/>`,
                `<text x="${r1 * sin2}" y="${r1 * cos2}" dominant-baseline="central" text-anchor="middle" font-family="A">${glyph.planets[name]}</text>`,
                `<text x="${r2 * sin2}" y="${r2 * cos2}" dominant-baseline="central" text-anchor="middle" font-family="san-serif">${(longitude % 30).toFixed(0)}</text>`,
            ]],
        '</g>'
    ]
    .filter(notEmptyString)
    .join(' ')
};
svg += '</g>';
vivid fulcrum
#

besides exploding inspect element

civic scroll
#

normally it would be a way if i want to preload the image

#

then put it in svg

civic scroll
quartz kindle
#

xD

earnest phoenix
#

I am building a docker panel(cluster->server->container)..

So currently building/coding the permission system
As db , I am using mongodb

const user = new Schema({
    email: String,
    id: String,
    admin: Boolean,
    roles: Array,
    accessToken: String,
});

const role = new Schema({
    name: String,
    description: String,
    permissions: {
        cluster: {
            read: Boolean,
            write: Boolean,
            delete: Boolean,
        }
    }
})

What would be the best way to link the role to user.roles
I heard about subdocument , but hopefully somebody has an efficient/better approach

civic scroll
#

but if you want you can

#
const role = new Schema({
    name: String,
    description: String,
    permissions: {
        cluster: {
            read: Boolean,
            write: Boolean,
            delete: Boolean,
        }
    }
})
const user = new Schema({
    email: String,
    id: String,
    admin: Boolean,
    roles: Array<role>,
    accessToken: String,
});
#

iirc

#

or you can use Array<String> as the roles' ids

#

and have the role schema an id field

lone wing
#

I'm testing random bots on a throwaway discord server, and this one doesn't use subcommands concerned

#

volume the music

boreal iron
#

since sub commands are not hidden in the UI yet, it doesn't really matter

#

but this doesn't really look good tbh

#

also maybe people don't even know sub commands exist or how to register them :P

lone wing
#

oh i can't even test it since the bot is offline

ancient nova
#

I thought slash command bots didn't have to be connected to the socket

wheat mesa
#

they don't necessarily

boreal iron
#

yeah they don't have to be

lone wing
#

im trying another bot, they use the same prefix oh no

#

this will be weird

wheat mesa
#

You have to still have a server up to receive the POST requests

boreal iron
#

and to respond to the pings

#

in order to show your app as online

ancient nova
#

I don't use slash commands though

lone wing
#

undefined modshortcuts

#

what

#

wtf these are different bots but the pfp looks the same

#

different creators

#

lol this guy just copied the youtuber

ancient nova
proven escarp
#

@lone wing can you keep all of this related to development and not spam images please? It's kind of annoying for people who want to discuss dev stuff

lone wing
#

sorry

proven escarp
#

damn fr i should apply for mod

lone wing
#

?

boreal iron
proven escarp
#

minimodding is fun 💀

boreal iron
wheat mesa
#

minimodding also against rules

proven escarp
#

😳

wheat mesa
#

which in a way makes me a minimod for saying that

proven escarp
#

omg banned

wheat mesa
#

paradox

proven escarp
#

mini-modception

boreal iron
#

lmao

#

i will enjoy you all getting banned, soon

#

when i'm the last survivor

proven escarp
#

minimodding?!?!??!

cinder patio
#

minimodding is the stupidest rule

boreal iron
#

complaing about rules is also against the rules

proven escarp
#

minimod

boreal iron
#

soon everyone is banned

proven escarp
#

banned

cinder patio
#

you're minimodding

boreal iron
#

was just thinking loudly

proven escarp
#

thinking loudly is against rules

boreal iron
#

tf, let's ban the mods for creating such rules

proven escarp
#

ye

hard wraith
#

I’m using google rn for this, but they charge by number per month… azure charge by X per second…. This would be a good step to change from google to right?

#

It’s a content moderation tool, and should help when the bot scales and it’s moderation system is going with more than 1000 interaction requests a month 😂

#

Idk, do I stick with the google one that’s expensive and has appalling support, or swap to azure that has great documentation, is cheaper priced for scale and I have a support agreement with that can resolve issues normally within the hour?

lyric mountain
#

charge by X per second
excuse me???

hard wraith
lyric mountain
#

ah, understandable

#

I though they charged X per running second

hard wraith
#

I mean look at that

lyric mountain
#

that's a very low tps cap

hard wraith
#

its $2 per 1000 interactions over your first 1000 a month on google tho

#

This is 50% cheaper

#

and then add in my 50% partnership discount with azure...

#

thats $0.50 per 1000 transactions for my first million

lyric mountain
#

why exactly are u using it btw?

hard wraith
#

or if I get 10m+ in the month... its $.20 ever 1000

lyric mountain
#

like, what's a "moderation tool"

hard wraith
lyric mountain
#

can't u just integrate ur bot with the new discord automod feature?

hard wraith
#

Plus this will allow me to filter user input on the commands...

hard wraith
#

I use google to stop pornography being the banner image, this is the same... But cheaper lol

lyric mountain
#

there's someone here that made an image filtering service

#

that uses machine learning to detect

hard wraith
#

This is the same...

#

But it uses azure, who host my bot lol

lyric mountain
#

aren't there options where u don't need to grab the wallet?

hard wraith
#

I just think that once I hit around 1000 interactions on google I should have a cheaper alternative

hard wraith
#

And google works out a lot more at predicted numbers than azure does.

#

Plus 10 tps... I can make a queue on the commands that use it to await a response, meaning I can literally handle millions of requests at 1 second, but over the second it will pop in 10 from the queue and reply

#

So some commands may see the "unusually high requests on this command, please await response, you are position X in the queue" on their slash command response lol.

#

But ultimately I might move the welcome banner config to the website to me more useful and user friendly.

#

Plus this PC is built to work with Azure cus of work lol... It is only logical as I have all the tools to test and fail azure api requests without making actual requests that cost.

lyric mountain
#

u could stay below the 10 TPS limit btw

#

just put a temp image like "Checking banner, please wait" while the request is not made

#

use a queue as u said to send batches

hard wraith
#

Yeah thats what I am doing lol

#

Just need to think if I want to use the website so its cleaner and I don't have hanging slash command interactions.

#

Because then you can have "Welcome banner content being reviewed. Please wait." shown blocking changes to the welcomer config for the guild.

#

Yeah 100% going to change from google because I have already used 100 interactions this month from testing alone lol.

#

And I know with azure they never charge me for test requests.

lyric mountain
#

isn't there a wrapper for it?

#

they generally always release wrappers for mainstream languages

hard wraith
#

Yes this is the node reference

lyric mountain
#

a

hard wraith
#

And the google one for node just showed basic examples and leaves you to figure out what data is returned for image moderation...

#

Azure actually seem to show you the response example lol

#

It only shows typescript tho... I use javascript instead lol

#

Like this... Its kinda better than the google docs. Because it explains a lot more lol

eternal osprey
#

hey i have set my topgg webhookurl to this url myvpsip:3000/dblwebhook

#

but it's telling me that the url is not valid

hard wraith
#

http://myvpsip:3000/dblwebhook

#

never forget the http://

eternal osprey
#

awesome, thank you!

eternal osprey
#

yeah

hard wraith
#

I have an example that might help you better...

#

It works like yours, but it uses /server and /bot to specify the difference between the two vote type

eternal osprey
#

instead of dblwebhook?

hard wraith
#

ye

eternal osprey
#

owhh

hard wraith
#

I customised the code to like detect different things for bots too. So it shows if weekend modifier is active or not lol

#

Feel free to fork and modify it to your needs but I found this more reliable that the example topgg docs gave and IDK why lol

eternal osprey
#

Oowh wow this example is awesome, thank you JCoDog

hard wraith
#

Probably because it handles the incoming request using express req and res instead of the topgg webhook library

#

It is literally an express version of the listener running on my website lol

#

I also think the "idiots guide to deploying this example" is what sets it apart.

digital swan
hard wraith
#

let me ammend

#

This is why I needed it reviewing. I made it early hours this morning on no sleep lol

wheat mesa
#

Yeah it's just fetch, caches have no fetch function

#

they're just enhanced maps

hard wraith
#

cache is .get()

wheat mesa
#

Yup

hard wraith
#

Im aware. I forget when I am tired lol

wheat mesa
#

Fair

digital swan
wheat mesa
#

It's well written, can't blame you for making a small mistake lol

#

I believe the class decl for djs's collection is class Collection<K, V> extends Map<K, V>

hard wraith
#

Check now.

#

Im half tempted to not use the azure content moderation api on node and just write it using my php api handler and make webhook requests to that...

#

Like, then I can sell use of it to other bots lol

#

Meh... I'll have to get it working first lol.

#

This is going to be a huge project lol.

hard wraith
#

I could go for some java rn

#

By that I mean coffee... But Monster energy tastes so good.

wheat mesa
lyric mountain
#

wait, why does is extend map?

#

like, instead of being a map itself

wheat mesa
#

It's just a collection of helper methods for a map

lyric mountain
#

ah

wheat mesa
#

It is a map

#

That's why you can call all the map methods on it

#

But djs (and most libraries) have their own functions because Map doesn't include everything that's convenient to use

hard wraith
#

I feel like I should make a npm package to do my express webhook easier...

#

So a user just does let bot = listener.bot(authtoken) and it just returns an event or somethin...

#

idk... Maybe thats overkill... Considering express works fine as it is lol

lyric mountain
hard wraith
#

LMAO

#

Nah, why would JS have useful features?

#

its just simplified java for web browsers

wheat mesa
#

not really

#

java is to javascript what car is to carpet

hard wraith
#

JavaScript

wheat mesa
#

ham -> hamster

hard wraith
#

I love saying that cus it annoys java devs lol

wheat mesa
#

java devs would not take that slander

#

neither would js devs

#

the war of the titans

lyric mountain
#

tbh js was made to be a layer between browser and java

hard wraith
#

Im a php and node.js dev lol

lyric mountain
#

since everything was using java at that time

hard wraith
wheat mesa
#

I do nodejs with typescript, rust, c++, c#, java, and a little js

lyric mountain
#

and applets were just awful

lyric mountain
wheat mesa
#

my cs teacher thought applets were still a thing last year

lyric mountain
#

applets suffer the same issue as flash

hard wraith
wheat mesa
#

gotta say that rust is fucking amazing

#

the pattern matching + the type system = pure bliss

#

the ultimate langdev language

hard wraith
wheat mesa
#

yes

#

voted most loved language on stackoverflow for the last 7 years or something like that

hard wraith
wheat mesa
hard wraith
#

When being boring is the best compliment you can get

lyric mountain
#

chris dickinson tf

#

that's the worst surname I ever saw

wheat mesa
#

out of its 11 or 12 years of existence, 7 years voted as most loved lang

hard wraith
#

I worked with 5 dickinsons at my last job...

#

It was so hard to resist asking them if they enjoy dicking sons...

wheat mesa
#

also enums in rust are just amazing with the pattern matching it offers

#

very powerful

sudden geyser
hard wraith
#

Its structured like Go

wheat mesa
#

I shit you not there was a kid in my elementary school that was named "Dick Dick"

hard wraith
#

wait is it go or kotlin... or both lol

lyric mountain
#

neither

wheat mesa
#

It's neither C:<

hard wraith
#

IDk... ive used go and kotlin for a total of like 3 hours in my life lol

wheat mesa
#

Rust is focused on fast speeds with pure memory safety

#

And it's also just very focused on safety in general

hard wraith
#

just the println seems similar to kotlin

wheat mesa
#

It's a macro

lyric mountain
#

the only thing I like about rust is that it's not c++

lyric mountain
#

did u ever try groovy?

#

(not the bot)

wheat mesa
#

Rust is by far the best language for metaprogramming imo

lyric mountain
#

probably is, since its direct competitor is the awful c++

hard wraith
lyric mountain
#

and carbon, but it's still a newborn

lyric mountain
wheat mesa
hard wraith
#

I know lol

#

if you notice that reply was to the threat (not the bot) because it made me remember how youtube fucked over rythm

wheat mesa
#

It's just meant to be a more modern option for migrating age-old C++ codebases

#

To be easier to maintain

#

And it's also designed so that C++ devs can easily learn it

lyric mountain
#

I bet dealing with winapi will still be shitty

wheat mesa
#

Any language dealing with winapi is shitty

lyric mountain
#

it feels like them, but wields all the power of java

#

and tbh, ```
5.times {
println it
}

/*
prints:
0
1
2
3
4
*/

loops are the best part
wheat mesa
#

wdym you don't like rust's macro syntax?? ```rs
macro_rules! add{
($a:expr,$b:expr)=>{
{
$a+$b
}
};
($a:expr)=>{
{
$a
}
}
}

#

:troll:

lyric mountain
#

tf

wheat mesa
#

The best part about macros in rust is that you can extend the language syntax without needing a whole compiler update

#

That's what allows async/await to be in rust without needing anything special on the compiler's end

#

Also I forgot to mention that Result<T, E> and Option<T> are absolutely amazing in rust as well

#

And the lack of a "null" existing is nice too

#

I've only been doing rust about 1-2 months now, and I already think it's the best langauge I've ever used

lone wing
#

Am i calculating my resource usage wrong? My bot is in about 8 servers and it's only using 40mb

#

it's discord.js

#

with regular old node

wheat mesa
#

How are you calculating it

#

Because that's likely the wrong value

hard wraith
#

Well I just spoke to an api maker and he told me that for what I need to do, I should be using CURL instead of the node library azure gave me. That is going to make things so much easier just being able to make rest api CURL requests

wheat mesa
#

Node itself usually takes more than 40mb

hard wraith
#

ill be able to define all the methods how I want to define them and customise the responses perfectly!

lone wing
#

the % is just /512mb since that is heroku mem usage limit

hard wraith
#

Wait...

#

why are you dividing by /1024 twice?

wheat mesa
#

it gives mem usage in bytes

hard wraith
#

Yeah... why not handle it in mb?

lyric mountain
#

?

#

B, KB, MB

hard wraith
#

yeah...

lyric mountain
#

well, technically, yes

lone wing
#

hold on im gonna locally host the bot temporarily and see memory usage

wheat mesa
#

memUsage.rss is usually more accurate

hard wraith
#

but if you know your mem is 512 mb, why waste time converting both to bytes when you can handle both in mb?

lyric mountain
wheat mesa
#

since that's the Resident Stack Size, which is how much the process is currently taking regardless of if it's using it or not

lyric mountain
#

you need to convert to mb

hard wraith
#

ohhh

#

right nevermind I confused myself...

lyric mountain
#

the 40 MB is where they're doing the calculations

gaunt sierra
wheat mesa
hard wraith
#

But what happens if you have 1tb memory?

lyric mountain
#

it's probably that, most runtimes do that

wheat mesa
#

Because even libless I can't really get a gateway connection open under 40mb of ram

lyric mountain
wheat mesa
#

(In node)

lone wing
#

resource usage is actually pretty accurate

hard wraith
#

Dont ask how, but there are servers at ibm for banks with terrabytes of memory.

lyric mountain
#

those are multi-machine environments

wheat mesa
lyric mountain
#

not a single TB ram stick

hard wraith
#

The code isn't accounting for the fact that you can upgrade and downgrade total memory

#

like you could go from mb to gb, then you have to change your code

wheat mesa
#

Learn a programming language, find a specialty, then get good at it with many many many hours of practice

lone wing
#

the rest are the powershell processes

wheat mesa
#

Hmmmm

#

Are you caching anything?

lyric mountain
#

you see, you can't learn "how to become a dev", you learn how to think abstract and see things as a bunch of smaller parts

#

the rest is google

lone wing
wheat mesa
#

That's probably why

lone wing
#

although i did update my config system to only load what is needed

hard wraith
#

LMAO putting dev like that makes us out to be nothing special...

#

Like ouch...

wheat mesa
#

You should probably be using RSS, not heapTotal

lone wing
#

alr

wheat mesa
#

For a more accurate count

lone wing
#

Isn't that just allocated memory though

hard wraith
#

My entire career is based around being a DevOps Engineer and it being seen as a title of great stature due to the hours of schooling in the field and certification exams...

wheat mesa
#

That's how much the process is taking up regardless of whether it's using it or not

#

Resident Stack Size

hard wraith
#

And you just put how the indepndent leaning of the Dev asapect goes like that... Just removed that "special" factor.

lone wing
#

ok yeah then it jumps up to 90mb

wheat mesa
#

If your machine needs it, it can free some of that RSS

spark flint
#

gamers

wheat mesa
#

But usually it keeps a little more than it needs, just in case

spark flint
wheat mesa
spark flint
#

which is java

wheat mesa
#

It's usually going to be quite larger

spark flint
#

how tf do i import that into my code

wheat mesa
#

haha

hard wraith
wheat mesa
#

Well, you can use a dependency manager like gradle or maven

lone wing
#

you learn java

wheat mesa
#

Or you can download the jar file

spark flint
#

this is my first time using java and i don't understand it

wheat mesa
#

And import it into your project

#

Which will differ based on the IDE you're using

spark flint
#

no

lyric mountain
#

oh wait, forgot to reply

hard wraith
lyric mountain
#

like, when you see an apple you say "It's a fruit", while we say "It's a round eatable object, with a sweet taste and crunchy texture. It's color is red with small lighter strokes. On the top of it there's a brown, slightly bent stalk."

spark flint
#

yeah but idk how to

hard wraith
#

Like sheesh...

spark flint
#

thats the point

hard wraith
#

CURL!

spark flint
#

i don't understand java and i struggle to learn new things

wheat mesa
#

Have you ever used Java before?

spark flint
#

once

wheat mesa
#

It might be easier to start with some easier projects

hard wraith
#

Literally google how to make a CURL request to REST APIs in your language

wheat mesa
#

Like console projects

spark flint
wheat mesa
#

Dependencies in Java are one of those things that kinda suck

quartz kindle
#

jabba

wheat mesa
#

I'm sure kuuhaku will correct me on that

lyric mountain
#

@spark flint what lib?

spark flint
lyric mountain
spark flint
#

which is a much easier way to use webhooks

lyric mountain
#

u want to make raw requests?

#

HttpUrlConnection then (has an Https alternative)

#

although I do recommend using Apache's HttpClient

spark flint
#

i don't really wanna make raw requests

#

i like making my life easy and using modules/dependencies

lyric mountain
#

then just use that

#

what's the issue?

spark flint
#

idk how to import it 🗿

lyric mountain
#

maven or gradle?

spark flint
lyric mountain
#

...

spark flint
#

ah this is gradle

#

i'm literally blind

hard wraith
spark flint
#

bro

#

this is java

wheat mesa
#

I hate gradle

hard wraith
#

then discord java

spark flint
hard wraith
#

there is a discord java library

spark flint
#

yeah fuck this shit i'm out

lyric mountain
wheat mesa
#

kuuhaku is a java expert

lyric mountain
#

put in build.gradle

lyric mountain
hard wraith
#

im gonna go work on my azure package

wheat mesa
lyric mountain
#

if u still use the old format: implementation("the.group.name:lib-name:version")

lyric mountain
#

or my bot's helper file?

wheat mesa
#

your bot's helper file

#

the like 500 static functions lol

lyric mountain
#

yeah I split that thing into separated categorized files

wheat mesa
#

another example of rust's insane pattern matching and error handling

lyric mountain
#

that looks a lot like java's switch

wheat mesa
#

It's essentially a switch statement but it requires you to cover all possibilities, and also gives you enum variant pattern matching

lyric mountain
#
return switch (token.token_type) {
  case TokenType.Minus -> // stuff
  case TokenType.Not -> // stuff
  default -> // stuff
}
wheat mesa
#

In java for the same thing I would be using the visitor pattern which is far more annoying and basically makes it so you have to verify the types yourself since java can't do it for you at compile time

lyric mountain
#

not on jdk 19

#

they're fixing that on next release

boreal iron
#

Java again Waffle?

wheat mesa
boreal iron
#

Thought you got rid of your demons

wheat mesa
#

See how much casting you have to do

#

Since it's not technically type-safe

#

Whereas I never cast a single time in the rust version

#

I also much prefer using Result<T, Err> for errors instead of throwing them

#

Makes it so you never have an unhandled error (Unless you do something stupid like an index out of bounds on a vector or something)

#

Even then you can handle that because Vec<T>.get(index) returns Option<T>, so if it's out of bounds, then it'll just give you a None value

#

But using the direct indexing operator will cause a runtime panic if it's out of bounds

sudden geyser
#

I like the concepts of Rust but don't have a use for the language myself.

#

though I have mixed feelings about Option<T>

wheat mesa
#

Result and Option are godsends

#

Since you're guaranteeing the compiler that you're handling all of the possibilities at compile time

#

Which ofc you can bypass if you know exactly what you're doing

sudden geyser
#

Yes, but if you later change your code to always return T, that's considered a breaking change, which is annoying.

wheat mesa
#

Like this is unsafe and can definitely cause a panic at runtime, but I know that it won't happen because the way I'm writing code guarantees that when I call this function I am never out of bounds

wheat mesa
#

Which in most cases doesn't change

sudden geyser
#

I'm talking about if you go from Result<T, E> or Option<T> to just T, or the other way in some contexts.

#

i.e. you change your code

wheat mesa
#

I know, I'm just saying that's a very rare occurrence

#

Either way it's still a relatively easy change to handle

sudden geyser
#

Not really

#

If you're maintaining a library (though can apply to applications) and that happens, that sucks as it's a breaking change

wheat mesa
#

It's like if you changed a function from being noexcept to being able to throw in C++, you'd have to wrap calls to it in a try/catch

sudden geyser
#

If you go from T to Result/Option, then yeah, that's good. But the other way around, not so much.

wheat mesa
#

I suppose, it's not a huge deal in reality though. That doesn't happen very often

#

And you could just keep it as that return type, just never return None or Err

#

I'm sure there's some way around it that I haven't figured out because I'm still not too experienced with rust

sudden geyser
ancient nova
#

if you compare snowflakes do you use a strict === or a normal == equals operator?

sudden geyser
#

I talk about it because when you're confronted with:

fn identity<T>(value: T): Option<T> {
  // ...
}

And decide that value should now be optional, that's a breaking change, as you have to change T to Option<T>, despite you not "really" doing something wrong. The same is true if you decide to change the return value to just T and change the code to reflect that internally. Callers of identity now need to update their code to get rid of the potential None checking beforehand, which, again, is not "really" your fault. That's one basic issue I have with it, as it makes breaking changes unnecessarily more common.

ancient nova
#

I've gotten kinda confused with this

wheat mesa
ancient nova
#

one second I'll send you the code I'm writing

wheat mesa
#

It shouldn't really matter tbh

lyric mountain
#

for js you almost ever want to use ===

wheat mesa
#

But yeah

lyric mountain
#

most IDEs will tell u that too

wheat mesa
#

That

#

I mostly use == because I'm a cultured typescript man myself

ancient nova
#

@wheat mesa sorry took so long I was writing another feature for this code```js
// Lets now write some code for our Afk System Module.
// First we check if it's enabled, then we check if the person typing is AFK.
if (settings.afkSystem === "true") {
// And now lets define our afkCache Collection again.
const afkCache = container.afkCache;

    // Now lets define whoever was mentioned.
    // If there is, lets now continue the code, else stop.
    const mentionedMember = message.mentions.members.first();
    if (mentionedMember) {
        // And now lets actually check if the person mentioned is a person with an AFK status
        // If not, again we will ignore it.
        const afkData = afkCache.get(mentionedMember.id);
        if (afkData) {
            const [ timestamp, reason, guildId ] = afkData;
            // We check if the afk was from the guild the person was mentioned in.
            // ( We do not want the afk system to be cross guild, as some guilds may have disabled their AFK modules)
            if (guildId == message.guild.id) {
                
            }
        }
    }
}
#

not even sure if the code works since I haven't tested it

#

and sorry for the thousands of comments lol

wheat mesa
#

I would just use ===

#

In js you usually need to use ===

#

In typescript it's not much of a problem because you know what types they're going to be

digital swan
#

has anyone heard anything about the massive embeds 😢

spark flint
#

yes

#

its a discord bug

#

well not bug

#

a "fix" to a bug

boreal iron
#

Bug or feature

#

You never know

ancient nova
#
    // Lets now write some code for our Afk System Module.
    // First we check if it's enabled, then we check if the person typing is AFK.
    if (settings.afkSystem === "true") {
        // And now lets define our afkCache Collection again.
        const afkCache = container.afkCache;
        
        // Now lets define whoever was mentioned.
        // If there is, lets now continue the code, else stop.
        const mentionedMember = message.mentions.members.first();
        if (mentionedMember) {
            // And now lets actually check if the person mentioned is a person with an AFK status
            // If not, again we will ignore it.
            const afkData = afkCache.get(mentionedMember.id);
            if (afkData) {
                const [ timestamp, reason, guildId ] = afkData;
                // We check if the afk was from the guild the person was mentioned in.
                // ( We do not want the afk system to be cross guild, as some guilds may have disabled their AFK modules)
                if (guildId === message.guild.id) {
                    message.reply(`${mentionedMember.user.tag} is AFK!\nReason: ${reason}\nSince: ${timeAgo(timestamp)}`);
                }
            }
        }; const afkData = afkCache.get(mentionedMember.id);
        if (afkData.get(message.author.id)) {
            const [ timestamp, reason, guildId ] = afkData;
                if (guildId === message.guild.id) {
                    afkData.delete(message.author.id);
                    message.reply(`${message.member} Welcome back!\nI've removed your AFK status for you :thumbsup:`);
                }
        }
    }
``` do you guys think this is good enough? (First time writing an AFK system)
#

let me know if I missed something important

wheat mesa
#

I have some complaints about the code style

quartz kindle
#

are you still storing true as a string?

boreal iron
wheat mesa
#

That too

ancient nova
#

btw

#

Cannot read properties of undefined (reading 'set')

    // Grab the settings for this server from Enmap.
    // If there is no guild, get default conf (DMs)
    // Also prevent people from using the afk command is the afk system is not toggled on.
    const settings = message.settings = getSettings(message.guild);
    if (settings.afkEnabled !== "true")
        return message.channel.send(`The AFK system appears to be disabled! To enable this module please run \`${settings.prefix}set edit afkEnabled true\``);
    
    // With that done, lets now get our afkCache Collection from our *client* object.
    const afkCache = client.afkCache;
    
    // And now lets define the variable we will use as the "reason" for the AFK status.
    const reason = args.join(" ") || "No Reason";
    if (reason.length >= 256) return message.channel.send("You can't have a status that's longer than 256 letters!");
    
    // And now let's set or update our current AFK status
    afkCache.set(message.author.id, [
        message.createdTimestamp,
        reason,
        message.guild.id
    ]); return message.channel.send(`Done :thumbsup:\nYour AFK status is now set to: ${reason}`);
``` any ideas?
boreal iron
wheat mesa
#

inb4 "why is my memory usage so high"

boreal iron
#

100%

ancient nova
wheat mesa
#

yeah that's totally gonna stay at 40mb when you have to cache all those true/false strings

#

granted v8 is probably smart enough to have a string pool

#

and just assign pointers to those strings

earnest phoenix
#

40 year old C/C++ programmers looking at this storing a 1 byte value as 4-5 bytes every time be like

quartz kindle
#

still its 8 bytes for a pointer vs 1 byte for a bool

#

but realistically it will make zero difference

wheat mesa
#

I feel like it would make quite a difference at scale

quartz kindle
#

at scale yes

#

but thats kinda highly unlikely

#

:^)

wheat mesa
#

KEKW damn

lament rock
#

the problem with memory de-duping without knowing dev intent, when they mutate the string, other instances could just be like… Yeah uh what?

quartz kindle
#

strings are immutable tho

wheat mesa
#

^

#

Java does the same thing with a string pool

lament rock
#

Ah okay now I see that the new string would be alloc'd and pass pointer

wheat mesa
#

Since they're immutable none of them are really shared references, they all just point to the same string until they don't

quartz kindle
#

until they point'nt

lament rock
#

gc go brr

#

I need manual memory management in js

ancient nova
#

I fixed that

lament rock
#

yes ik I could just use c, but like no

wheat mesa
#

c is kinda yucky

#

segfaults are boring to debug

quartz kindle
ancient nova
#

for some reason I could only store strings in a discord.js collection otherwise it would return undefined when trying to get them

#

which made it buggy

lament rock
lament rock
#

time to somehow cache entire classes in Buffers

quartz kindle
#

i actually have a project like that

#

but its kinda shelved atm

wheat mesa
#

Write your own js parser that is run on js buffers

quartz kindle
#

but i plan to make a buffer-storage

wheat mesa
#

I don't know what you were using to store them before that, but there is virtually no difference between a collection and a map, since I assume you were using a map

boreal iron
#

I was at least by 2763 so far…

earnest phoenix
#

Never ask a developer how many projects they've finished so far

wheat mesa
#

like 8

#

something like that

quartz kindle
#

not many tbh

wheat mesa
#

whatever is public on my github and doesn't say "WIP"

#

Ok it's like 6 projects

#

lmfao

#

including some private ones that I'm done with

quartz kindle
#

just that the projects i have shelved/planned are so painful

boreal iron
#

You need to choose easier projects then

wheat mesa
#

I'm currently working on my breakfast themed language

#

about 450 lines into the parser rn

quartz kindle
wheat mesa
#

my biggest challenge is going to be figuring out how to use LLVM/cranelift for codegen since I've never done that before

earnest phoenix
wheat mesa
#

I was told by the rust server to use cranelift since it's easier than LLVM but I can't seem to find much out there on the internet about it

wheat mesa
earnest phoenix
#

Lmao

wheat mesa
#

I made the semicolon equivalent a # because it looks like a waffle

#

So I'm everywhere in the lang C:<

ancient nova
#
    // Lets now write some code for our Afk System Module.
    // First we check if it's enabled, then we check if the person typing is AFK.
    if (settings.afkEnabled === "true") {
        // And now lets define our afkCache Collection again.
        const afkCache = container.afkCache;
        
        // Now lets define whoever was mentioned.
        // If there is, lets now continue the code, else stop.
        const mentionedMember = message.mentions.members.first();
        if (mentionedMember) {
            // And now lets actually check if the person mentioned is a person with an AFK status
            // If not, again we will ignore it.
            const afkData = afkCache.get(mentionedMember.id);
            if (afkData) {
                const [ timestamp, reason, guildId ] = afkData;
                // We check if the afk was from the guild the person was mentioned in.
                // ( We do not want the afk system to be cross guild, as some guilds may have disabled their AFK modules)
                if (guildId === message.guild.id) {
                    message.reply(`${mentionedMember.user.tag} is AFK!\nReason: ${reason}\nSince: ${timeAgo(timestamp)}`);
                }
            }
        }; const afkData = afkCache.get(message.author.id);
        if (afkData.get(message.author.id)) {
            const [ timestamp, reason, guildId ] = afkData;
                if (guildId === message.guild.id) {
                    afkData.delete(message.author.id);
                    message.reply(`${message.member} Welcome back!\nI've removed your AFK status for you :thumbsup:`);
                }
        }
    }
``` TypeError: Cannot read properties of undefined (reading 'get') dude what
wheat mesa
#

A simple for loop to print 0-9: ```
prepare(preheat i at 0# cookwhile i tasteless 10# stirby 1) |>
say i#
<|

earnest phoenix
wheat mesa
#

😉

ancient nova
#

oh my bad

sudden geyser
#

think -> idea
^-------- |
| v
finish |--- develop

wheat mesa
#

true!

earnest phoenix
wheat mesa
earnest phoenix
#

Also why not use the has() method in that if statement expression?

wheat mesa
#

I mean technically it's better to not call has since it'll end up in a redundant function call

#

If it does pass that is

#

Better to just check if it's null/undefined and if it's not then you don't have to call another function

boreal iron
ancient nova
#

HOW DO YOU REMOVE SOMETHING FROM A COLLECTION 😭

wheat mesa
wheat mesa
earnest phoenix
wheat mesa
#

Ah no it's .delete()

#

@ancient nova there's documentation for the 5 billionth time: https://discord.js.org/#/docs/collection/main/class/Collection

earnest phoenix
#

But if they want to check the value rather than the key, then it's understandable

boreal iron
ancient nova
wheat mesa
#

I didn't read too much into it, too much stuff

#

He's got a map of maps

ancient nova
#

got damn I think I edited that over 6 times

wheat mesa
#

That's all I need to see

earnest phoenix
#

Something worse than listening to BTS torture, looking at ItsOkayBae's code that was never showed to us

#

The hidden and forbidden sight of death

boreal iron
#

You literally need a therapist after watching it

earnest phoenix
#

"Sir, that'll be $500,000 for giving me brain damage as well"

wheat mesa
#

I need to sue for emotional trauma

boreal iron
#

So many things have been said like a thousand times already

wheat mesa
#

Can we pin a link to documentation please

#

Nevermind there's already some pinned

#

just buried behind 30 other pins

earnest phoenix
boreal iron
#

I wanna say this isn’t djs support server but it literally is

wheat mesa
#

volt teach me llvm

#

I was told by rust langdev pros to use cranelift

#

But I don't know if I want to install it if it requires that (Haven't looked into it yet)

boreal iron
#

He can teach you to craft non-working bombs

wheat mesa
#

Because LLVM took like 55gb of space

#

And 2+ hours to build

#

😭

#

And I still have yet to use it

earnest phoenix
#

I'm sorry you had to sit through that, done that a 100 times already

wheat mesa
#

god imagine editing one of the header files for this monstrosity

#

"Compiling 500 billion files that depend on this one header"

earnest phoenix
#

"Oh shit I forgot a character in this string"

boreal iron
#

You gotta live with it

earnest phoenix
#

This little maneuver is gonna take us 51 years

wheat mesa
#

After I finish my AST parser I'll look into the differences between cranelift and LLVM

#

Since I was told that I'm good to generate my AST before I even touch codegen

quartz kindle
#

how the heck does llvm have 55gb

#

isnt it supposed to be a small efficient cross platform low level vm

wheat mesa
#

It's the fully built source code

#

Which includes all the developer stuff, not just an executable or anything

earnest phoenix
quartz kindle
wheat mesa
#

The debug folder alone takes 26.5gb

earnest phoenix
#

Oops I misplaced the parts

quartz kindle
#

i still dont understand how is it possible to have 50gb worth of developer code/tooling

wheat mesa
#

the runtimes folder is only 28kb, which I assume is where the magic happens

quartz kindle
#

how big is the actual compiled llvm?

wheat mesa
#

nvm this is just a folder of vs shit

earnest phoenix
#

The tools of LLVM itself, such as codegen, IR, optimizers, etc etc. reside in the llvm directory

wheat mesa
#

liar, I see no such dir

earnest phoenix
wheat mesa
quartz kindle
#

my head has trouble processing such colossal projects

wheat mesa
#

It's definitely worth the 55gb

#

considering what it does

quartz kindle
#

does it cure cancer?

wheat mesa
#

yes

quartz kindle
#

nice

wheat mesa
#

it makes whoever sees it kill themselves, therefore killing the cancer too!

earnest phoenix
#

Also it seems like Linus Torvalds is slowly switching to using our Clang compiler to compile the Linux kernel

quartz kindle
#

lmao

wheat mesa
#

isn't clang slower than gcc on average though

#

or, well, produces slower code I thought?

earnest phoenix
#

Nope, Clang is well-known to be faster than GCC

wheat mesa
#

Interesting

#

I've been getting fed gcc propaganda from somewhere then

quartz kindle
#

inb4 russia

wheat mesa
#

lmfao on gcc's own forum, someone had something like this happen

earnest phoenix
#

Although there is a catch, GCC implements the newer features/changes of the C/C++ standards way faster than Clang because they usually don't do much optimizations

wheat mesa
#

good thing c/c++ barely ever has significant changes

earnest phoenix
#

We usually focus on optimizations so it takes a lot longer to implement them on the Clang side

ancient nova
#

how are these stats?

earnest phoenix
#

Not bad, but I would suggest removing the Users field because nobody really cares about that, since they're not the actual users and just the cached users

ancient nova
#

memory usage went from 150mb to ~40mb
uptime is constant, it can go weeks without restarting, I supprossed most errors with my errorss handler and the ping is quite ok ranging from 50-150

wheat mesa
ancient nova
#

😠

wheat mesa
#

What are you using for memory usage

ancient nova
#

hold on I don't even remember what I put there

wheat mesa
#

@earnest phoenix for memory usage, RSS is more accurate right?

ancient nova
#

lemme check

wheat mesa
#

👍

#

That's what I always use for it, otherwise you're missing other stuff

ancient nova
#
${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB
``` this is precisely what I'm doing
wheat mesa
#

yeah that's why it's low

#

use .rss instead

#

that's more accurate

ancient nova
#

alright let me try that

wheat mesa
#

resident stack size will be larger because it keeps track of more stuff in your process

#

Like stack allocation, not just heap

ancient nova
#

pls reload stats

wheat mesa
#

Which is a big part of v8's internals I'm sure

ancient nova
#

whoops

#

😭 it jumped to 117.54 MB

#

wonder what it would be if I changed it to rss before I did the optimizations

wheat mesa
#

Yup, because it includes that other stuff which is important too

ancient nova
#

more than 300MB?

wheat mesa
#

I highly doubt you optimized it THAT much

#

Unless you were doing something horrifically wrong

ancient nova
#

I've turned some modules into events

wheat mesa
#

That really wouldn't make much of a difference, whatever that means

ancient nova
#

before executing most things I checked if they're working so no calculations are being done as well

#

I've mainly optimized the messageCreate event

earnest phoenix
#

Alright well, go ahead; compare the before and after of the optimizations

wheat mesa
#

Again, unless you were doing something horrific I doubt you would've been able to force 200mb more of allocations lmao

ancient nova
#

from ~500 lines to 323

wheat mesa
#

Less lines does not mean less ram

#

just so you know

ancient nova
#

just saying how much I redid

wheat mesa
#

I can write a memory leak in like 5 lines in C

ancient nova
#

okay show me

wheat mesa
#

:troll:

#
int main() {
  for(;;) malloc(10);
  return 0;
}
#

4 lines if you wanna adhere to c standards

ancient nova
#

😭

wheat mesa
#

I think the return 0 is forced to compile

ancient nova
#

for (;;) is an infinite loop if I remember correctly

#

what did malloc do?

wheat mesa
#

Yes

#

memory allocation

ancient nova
#

oh so you will just keep allocating more memory until blue screen of death KEKW

wheat mesa
#

Normally you'd use it to allocate space, and cast it to a pointer of your choosing

earnest phoenix
#

Or just 1 line in JavaScript

for (;;) Buffer.alloc(50);
wheat mesa
#

lmao

wheat mesa
#

Where you have to resize and reallocate the array because arrays have constant size and cannot change size

#

Ah, C, the language where you have to do EVERYTHING yourself

earnest phoenix
#

Ignoring assembly

wheat mesa
#

Well yeah but very few people actually hand write asm now, unless it's for like os dev and some other stuff (which I'm sure you have done some of for LLVM of some sort lol)

earnest phoenix
#

Yep

#

Even the Linux kernel writes assembly instructions using the asm function/keyword in C

#

So much optimization mmLol

wheat mesa
#

lol

hard wraith
#

having issues with this... Its not resolving to my app on port 3000

wheat mesa
#

llvm and such have gotten so advanced that you probably would not be able to hand write a program in asm that is faster than a c program optimized by a compiler

#

unless ofc it's this, since this function only returns 1 for any value given to it KEKW

earnest phoenix
#

Yeah, it's extremely hard to compete against writing a program in ASM yourself that would be faster than a compiler-generated ASM

wheat mesa
#

so many people working on so many areas of specialty in those optimizations

#

you'd have to be a literal god

earnest phoenix
#

Unless you know ASM very well

lyric mountain
#

the compiler's only purpose in life is to write asm

#

do u think u can compete with that?

earnest phoenix
#

Compiler: "You underestimate my power!"

ancient nova
#

I just realized I store afk cache by author ID so even if I check for guild ID as to not make it cross compatible it would still override the users afk if he set it in another guild

#

anything I can do to fix it?

wheat mesa
#

design a system that doesn't have 2d maps

#

lol

#

think about your logic before rushing to write it

ancient nova
#

I won't be able to use collections for it tho

#

and I don't think I wanna stuff another thing into my bots DB

hard wraith
#

Anyone know anything about DNS SRV records?

wheat mesa
hard wraith
#

I love this little app.

quartz kindle
#

why ascii mode tho

hard wraith
#

its weird... its for on an ubuntu ssh terminal lol

#

they have a way to view it in a browser but its paid...

quartz kindle
#

most ssh clients can do better than that lol

lyric mountain
#

why can't they just use window drawing characters?

hard wraith
#

This is my creating an image SFW checker first test...

#

How do I convert a buffer to an object?

earnest phoenix
hard wraith
#

I get a response of json in buffer form from a CURL... I need to turn that buffer into JSON.

#

nevermind I need to convert the buffer to string then parse it...

earnest phoenix
#

The data is received in chunks, so if you don't seem to have the full data, you can create a variable, concat the buffer to it on every data event call, and convert it to a string

#

And finally parse it

hard wraith
earnest phoenix
#

Well yes because I suppose you already have the full data

hard wraith
#

As the image url sent in is pornography to test the call response, I obviously hid the details.

hard wraith
#

This is what it sends back, but as a buffer lol

#

probably because of HTTPS being used... IDK.

earnest phoenix
#

I know, that's not really the point though; the entire data is usually not received as one part, it comes in chunks; you can also you things like https://undici.nodejs.org/ to make it easier to work with

#

Unless you don't want any dependencies in your program

hard wraith
#

im just testing the azure responses to make sure that I handle it properly before creating the package.

earnest phoenix
#

I mean not really unless something else is actually preventing you from using dependencies, private packages can always have dependencies

#

Unless the licenses say otherwise

hard wraith
#

The company I am making it for specified 0 dependencies

earnest phoenix
#

Understandable

hard wraith
#

However, I am allowed to make a public version of it if I want to lol

#

I dont get this company, but they paid for it and gave weird specs...

earnest phoenix
#

As long as it pays ¯_(ツ)_/¯

ancient nova
spark flint
#

down for me