#development

1 messages · Page 99 of 1

boreal iron
#

or what he even wants to archiv

earnest phoenix
#

You're just doing requests and checking the username

sharp geyser
#

He wants to use display names to search people on steam, which is a grand idea if not for the fact they can change and are very hard to accurately keep up to date without wasting api calls

hushed robin
#

no I’m not

earnest phoenix
#

Yes you are that's what you described above

hushed robin
#

when they search their profile I’m going to check, I’m not doing requests just to check the display name

earnest phoenix
#

They only let you do shit with IDs

sharp geyser
#

I know

earnest phoenix
#

So storing display names is completely pointless

hushed robin
#

no

#

it’s not

earnest phoenix
#

Yes.

sharp geyser
#

Storing dynamic data is a shit show for a third party

hushed robin
#

maybe it’s useless to you but 🤷

earnest phoenix
#

Argue how you want, facts are facts.

hushed robin
#

it’s not a fact

earnest phoenix
#

It is.

hushed robin
#

how is it a fact

earnest phoenix
#

My fucking lord

#

Just read above

hushed robin
#

the data isn’t useless, it’s being used

quartz kindle
#

your fucking lord

boreal iron
earnest phoenix
#

That's like top level stubbornness

#

Never seen before

sharp geyser
earnest phoenix
#

Whole new level KEKW

sharp geyser
earnest phoenix
quartz kindle
hushed robin
#

think whatever you want

earnest phoenix
#

I'd store their entire display name history as well

#

Just in case they need it again

#

As well as the date they changed it, the number of characters changed etc.

#

Fetch all display names every minute and update your data

#

Top level caching

hushed robin
boreal iron
#

well, you can send one request every second without running into the request limit

#

so I guess, np at all

hushed robin
boreal iron
#

well you can, but have to wait 23:59:59 until you can send the next one after

hushed robin
#

which is why i'm going to use multiple ips

#

😸

boreal iron
#

why do you need to do that many requests?

hushed robin
#

because

#

i need the player count of every game

#

which is

#

like 80k

#

how else do other services do that besides multiple ips?

boreal iron
#

what are you actually trying to do?

#

monitor the amount of players per game?

hushed robin
#

historical player count of games

hushed robin
#

wym api key

#

what does API key do?

#

besides authorize the requests

deft wolf
#

Well, if you use several keys, you don't need to use several IP addresses no?

hushed robin
#

well some endpoints dont require one

#

but how would you get multiple

#

besides creating a bunch of steam accounts

deft wolf
#

That's probably the only option. Still better than multiple ip addresses in my opinion

hushed robin
#

what about endpoints which don't require an api key tho

#

how would that work if the limit is per key

deft wolf
#

I don't know that, you'd have to check it out. Different services may handle it differently

hushed robin
#

well they don't specify that lol

#

"You are limited to one hundred thousand (100,000) calls to the Steam Web API per day."

deft wolf
#

Right, it depends what they mean by "you" because it could be per key or it could be per ip address

hushed robin
#

wait

#

i'll test it

#

lemme try doing a million requests

deft wolf
#

Good luck

hushed robin
#

hopefully they don't ban my ip 🙌

rustic nova
#

2 days later

How do i get my ip unbanned

hushed robin
#

restart my router

rustic nova
#

Just ask their support literally, they can help with that if your goal is around doing that

#

As long as its okay with their tos tho

hushed robin
#

well

#

wheres support

#

steam support?

#

i don't see any section in support for the api

rustic nova
#

Support of the game

hushed robin
#

what game

#

⁉️

rustic nova
#

Oh if its steam itself then yes you will get ip banned

hushed robin
#

why

#

how else am I suppose to get the player count of 80k apps without 80k requests 🤨

#

and then times that by once an hour

boreal iron
#

use another service that fetches em for u

hushed robin
#

lame

#

and I’ve searched I don’t think there are any

sharp geyser
#

Why on gods earth would you want to

#
  1. You'd get api banned
  2. If you do it and somehow dont get api banned, it'd be abnormally slow
boreal iron
#

Nope you won't get api banned

#

Any large player stats service is using the same technique

hushed robin
boreal iron
#

Not much to worry about

sharp geyser
#

Im sure steam would definitely ban someone making 80 thousand concurrent requests

hushed robin
#

then how do other services do it

sharp geyser
#

For one that one 80k call to the api will use up nearly all of your api call limit

#

Steam limits third party apps to 100k calls per day

#

Now im sure steam is more than willing to negotiate this for bigger apps

hushed robin
#

so

#

i should rizz up steam support to increase my calls per day

sharp geyser
#

You should be more worried about how to grow your application

hushed robin
#

it won't grow

sharp geyser
#

With as it stands now I doubt you'll even reach the 100k calls unless you're being dumb

hushed robin
#

well

#

im at 40k requests right now

sharp geyser
#

💀

hushed robin
#

i'm removing every game with 0 players from my db

#

once it finishes i'll have done 80k requests

#

so i'll try doing 20k more to see if it blocks me

unborn basalt
#

Crowdcasting app

hushed robin
#

guys

#

why does it take so long to loop through 80k items

harsh nova
#

Hard to say without seeing the code

#

Just iterating 80k items is fast. If it's taking long it might be that you are making web requests or having a loop inside the loop

hushed robin
#

uh

#

i am making a request

#

each time

harsh nova
#

That'd probably be it then

hushed robin
#
const applications = db.prepare('SELECT * FROM applications').all();

for (const application of applications) {
  const applicationPlaying = await fetch(`https://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v1?appid=${application.id}`)
    .then(response => response.json())
    .catch(error => console.log(error));

  if (applicationPlaying.response.player_count === 0 || applicationPlaying.response.player_count === undefined) {
    console.log(`(${applicationPlaying.response.player_count}) Deleting application...`);
    db.prepare('DELETE FROM applications WHERE id = ?;').run(application.id);
  } else console.log(`(${applicationPlaying.response.player_count}) Keeping application...`);
};```
#

it's been almost two hours it's still going

#

but it's removed 40k applications with 0 playing

#

so it's working at least 🤷

harsh nova
#

I'm amazed you've not been ratelimited by steam zoomeyes

hushed robin
#

well

#

there's no rate limit

#

but there's a daily limit of 100k

#

so i will have used up most of it when it's done lol

harsh nova
#

Well anyhow the reason it's slow is that you are awaiting every request. That means that instead of having many requests going on at once it does it one at a time

hushed robin
#

but

#

don't i have to await it

harsh nova
#

You don't as long as you handle the promise

#

I'm heading to bed but I'm sure you can figure it out

hushed robin
#

well

#

it's almost done anyways so 🤷

lyric mountain
#

The 100k is the ratelimit

#

I still have no idea wtf ur trying to make

hushed robin
#

it's still going ☹️

#

bruh

hushed robin
lyric mountain
#

There HAS to be a better way

#

Is there really no batch endpoint?

hushed robin
#

bulk?

lyric mountain
#

Yes, bulk

hushed robin
#

don't think so

lyric mountain
#

Also u shouldn't be deleting entries

#

Instead use a status column or smth

hushed robin
#

why?

lyric mountain
#

Or just check for entries with count > 0

lyric mountain
#

And inserting again will make it recalculate indexes

#

So you're doing double the work for the same result

hushed robin
#

but then i'll have a bunch of unnecessary data

lyric mountain
#

Doesn't matter as much as you think

#

As long as you have a proper structure

#

Plus you're very likely to eventually re-add those applications back in the future

#

So it's not like you'll never use them

hushed robin
#

hm

#

is there anyway i can make this loop loop all at once

unborn basalt
#

what are you trying to get to loop again

lyric mountain
#

Tho technically still not "all at once"

#

"at once" doesn't exist in programming, you're always following a sequence of operations regardless of what u do

#

The thing is that, if it feels like you're doing it the wrong way, you're very likely doing it the wrong way

hushed robin
#

so

#

i can't?

lyric mountain
#

Many services or sites track steam activity, I doubt any of them use 80k of the daily limit for updating status

hushed robin
#

how are they doing it then

lyric mountain
#

I don't know, do your research

hushed robin
#

i have

#

there's nothing

lyric mountain
#

Check again

hushed robin
#

literally all the websites mention is that they use the steam api

lyric mountain
#

That's obvious

flat copper
#
let array = [
 {
   name: "1",
   hp: 1
 },
{
   name: "2",
   hp: 55
 },
{
   name: "3",
   hp: 100
 }
]

i want to get a leader board like the person with most hp left comes at top

lyric mountain
#

But that doesn't mean you need to make 80k requests

flat copper
#

how?

wheat mesa
#

array.sort((a, b) => some sort of criteria to sort by here)

flat copper
#

oh ty

hushed robin
lyric mountain
#

Btw, remember sort expects a number, not an integer

hushed robin
#

there's no way to make a bulk request

lyric mountain
#

So a - b, not a > b

lyric mountain
#

i don't know, do your research

#

If there really isn't a way, perhaps you shouldn't be doing it then

hushed robin
#

well

#

i'm still going to do it

#

but this makes it more difficult

lyric mountain
#

Your risk

hushed robin
#

how a risk?

lyric mountain
#

For example, they banning your ip

hushed robin
#

other websites are doing it so it's fine 👍

lyric mountain
#

Doubt they're doing it that way

hushed robin
#

they are

lyric mountain
#

How are you so sure?

hushed robin
#

because there's no other way

#

i've been googling for awhile

#

and haven't found anything

lyric mountain
#

Ah, lul

#

Boolean, meant boolean

lament rock
#

Late where you are?

lyric mountain
#

Yeah kinda

lyric mountain
#

Api spam is not a sustainable method

#

Never is

hushed robin
#

there is not

lament rock
#

I feel that. I just got finished setting up my sbc and it sucked because I had to flash an os to an sd card first and then flash the os to the nvme m.2 ssd I bought for it through ssh and sftp and then flash the on board flash memory to tell it to boot to the nvme.

lyric mountain
#

The what

hushed robin
#

what does "poll" mean

wheat mesa
#

depends on the context

hushed robin
#

"Thanks! I poll GetNumberOfCurrentPlayers from the Steam Web API."

wheat mesa
#

basically just means fetch

lament rock
#

take this situation
"are we there yet?"
> no
"are we there yet"
> yes, now we are

lament rock
#

I got a raspberry pi-like sbc

#

except better

#

4 core arm big little chip at 2.4GHz and 16GB of ram

#

Got a 128GB nvme m.2

#

But its boot priority by default is only set to sd card slot

lyric mountain
#

Ah, so u used an sd as a bridge to the nvme

lament rock
#

bingo!

#

Now everything is so snappy

#

the sd card was limited to 100MB I/O

lyric mountain
#

Didn't know raspies had nvme slot

lament rock
#

I got the orangepi 5

#

so not an rpi, but it's better

#

This thing can fit in my hand easily and its performance smacks

lyric mountain
#

Nice

lament rock
#

but I should probably get some heat sinks for it since the cpu die is exposed to the open air

lyric mountain
#

Is the cpu lidless?

lament rock
#

mmm idk if it's lidless. It's flat and not like _/—-\_

#

I hate how / and \ are formatted wtf

#

nvm it was underscores

lyric mountain
#

It's probably lidless then, like, is just the bare thing

#

Yeah getting a sink is a good idea

lament rock
#

probably for low profile

#

although nothing is really low profile about full sized hdmi, headphone jack, 3 port usb panel and 1 gig ethernet

#

I kinda want to make my own printed case for it

#

I have little blowey-matrons anyways so I can turn it into an airplane for max airflow

lyric mountain
#

Easier to just make a mold and press-shape an aluminum sheet

lament rock
#

aluminum is expensive

#

filament for a 3D print is dirt cheap

lyric mountain
#

It'd be like, 5cm square no?

#

If that

#

Regular 3d print would melt

lament rock
#

mm something like that

#

Nah it would be rised with stand offs

#

I see other people with printed cases

#

the cpu and memory package doesnt get that hot

#

I know I shouldn't, but I touched it with my bare hands

lyric mountain
#

Ehh, finger oils

lament rock
#

I wanted to somehow shove my pcie 16 lane graphics card onto it, but I can probably somehow bridge it with usb c

#

maybe

#

a x2 to x16 lane seems jank and I want the nvme ssd still

#

That way I can host stuff like waifu2x

lyric mountain
#

A connoisseur, I see

hushed robin
lyric mountain
#

I use w2x daily for my image processing

lament rock
#

Wanted to somehow make a cdn that scales images with waifu2x optionally or just allow my donors to abuse some of my hardware

#

Thankfully I have unlimited data

hushed robin
lyric mountain
#

You can nothing in go, not with your current knowledge

#

But yes, go supports threads

#

It'd still not be "all at once"

#

Since you'd need to spawn threads in sequence

hushed robin
#

i know Go wym

#

the thing is even if i make individual requests it takes so long

#

too long

#

like 30 minutes to complete

wheat mesa
#

I still don't see how steam would even allow that many requests that quickly

#

I'm sure there's a ratelimit at some point other than the request cap

lyric mountain
#

100k per day

hushed robin
#

well

lyric mountain
#

Ah, u mean aside from the cap

hushed robin
#

you can make requests quickly

#

theres just a daily limit

#

of 100k as he said

lyric mountain
#

They probably have a minute ratelimit too

#

Because they have ddos protection

hushed robin
#

doubt

#

i never once got rate limited

lyric mountain
#

Because ur using js

hushed robin
#

if theres a minute rate limit it must be very high

hushed robin
lyric mountain
#

Js is monothread

#

A request won't fire until the previous request completes

#

Since ur awaiting it

hushed robin
#

well

wheat mesa
#

You can spawn child processes

hushed robin
#

how can i not do that

#

cus it makes it take forever

wheat mesa
#

But that's about it in terms of multithreading

#

and/or worker threads, never used them before though so can't help you on that end

hushed robin
#

like this whole process of looping through and requesting took like

#

4 hours

#

☠️

lyric mountain
#

You'll end up getting your ip banned

wheat mesa
#

well yeah, you're doing like 100 thousand requests

hushed robin
#

well i stopped now

#

cus i finished

lyric mountain
#

And having to justify to your ISP why you got banned to begin with

hushed robin
#

there's now only 11k applications in my db

#

previously there was 80k

wheat mesa
#

why do you even need to do that many requests in the first place? are you looping over the entire steam gallery of games or some shit?

hushed robin
#

looping through

#

checking player count

#

if 0 or undefined

#

kick from db

wheat mesa
#

again, why

hushed robin
#

so i can limit the requests i will eventually have to make

wheat mesa
#

just...make...them...later?

hushed robin
#

no

#

i need to make them all at a specific time

lyric mountain
#

What if I want to know the player count of a game that was deleted from the db?

hushed robin
#

tuff luck

#

it's a dead game

lyric mountain
#

What if it happened to have 0 players the exact moment u fetched it?

#

Btw, your player tracker will be as useless as a broken clock

hushed robin
#

why

lyric mountain
#

Except a broken clock is right twice a day

lyric mountain
lament rock
#

Promise.all

wheat mesa
#

Okay so if I'm understanding this correctly, a user will ask your bot how many players are on a game. Then, you fetch said player count, and give it back to them. Am I right?

hushed robin
#

no

lament rock
#

accepts an array of promises and fires them all "at once"

lyric mountain
#

You can't fetch it frequently enough to keep live data

hushed robin
#

what I want to make

lament rock
#

const results = await Promise.all([…promises])

hushed robin
lyric mountain
#

Not the way ur doing

wheat mesa
#

not with 100k requests a day it's not lmao

lyric mountain
#

U said u have 11k entries

hushed robin
#

yeah i know

lyric mountain
#

So that's about at most 9 refreshes per day

hushed robin
#

i'm still searching

wheat mesa
#

I'm so confused, why would you literally not just fetch it and cache the data when the user ASKS for it

lament rock
#

is there a websocket api

hushed robin
#

for what

lament rock
#

for events you want

hushed robin
#

i don't want events

lyric mountain
wheat mesa
#

What is the point of fetching all of this data now and deleting it from your database if the data eventually changes anyways

hushed robin
#

waffle

#

that's not what i'm trying to do

lament rock
wheat mesa
#

Then what are you trying to do

#

You have not been very specific from what I've seen

hushed robin
#

i'm trying to make it so

lyric mountain
#

That's true, you don't need all the data at once

#

Just show what the user asks for

hushed robin
#

it fetches the player count of a game at an interval, that way someone could look back to a specific time / date and see what the player count was

lyric mountain
#

That's actually very possibly what the sites do to show live count

#

Not what u said, but what waffle suggested

wheat mesa
hushed robin
#

why not

wheat mesa
#

unless there's a bulk endpoint, which I don't see the point of that existing for this specific use case

wheat mesa
hushed robin
#

yes

#

theres 11k

wheat mesa
#

if you can't even fetch the data for it within 4 hours then how on earth are you going to keep up with doing that multiple times a day

lyric mountain
#

That you kept in database

hushed robin
#

true

lament rock
#

alternatively, scrape html :)

hushed robin
#

but also a large portion of the things in my database were

#

DLCs

#

and other things

wheat mesa
#

making thousands of requests all at once is not going to be reasonable in any language much less js

#

there's only so much processing you can do when your limit is basically how long an API takes to respond to you

hushed robin
#

sooooooooo

#

how do other websites do it

lyric mountain
#

They show only what's requested

#

At the end of the day, people are going to use the official/popular site anyway

hushed robin
#

?

wheat mesa
#

like @lyric mountain said, research more about your specific issue, I highly doubt these websites are going through tens of thousands of games to get live player count and storing it all the time

hushed robin
#

well i'm just doing this for fun

#

i'm not planning on taking over those websites

wheat mesa
#

except they probably aren't because that's an unreasonable solution

hushed robin
#

if you go onto any game there's a player count at a 1 hour / 2 hour interval

lyric mountain
hushed robin
#

what is that suppose to mean?

wheat mesa
#

and if they are then they likely have the infrastructure to support it seeing as they're big websites

lyric mountain
#

It means they only refresh what's currently being viewed

#

Like, the chances of someone searching for Dota 2 player count is much more higher than someone searching for I Am Bread

#

There's no need to track IAB unless someone searches for it

hushed robin
#

but they are tracking IAB

#

they're tracking every game

lament rock
#

How do you know they're tracking it all the time unless they have graphs?

hushed robin
#

they do

lament rock
#

Ok

lyric mountain
#

They probably made it seamless enough

lament rock
#

Do the graphs go by a specific interval?

lyric mountain
#

But they 101% sure aren't tracking all at once

hushed robin
#

usually at every hour

lyric mountain
#

Mind to show that site?

hushed robin
#

sometimes every other hour

lament rock
#

what about for a game no one plays

lyric mountain
#

Because a graph with 80k applications would be far from readable

lament rock
#

like desert bus vr

#

unlikely anyone checks that

lyric mountain
#

This is what u mean?

hushed robin
#

yes that's the website

lyric mountain
#

It's like, at most 10 games

#

Not "all" games

hushed robin
#

no, go onto a specific game

#

they're tracking the player count at intervals

lyric mountain
#

Read what u said, carefully

hushed robin
#

read what

lyric mountain
hushed robin
#

i read it

#

what about it

lyric mountain
hushed robin
#

what do you mean by that though?

lament rock
#

does desert bus vr have a frequently updated graph

lyric mountain
#

Meaning they aren't tracking all games

hushed robin
#

yes but that website is very popular, i can guarantee it's tracking thousands and thoussands

lyric mountain
#

It isn't

hushed robin
#

it is

lyric mountain
#

Isn't

hushed robin
#

i can search a random game from my db

#

and it'll be tracking it

lyric mountain
#

It only shows data when u search for it

#

It doesn't present ALL data at once

hushed robin
#

it is tho

lyric mountain
#

When will you stop being a moron?

hushed robin
#

i am not a moron

lyric mountain
#

You literally just admitted you need to search for a game to see the data

hushed robin
#

yeah

lyric mountain
#

Meaning they aren't actively tracking every game

hushed robin
#

but how do they have the data?

lyric mountain
#

They don't

#

They get it when someone searches

#

It's literally loaded when u open that specific page

hushed robin
#

how are they getting data from years ago?

lyric mountain
#

Steam has an endpoint for that

hushed robin
#

no it doesn't

lyric mountain
#

They keep track of a game's popularity over time

#

So they probably have that available

#

If they don't, then scrapping is the answer

hushed robin
#

scrapping what?

lyric mountain
#

Too complicated for you

hushed robin
#

no it's not

wheat mesa
#

Yes it is

hushed robin
#

no

wheat mesa
#

Feel free to look up what web scraping is but I highly doubt you’re going to want to go that route for very long

hushed robin
#

i know what web scraping is

lament rock
#

someone said I was dumb for scraping spotify track info, but the alternative is an oauth2 based api and that shit's beans (a bad thing)

hushed robin
#

does anyone know a good module for graphs

lament rock
#

graphana

hushed robin
#

looks weird

#

i need a simple one

lament rock
hushed robin
#

i've seen chart.js but the graphs look like something outta excel. i want them to actually look good ☹️

lyric mountain
#

So you want a simple one but not a simple one

hushed robin
#

well

lyric mountain
#

Also every chart will be ugly if you make them ugly

hushed robin
#

I want one that makes my graphs look pretty

#

and not shit

lyric mountain
#

Any lib will allow you to make beautiful charts

hushed robin
#

no

#

I tried chart js it worked but

#

looked ugly

lyric mountain
#

Because you wrote ugly shit

hushed robin
#

how did I write ugly shit

#

I just inputted the data and that’s what it spit out

lyric mountain
#

You can't expect to simply add something and be done with it

#

If you want beautiful stuff you need to put effort into making it beautiful

hushed robin
#

I tried

lyric mountain
#

You didn't

hushed robin
#

I couldn’t find anything to make them look good

hushed robin
#

yeah cus I couldn’t find anything

lyric mountain
#

Because you searched for done solutions

#

People won't give you the best design code for nothing

hushed robin
#

like I wanted to width of the line to be thicker and for a dot to be on every data point but I couldn’t find anything ☹️

lyric mountain
#

It can be done

hushed robin
#

with chart js?

lyric mountain
#

Yes?

hushed robin
#

have u done it?

lyric mountain
#

It can be done with any chart lib

#

Yes

#

Chartjs is entirely customizable

#

You won't find ready solutions online because some people are literally paid to design beautiful graphs

hushed robin
#

bruh

#

then where do I find a solution

lyric mountain
#

Read the docs and think for yourself

wheat mesa
#

You learn how to make one…

hushed robin
#

the docs did nothing

#

they’re useless

wheat mesa
#

You spent like 10 mins on it I guarantee

lyric mountain
#

See, that's why everything u touch ends up ugly

hushed robin
lyric mountain
#

You want effortless programming, you want to make an awesome site with minimal logical thinking

hushed robin
#

cus I couldn’t figure out how to make it look good

hushed robin
wheat mesa
#

Then pay someone

hushed robin
#

no

#

I wanna learn

wheat mesa
#

Ok then learn

hushed robin
#

well

#

It’s hard

lyric mountain
#

Nor reading it

wheat mesa
#

Then try

lyric mountain
#

You need to think

hushed robin
#

I did try for 20 minutes

#

to no success

wheat mesa
#

20 mins is nothing

lyric mountain
#

Try 20 days instead

#

"no"

wheat mesa
#

“Bruh”

hushed robin
lyric mountain
#

Why ur quotes fancier

wheat mesa
#

iPhone defaults to different quotes

lyric mountain
#

That's for linguistics

#

In programming you need to think what you need to do to achieve a certain goal

#

You're expecting to read the docs and find the answer for life

#

You won't find it

hushed robin
#

that’s too long

wheat mesa
#

Then live with your ugly graphs

lyric mountain
#

Then you won't learn it

wheat mesa
#

You can’t expect a solution to be hand delivered to you for everything

#

That’s not what programming is

lyric mountain
#

Don't want to put effort? Fine, but you'll need to live with your ugly/standard graphs

wheat mesa
#

There’s a reason people get paid to do this

hushed robin
wheat mesa
#

Then suck it up and either spend the time to learn or don’t use them

lyric mountain
#

Or pay someone

#

Which will be expensive

wheat mesa
#

^^

hushed robin
#

how much will it cost

wheat mesa
#

Idk, but probably more than you’re willing to spend

lyric mountain
hushed robin
#

graphic designer? how are they suppose to program me a graph

wheat mesa
#

Falls within a similar category

lyric mountain
#

Graphical designer includes anything graphics-related

#

Also called "frontend designers"

wheat mesa
#

Figma users 🧌

hushed robin
#

how long does it take to make one graph

lyric mountain
#

Depends on your demands

wheat mesa
#

Go ask someone who does that stuff for freelance and get them to quote you

#

I imagine it’s more than you’re willing to spend on a hobby project though

hushed robin
#

this is not a hobby project

wheat mesa
#

Is it for a bot?

lyric mountain
#

Weren't u doing it for fun?

hushed robin
#

I’m asking for a different thing, I gave up on the steam one

lyric mountain
#

You either do something as a hobby, as a job or as a study

hushed robin
#

this is my job

lyric mountain
#

You're paid for it?

hushed robin
#

no

wheat mesa
#

Then it’s not a job

lyric mountain
#

Then it ain't a job

hushed robin
#

it is i will get paid soon when it starts making money 🔥

lyric mountain
#

Heard that a lot

wheat mesa
#

Yeah doubt it’s gonna make money like you expect it will

lyric mountain
#

Usually from "big game idea" people

wheat mesa
#

Is this by chance for a discord bot or is it a website or what is it for

hushed robin
#

telegram bot

wheat mesa
#

Yeah you’re not going to make any money

#

(At least anytime soon)

#

Never go into developing bots on any service with the expectation of making money

hushed robin
#

well I classify it as my job 👍

wheat mesa
#

Only the top 0.1% of bots make any money at all usually

hushed robin
#

I will be in that top 0.1%

wheat mesa
#

So the idea that you’ll be able to hire a graphic designer for this and recoup your expenses is very unrealistic

#

But it’s your money

#

Feel free to spend it

lyric mountain
#

I'd kick at least 4 days

hushed robin
#

it is very realistic this bot has a very high demand in the telegram community

lyric mountain
#

But I'm no graph designer, so idk

wheat mesa
#

Doesn’t mean you’ll make money

lyric mountain
#

4 days feel like a reasonable estimate for just chart designing

hushed robin
lyric mountain
#

That's an expression we use around here

#

Same as "i estimate"

hushed robin
#

4 days on a chart is very abnormal

#

no thank you

wheat mesa
#

How are you to say what’s normal and what’s not for that

lyric mountain
#

4 days is actually an optimal best case estimation

wheat mesa
#

Considering you can’t even spend 20 minutes on it before giving up

hushed robin
#

because a chart is a basic thing it’s not hard to make

wheat mesa
#

Then make it yourself if it’s so easy

lyric mountain
#

A realistic estimation would be 1 week minimum

wheat mesa
#

See how hypocritical this is

hushed robin
#

I did make one myself

#

but it looked ugly

wheat mesa
#

So then you have no baseline of how long it takes to make a “pretty” one

hushed robin
#

well

lyric mountain
hushed robin
#

It doesn’t take 4 days to thicken lines and put a dot at data points

lyric mountain
#

Those people that charge $25 per hour did study and spend months learning how to design beautiful graphs

wheat mesa
#

This is very hypocritical of you, you say that making a graph yourself is too hard and that you don’t want to learn it, and then you expect someone else to do it easily and quickly for you?

lyric mountain
#

Saying "it's abnormal because it's easy" is plain insulting their work

wheat mesa
#

Yeah ^^^

lyric mountain
#

You don't pay for what they write, you pay for what they know

wheat mesa
#

It’s annoying when people do that to programming as well. Some people think that we just drag and drop blocks all day and that the time needed to complete a project is based on how fast you can type

hushed robin
#

I do pay for what they write, if they don’t write anything there’s nothing to pay for

wheat mesa
#

Oversimplifying a profession is insulting to the people that do it

hushed robin
#

It is

#

writing = work

wheat mesa
#

Lmao

#

Completely forgot how naive you were for a sec

lyric mountain
hushed robin
lyric mountain
#

We're paid big because we spent a lot of time learning it

#

And honing our skills

sudden geyser
#

Some people think that we just drag and drop blocks all day
that's all we do though

wheat mesa
lyric mountain
#

Dunning kruger apprentice

hushed robin
#

anyways I think I’m going to just not make a graph, sounds like too much effort for a little effect. I can just display the data with text

wheat mesa
#

You think that your local McDonald’s employee getting paid $12/hour is serving customers throughout every single hour they’re paid? No, but that doesn’t mean they don’t deserve the money for that hour

#

Same thing applies to a freelancer

sudden geyser
#

programmers are some of the most exchangeable people for a job there is

hushed robin
#

Don’t really get that analogy but ok

wheat mesa
#

The analogy is that your freelancer spends time on your request not just writing code

lyric mountain
#

Which is spending weeks learning how to write something more efficiently and staying up to date

hushed robin
#

if there’s no code there’s nothing to pay for

lyric mountain
#

There is, the knowledge

wheat mesa
#

You’re paying for the code and the knowledge and the time spend designing your request

#

That’s the whole point

#

Here’s a more reasonable analogy

#

When you bring your car to the mechanic and they repair something on it, they charge you for the parts AND the labor

hushed robin
#

but I’m not paying for your knowledge

wheat mesa
#

Not just the raw materials it took to repair your car

hushed robin
#

are you giving me your knowledge? no your giving me code

wheat mesa
#

And yet you do not have the knowledge needed to design it

#

You’re paying for their experience

earnest phoenix
lyric mountain
#

They know how to do it, that's why u pay

hushed robin
lyric mountain
#

Code can be found on docs or google, but they know how to put it all together

wheat mesa
hushed robin
#

I wouldn’t pay for experience, I would pay for the finisher product.
I don’t care how experienced you are.

lyric mountain
#

It's impressive how hard it is to understand the basic concept of paid labor

wheat mesa
#

Sometimes i think that he must be a spoiled little rich kid because there is no other way he doesn’t understand this

hushed robin
#

I wish I was rich

#

would be amazing 🤩

lyric mountain
#

A lazy rich you mean

hushed robin
#

yeah I would be lazy

lyric mountain
#

Because no way ur becoming rich with 20 mins of reading a doc

hushed robin
#

If im rich im definitely not working

lyric mountain
#

Not even "20 mins per day"

earnest phoenix
#

But not getting the whole code would imply the need to use the brain and implement in code their design. Sucks man I want to CtrlC CtrlV and not read the docs for 30 minutes

lyric mountain
#

Just "20 mins"

wheat mesa
#

You’re paying for it because it’s a specialty. It’s a skill. It took them time to learn how to do it, and they possess knowledge you do not. So, in return for their work, you give them money

hushed robin
#

yeah im paying for their work

#

nothing else

wheat mesa
#

And their work requires their knowledge

#

So you pay a premium for it being a special skill that only some people possess

#

It’s not like you’re giving them a Lego instruction manual on how to build what you want

#

Otherwise you’d be able to do it yourself

hushed robin
#

well I could do it myself

#

I could do anything

lyric mountain
#

Then do it

hushed robin
#

no

lyric mountain
#

See?

hushed robin
#

too much effort involved

wheat mesa
#

Then do it yourself and stop complaining about how labor works

wheat mesa
earnest phoenix
#

Can't wait to see this guy on a job interview

#

I'd pay to be present

wheat mesa
#

Fr same

earnest phoenix
#

Same for their first month of trial time

#

Would get fired after the second week

hushed robin
#

wonder how I’m not fired yet ☹️

lyric mountain
#

And you work with...?

hushed robin
#

work with what

#

wym

lyric mountain
#

Yes, that's the question

wheat mesa
#

If you somehow have a job I’d be surprised considering your work ethic seems to be of questionable standards

hushed robin
#

I work with cars

lyric mountain
#

And how tf does that relate to programming

earnest phoenix
#

What country? Just to be sure I don't put my car there

hushed robin
#

I didnt say it relates to programming you asked ⁉️

earnest phoenix
#

Don't want my car to be half repaired or whatsoever

lyric mountain
#

Hm, fair, we didn't specify "programming job interview"

hushed robin
#

I don’t repair cars luckily

lyric mountain
#

You break them?

wheat mesa
#

“Hey so we took your wheel off but I don’t want to put a new wheel back on. Sorry man”

earnest phoenix
#

After taking 10 minutes in attempting to repair the car, time to give up. Unclear instructions

hushed robin
#

☠️

hushed robin
#

nah as I said I don’t repair them

earnest phoenix
#

I'll give you the parts, do it yourself

hushed robin
#

that would indeed be too much effort

#

🤷

wheat mesa
#

Bro counts washing his parents cars as working with cars

hushed robin
#

🤣

wheat mesa
#

But still the point stands. If you don’t want to put in the effort to do something, that is why you hire someone to do something.

#

That is quite literally how specialization within society works

lyric mountain
#

Serious advice, you better try to find a niche to specialize at before you move out

hushed robin
#

true I’ll hire them

wheat mesa
#

People get good at things and exchange their specialties so everybody benefits

lyric mountain
#

Because you'll need to pay rent somehow

#

And buy food

#

And pay bills

hushed robin
#

If life doesn’t work out the army is always looking for new people 🤷

wheat mesa
#

Army requires a lot more effort than almost jobs

earnest phoenix
#

LMAO

wheat mesa
#

Just so you know

hushed robin
#

so

lyric mountain
#

Army is 99% effort

earnest phoenix
#

I'd love to see you in the army

wheat mesa
#

You will not last there for a week with your idea of effort

earnest phoenix
#

That'd be amazing

hushed robin
#

it’s physical effort sure

lyric mountain
#

The 1% is the 4 hours of sleep u get

earnest phoenix
#

Man's going to be clapped every single minute by higher ups

hushed robin
#

nice?

wheat mesa
#

“Sorry I didn’t show up to training today because I didn’t feel like putting in the effort”

earnest phoenix
#

With your mindset, you won't be there for more than 3 days

lyric mountain
#

Guess I'll be going now, will read the aftermatch of this convo tomorrow

hushed robin
#

I would

wheat mesa
#

If there’s one thing the army doesn’t tolerate one bit, it’s laziness

lyric mountain
#

Cya

earnest phoenix
#

bai

wheat mesa
#

Bye

hushed robin
#

physical labor is easy though

#

the army should be no problem

earnest phoenix
#

🍿

wheat mesa
#

The best part of this is that I know he’s not trolling

hushed robin
#

popcorn

earnest phoenix
#

anyways also heading off, losing my braincells over time - plus it's going off topic

wheat mesa
#

He literally thinks this way

hushed robin
#

I’ve never trolled here

#

I troll in Roblox bc

#

vc

#

and rust

wheat mesa
#

Yeah I’m done here too

#

One day you’ll find out what the real world is like

hushed robin
#

good night 👌

hushed robin
#

I’ve been living in the real world for awhile

earnest phoenix
#

Battleless more like effortless troll

hushed robin
#

true 🤣

#

should change my username to that

earnest phoenix
#

Maybe

sharp geyser
#

Time to quit

earnest phoenix
#

my condolences

sharp geyser
#

thank you I needed it

hushed robin
unborn basalt
#

who chose?

timid eagle
long sail
#

quick question how can i change my bot's pfp on top.gg

#

i already changed it on the discord dev website

lyric mountain
#

press "Refresh" then go into edit page and just click "Save"

long sail
#

press refresh where?

#

oh ok

#

i found it

hushed robin
#

how come with lru-cache when I try to access it from another file it always returns undefined ⁉️

wheat mesa
#

You really need to learn how to ask better questions

#

You always give us no context whatsoever for an obscure problem, we need to see some code or SOMETHING at the very least

hushed robin
wheat mesa
#

Ok and where do you export cache

hushed robin
#

what does that mean

#

⁉️

wheat mesa
#

How are you accessing that variable from another file

wheat mesa
#

My man

#

That’s not what I mean

hushed robin
#

what variable are you referring to

wheat mesa
#

I mean where are you getting cache from

hushed robin
#

oh

wheat mesa
#

In BOTH files

hushed robin
#

i just define it in both files

wheat mesa
#

And how do you define it

#

I need to see the definition for both files

hushed robin
#
const LRUCache = require('lru-cache');

const options = {
  max: 500,
  ttl: 12 * 60 * 60 * 1000
};

const cache = new LRUCache(options);
wheat mesa
#

Do you do that for both files?

hushed robin
#

yes

wheat mesa
#

Well then that’s why

sharp geyser
#

If you are doing that in both files the cache likely won’t persist

hushed robin
#

🤨

wheat mesa
#

You’re creating a new cache for each file

hushed robin
#

bru

sharp geyser
#

It’s two different caches

hushed robin
#

how do i create

#

a universal cache

sharp geyser
#

By exporting it and using that one cache only

wheat mesa
#

You need to export your cache from some file or attach it somewhere where you can access it, or you can pass it as a parameter to functions that use it

hushed robin
#

hm ok

#

let me try that

#

oh yay

#

it works

#

w

hushed robin
#

guys how much does 6k characters hold in cache

quartz kindle
#

what

hushed robin
#

how much memory

#

does it take up

#

eat

#

take away from me

quartz kindle
#

depends a lot, but in general each character takes 2 bytes

#

then each individual string takes extra bytes of overhead

hushed robin
#

hm ok

#

that’s kinda hefty

quartz kindle
#

v8 is smart enough to detect what kind of characters the string has tho

#

so if it finds that the string only contains 1 byte characters, it is able to create a special type of string that only uses 1 byte per character

boreal iron
#

Very smort

quartz kindle
#

for example, here's 6k fs

sharp geyser
#

or just split the sentences by their chars and save each char individually then regroup those chars together again

quartz kindle
sharp geyser
quartz kindle
#

6k fs takes 6012 bytes

sharp geyser
#

tim is going to need all the fs he can get

earnest phoenix
quartz kindle
#

F

hushed robin
#

almost 6mb 😕

quartz kindle
#

now if you take that 6k fs

#

and add one character that is larger than 1 byte

#

here's the result

sharp geyser
#

and add 6k Ls then you have tims daily life

quartz kindle
#

the entire string is converted to a 2byte string

#

so it takes 12012 bytes now, instead of 6012

quartz kindle
hushed robin
#

2 bytes x 6000

#

12000 bytes

#

12000 bytes to megabytes 0.011444

#

times 500

quartz kindle
#

so you have 500 strings of 6k characters?

hushed robin
#

yes

quartz kindle
#

3006000 bytes if its a 1byte string
6012000 bytes if its a 2byte string

#

or 5.871 MB

hushed robin
#

I was about to say

sharp geyser
#

tim I challenge you to make a 1gb string

hushed robin
#

5k mb

#

☠️

#

can I cache images

quartz kindle
#

its weird for me too, because im a native portuguese speaker, and portuguese uses commas as decimal delimiter for some reason

hushed robin
#

oh

quartz kindle
hushed robin
#

Ronaldo or Messi

#

⁉️

sharp geyser
boreal iron
#

Imagine using brave

quartz kindle
#

zidane headbutt = best

hushed robin
#

☹️

quartz kindle
#

also 2000s ronaldo

sharp geyser
#

cute little doodles on launch

boreal iron
#

Tf

#

Looks like a child television show

quartz kindle
#

i use an extension to get fun images on startup

sharp geyser
hushed robin
#

Brave tracks you tho

boreal iron
sharp geyser
boreal iron
#

The older I get the more I understand... at least how weird younger people are

#

Take this

hushed robin
#

who’s weird

neon leaf
wheat mesa
#

It would start to take a hell of a lot of memory tho

hushed robin
#

hm

#

so should I just recreate my images every time

wheat mesa
#

Depends on how big the images are, if they’re super small and you’re not using a lot of them then they’re fine. If you intend on caching a TON of them though, that’s where you’ll run into problems

hushed robin
#

hm

#

probably best not to cache them

neon leaf
#

yup

lyric mountain
#

given the name of the lang is "bad lang', congratulations

boreal iron
#

Should use .bad as extension name

#

Instead of bl

craggy pine
#

^

neon leaf
#

^

boreal iron
#

Imagine getting flagged by any anti virus app because of the extension name

quartz kindle
#

discord.bad when

neon leaf
#

technically you could do that

#

it would just end up being unmaintainable

boreal iron
#

Yeah I think discord gave up discord a long time ago, too

#

That's the reason they only add emojis and stickers and bullshit like that instead of useful and wanted features

#

Must be like "we can't make it a serious chat app anyways so let's add any bloat we can find"

#

kids will like it

hushed robin
#

who asked for super reactions

#

most useless thing to ever come to this app

boreal iron
#

tf is a super reaction?

hushed robin
#

Lmao

boreal iron
#

Does it blow up all other reactions?

neon leaf
#

but I actually wanna make a decent language thats enough to control user defined api routes, I just have no clue how I want it to look yet

boreal iron
hushed robin
#

basically a reaction with a special animation that only nitro subs can use

boreal iron
#

God bless the possibility to turn reactions off completely

lyric mountain
#

oh I love writing docs /s

neon leaf
#

I think boolean would make more sense there

lyric mountain
#

there where?

neon leaf
#

at the @return

boreal iron
#

It's a dude writing in Java...
There's nothing to improve at all

lyric mountain
neon leaf
#

ah

lyric mountain
#

u don't declare the type, that's automatically included

#

it becomes this

#

but it's impossible not to be redundant when the fuckin function name is self-explaining

earnest phoenix
#

Unclear what the function does.

public boolean whetherTheEventIsConfiguredToUseButtonsOrNot() { }

seems like a clear improvement

lyric mountain
#

lmao

lyric mountain
#

great, now I can at last publish a release

sudden geyser
compact pier
#

you can use Cypress

neon leaf
#

how can I also make it match call? it should be a unique match, not connected to (test)

#

I think I actually got it

lyric mountain
#

careful when using | in regex, it might not match what you expect it to

boreal iron
#

alwayls need to be aware, things can explode randomly

neon leaf
#

why is regex sometimes so convenient? 🤩

eternal osprey
#

hey implication is right associative right?

#

So a -> b -> c would be written as:
(A -> B) -> C right

#

right associativity means that we start at the left?

lyric mountain
#

@neon leaf (continue convo here)

#

isn't every arg matched in that image?

neon leaf
#

in the second one?

lyric mountain
#

in the one u sent on dms

neon leaf
#

Imma just use this, it kinda matches but I want an argument to be everything until the comma

#

or if there is none just to the end

lyric mountain
#

what are u using the regex for?

neon leaf
#

for making my bad lang less bad

lyric mountain
#

you should be using a lexer instead

#

parsing a language with regex will be extremely hard because u dont have context information

neon leaf
#

I already made that manually, I always know where im in, aka if statement, while loop, etc

#

I just need to match functions

lyric mountain
#

yes, that's part of the issue

#

because for example fn (",", 123) cant be parsed correctly

#

if you split by comma you'll end with 3 args

#

but there are only 2

neon leaf
#

hmm

#

I think I got it but I also want to make the "good ok" one match even though it isnt in "

lean ridge
#

8

#

5]

hidden gorge
#

So i’m trying to organize my slash commands but when i edit the handler to load the commands it can’t find the individual folders and i’m doing ./commands/../ and it says reloaded 0 slash commands.

deft wolf
#

Where's code angeryBOYE

hidden gorge
#

one sec

#

i’m uploading it

#

const { REST, Routes } = require('discord.js');
const { clientId, guildId, token } = require('./config.json');
const fs = require('node:fs');
const path = require('node:path');

const commands = [];

const commandsPath = path.join(__dirname, 'commands');
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));


for (const file of commandFiles) {
    const command = require(`./commands/../${file}`);
    commands.push(command.data.toJSON());
}

const rest = new REST({ version: '10' }).setToken(token);

(async () => {
    try {
        console.log(`Started refreshing ${commands.length} application (/) commands.`);

    
        const data = await rest.put(
            Routes.applicationGuildCommands(clientId, guildId),
            { body: commands },
        );

        console.log(`Successfully reloaded ${data.length} application (/) commands.`);
    } catch (error) {
    
        console.error(error);
    }
})();```
#

and my commands are commands/testcmd/test.js

#

and it won’t load it

#

@deft wolf

spark flint
#
`./commands/../${file}```
` ?
quartz kindle
#

where is the loader located?

hidden gorge
#

my deploy.js

spark flint
#

whats the ../ for

hidden gorge
#

it’s the folder

spark flint
#

wouldn't it be ```js
./commands/${file}

hidden gorge
#

i’ve tried

#

doesn’t work

spark flint
#
`../commands/${file}`
#

wait no

#

nvm ignore that

hidden gorge
#

bc the test.js is in the commands folder in a folder

quartz kindle
#

why not just ```js
require(${commandsPath}/${file});

spark flint
#

or that yeah

hidden gorge
#

nope

quartz kindle
#

if the command is inside another folder inside commands, then you need to edit your code

hidden gorge
#

still says 0

quartz kindle
#

your code is only handling files directly inside the commands folder

lean ridge
#

4

#

5

#

6

#

7

spark flint
#

what

rustic nova
#

Funny number sequence

lament rock
#

use absolute paths always

lyric mountain
#

only a sith deals in absolutes

lament rock
#

join the dark side of nodejs

rustic nova
#

Join the heavy side of node_modules

hushed robin
#

TypeError: Cannot set properties of undefined (setting 'defaultFontFamily')
what does this mean

quartz kindle
#

it means

#

Cannot set properties of undefined