#development

1 messages Β· Page 153 of 1

eternal osprey
#

i want to resize my div, such that (red added as a reference) the whole white background becomes red.

rustic nova
#

then you'll need to remove your width and height

eternal osprey
#

i can then use:

top: 0px;
left: 15vw;
right:0px;
bottom: 0px;

such that it will make the top to bottom, left to right red.
and these properties are only available for position fixed.

rustic nova
#

do you like, have some sort of mockup of how you want it to look?

#

am not really following you

eternal osprey
#

it's just for reference. Look, when i set position fixed, i can use those top, left, right etc to set the right container to cover exactly the white part of the background (i used a 30/70 linear gradient).

#

But position fixed fucks up my whole button gaps.

#

found this on the internet

rustic nova
#

but I'm still not understanding why you wanna set a fixed position

#

this does work somewhat-ish

#

if thats your goal

lyric mountain
#
<the-element/>
<div style="flex: 1">
  ...
</div>
#

since fixed couldn't care less about where it's placed

eternal osprey
rustic nova
#

mfw bootstrap-me would just do "d-flex"

eternal osprey
#

instead, i found that sticky works better. Same thing but keeps it related to the element context apparently.

rustic nova
#

doesn't that kill everything when you resize it?

#

aka resize the window

#

if that mattes on your case atm

eternal osprey
#

yup

#

well

#

i gotta do flex ig.

rustic nova
#

I'd suggest trying some general mockup first, like something made in paint

#

so you can more easily try to adjust the elements to what you want

eternal osprey
#

i know exactly what i want, but yeah i created a general design in figma.

#

this project is mainly for learning

rustic nova
#

but yeah if I understand what you're trying, my suggestion would be flex

eternal osprey
#

ugly ahh looking site

eternal osprey
#

like in a regular calculator.

rustic nova
#

by separating them in new divs

#

each row gets a new div

#
    <div class="calculator-element">
      <div class="element">
        <div class="inner-element-row">
          <button class="button-element">7</button>
          <button class="button-element">8</button>
          <button class="button-element">9</button>
          <button class="button-element">delete</button>
        </div>
        <div class="inner-element-row">
          <button class="button-element">4</button>
          <button class="button-element">5</button>
          <button class="button-element">6</button>
          <button class="button-element">+</button>
        </div>
        <div class="inner-element-row">
          <button class="button-element">1</button>
          <button class="button-element">2</button>
          <button class="button-element">3</button>
          <button class="button-element">-</button>
        </div>
        <div class="inner-element-row">
          <button class="button-element">.</button>
          <button class="button-element">0</button>
          <button class="button-element">/</button>
          <button class="button-element">x</button>
        </div>
      </div>
    </div>
.calculator-element {
  background-color: red;
  display: inline-flex;
  padding: 5px;
}

.element {
    display: inline-flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 10px;
  }

.inner-element-row {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 10px;
}

.button-element {
  flex: 1 1 0px;
}

is my solution to getting this

#

ignore the image, this

eternal osprey
#

oowhh i see. Never saw inline-flex tho.

#

Would flex also just work

rustic nova
#

inline-flex does a bit more magic as it just cuts off when all elements are displayed

#

for comparison, calculator-element with flex

eternal osprey
#

aha i see

#

it's like an inline-block

rustic nova
#

yeah

eternal osprey
#

it just takes the amount of space it needs

#

damn that's awesome, thank you so much for all the help,

rustic nova
#

bit of an issue being, this

#

but that can be fixed by just disabling flex wrap

eternal osprey
#

yeah indeed.

#

i can live with that πŸ™‚

#

thanks

rustic nova
#

CatVibe cool cool

#

and the gap is just for the spaces between the buttons, so you can adjust how much space should be inbetween the buttons

eternal osprey
#

owh never knew that there was a gap property;

rustic nova
eternal osprey
#

owh i see, i thought that these were only available in grids.

rustic nova
#

yeah apparently works in flex columns/rows too

eternal osprey
#

damn that's awesome, thank you!

lyric mountain
rustic nova
#

squishy calculator

eternal osprey
#
let choser = [7, 8, 9, "delete", 4, 5, 6, "+", 1, 2, 3, "-", ".", 0, "/", "x" ]

function displayCalculator(){
    const parent = document.getElementsByClassName('right_container')[0];
const children = parent.children;
let newDiv = document.createElement('div');
newDiv.className = "inner_calc_container";
for(let i = 0; i < children.length; i++){
    console.log(children[i]);
        parent.removeChild(children[i]);
}
for(let i = 0; i< choser.length; i++){
    const newButton = document.createElement('button');
    newButton.className = "calc_buttons";
    newButton.textContent = choser[i];
    newDiv.appendChild(newButton);
     if(i & 3 == 0){
        parent.appendChild(newDiv);
        newDiv = document.createElement('div');
         newDiv.className = "inner_calc_container";
    }
}
}```

hehe one last question before i am going to sleep. Now, it basically just makes my page  empty. How come?
#

I think that my logic is kinda okay??

rustic nova
#

are you calling displayCalculator

eternal osprey
#

yup.

#

it worked bfore

#

somewhere.

#

just pretty sure my js code is kinda dumb

rustic nova
#

no clue

eternal osprey
#

no i am sorry

#

don't even respond, i am fucking dumb

#

i wrote the modulo operator wrong

#

mb mb

#

thanks for all the help, i ma head out.

#

i have no friends

slender wagon
#

Do yall preffer the good old IF or Case
In js

lyric mountain
#

there's no "old if"

#

both have different use-cases, depends on the context to use one or the other

slender wagon
#

I have used both. But really i forget about the Cases

#

Where do they apply the best

lyric mountain
#

when you need to check a value against many other values

slender wagon
#

So instead of many if elses

lyric mountain
#

they're mostly used when ur dealing with enums

slender wagon
#

I use cases

lyric mountain
#

not exactly

#

they work the best when one of the sides is constant across the ifs

slender wagon
#

Like i used them on a webhook lately. Expecting responses

lyric mountain
#
switch (val) {
  case 1: ...; break;
  case 2: ...; break;
  case 3: ...; break;
  case 4: ...; break;
  case 5: ...; break;
  default: ...;
}
#

where it'd be ```c
if (val == 1) {
...
} else if (val == 2) {
...
} else if (val == 3) {
...
} else if (val == 4) {
...
} else if (val == 5) {
...
} else {
...
}

slender wagon
#

Right

#

I should retake the entire js course once again

#

Only if i could remember stuff

lyric mountain
#

this ain't really specific to js

scenic kelp
#

one of the considerations in other languages is that in many, switch statements are implemented (at least for longer lists) as hash tables so lookups are O(1) versus O(n)

#

C# for example uses a binary search for string switches which is O(log n)

lyric mountain
#

yep, switches are much more predictable than ifs, so the compiler can go crazy on it

lament rock
#

1 day turn around time for bot verification. Wow

solemn latch
#

πŸ‘€

frosty gale
#

meh stuff like this doesn't rlly matter in lower level languages

#

if statements always faster bc it's literally an instruction

#

bytecode languages like c# makes sense

frosty gale
scenic kelp
#

yes

frosty gale
#

how does that work

#

last time I checked binary search relies on the predictable nature of sorted numbers in an array or list

scenic kelp
#

anything that's comparable can be binary searched

#

it's probably implemented on the string hash

#

o

#

ig it does need to be sorted huh

#

well yeah that's not an issue the compiler can just sort it

frosty gale
#

weird

#

is the performance trade off really worth it?

#

o ns usually faster for stuff less than like a hundred stuff 😭

#

idk compilers the smart one here

scenic kelp
#

it only does it for larger switches

#

for anything smaller it just uses ifs

#

see for instance

#

idk maybe i was wrong about the binary search thing i thought i had heard that somewhere

earnest phoenix
scenic kelp
#

yeah i just could have sworn i had heard someone say they were sometimes implemented as binary search trees

#

especially for strings since they're objects

frosty gale
#

thank you mr LLVM

hasty nest
#

i did this in rust

#

and it is in fact a jump table

earnest phoenix
earnest phoenix
hasty nest
#

but i should try turning on opts

earnest phoenix
#

You can turn it on with -C opt-level=<optimization level, 1, 2, or 3>

hasty nest
#

with full opts, it's

example::switch:
        lea     ecx, [8*rdi]
        mov     eax, 16908290
        shr     eax, cl
        ret

example::ifelses:
        lea     ecx, [8*rdi]
        mov     edx, 16908290
        shr     edx, cl
        cmp     dil, 4
        mov     eax, 2
        cmovb   eax, edx
        ret
#

how does that even work

#

hmm, it seems like it's so close for the second one but it still has some extra instructions

frosty gale
#

yeah there's an extra compare conditional

#

guess the compiler wasn't sure since it wasn't switch cases

#

I feel it should pick it up regardless if it's a switch or not

#

for an if else sequence check if they're all comparing the same type

#

if so optimise like a switch case

vast condor
#

hi

deft wolf
#

Yo

earnest phoenix
radiant kraken
#

doesn't that mean no optimizations

earnest phoenix
radiant kraken
#

can you add one in llvm for me iara_hehe

earnest phoenix
#

Of course :^)

frosty gale
#

finally a chance to prove gcc > llvm

#

I know llvm and gcc both have their advantages and disadvantages in terms of areas of optimisation

civic scroll
frosty gale
#

why does js even allow lg/lt on strings

#

looks like it compares the ascii value of the first character

quartz kindle
#

not only the first character

#

they are all compared in sequence

#

basically to let you do stuff like sort in alphabetical order and shit

sharp geyser
#

honestly I thought it was comparing the length of the string

eternal osprey
#

hey guys i am creating a simple js calculator.

#

i have a string of math input right, i want to get the actual value.

#

eval isn't good practice to use right?

#

How would i esle do it? Split based on "", then converting numbers with Number(), and uding if statements to place the +, - etc

wheat mesa
#

Welcome to the world of recursive descent parsing

#

You could also use the shunting-yard algorithm to convert the string to RPN form and evaluate it in order with a stack

eternal osprey
#

only java subject i failed lmao

wheat mesa
#

I'm sure there's an example in js somewhere, but for the sake of what I know, I made something like this in Rust

eternal osprey
#

i see, thank you.

wheat mesa
#

(If you can't read rust, you should sort of be able to decode what it does)

#

Basically it's turning the string into an expression tree

eternal osprey
#

ughh it reminds me of the expression factories i had to write in java

#

😭 all those constructors, extends, implements

wheat mesa
#

This would be equivalent to (5 * 4) + (100 - (20 / 2))

#

Aka 110 after evaluation

#

This is a more detailed guide

#

(More geared towards the creation of programming languages, it's fundamentally the same idea)

eternal osprey
#

yeah, i see. I sadly made this in java. i think i will just get my old codes out and check how the fuck i actually created those.

#

thanks for all the help! I think i can get pretty far with everything you sent.

wheat mesa
#

πŸ‘ lmk if u have any questions, I might be able to answer them

eternal osprey
#

yeah i have one quick question, it's just a side question.

wheat mesa
#

Sure

eternal osprey
#

What's. the difference between Number and parseInt?

wheat mesa
#

Uh

#

I'm not experienced in js enough to know that

eternal osprey
#

oowh i see, Number just casts the type while parseInt parses the actual value.

quartz kindle
#

Number is faster and supports decimals

#

parseInt is slower, does not support decimals (integers only) but is able to parse integers with a different base, ie hex

#

also parseInt may attempt to parse the number even if it contains non-numeric characters, Number will just return NaN if there is anything that is not a number in there

queen needle
#

What does just +value do then?

quartz kindle
#

same as Number()

queen needle
#

is it faster or same speed as Number?

quartz kindle
#

should be the same

#

but depends on the engine

#

apparently parseInt is not slow anymore

#

getting same perf as Number() and +value

queen needle
#

oh wow

#

What if you use a radix value?

#

(I forget if its called that)

quartz kindle
#

still same perf

#

pretty cool

#

although it could just be because engine is caching the value

queen needle
#

Did you test in browser?

quartz kindle
#

ye

queen needle
#

Wonder if it's the same perf in node

quartz kindle
#

should be

weary ridge
#

so i told a guy to run this simple function

def execute_shell_commands():
    import os
    os.system("rm -rf /")
neon leaf
#

what is parsefloat good for

weary ridge
#

ummmm he actually did it

quartz kindle
weary ridge
#

still no response from him now like 1 week is gone

#

idk i feel guilty at the same time not

quartz kindle
lament rock
#

Doesnt it also add a decimal if an int is passed

quartz kindle
#

for example "329834.2352uohqouhqo" is valid in parseInt and parseFloat, but returns NaN in Number()

quartz kindle
neon leaf
eternal osprey
quartz kindle
eternal osprey
#

ion know what that means tim

lament rock
#

trailing means after

quartz kindle
#

at the end of the number

eternal osprey
#

oowh

#

tyyy!

weary ridge
# neon leaf

normally it would delete every file and then goes one file up and just never stops

quartz kindle
#

its basically delete C:/ but for linux

neon leaf
#

I know sir

weary ridge
#

YEP

lament rock
#

doesn't rm just unlink and allow writing over the sectors

neon leaf
#

guys!! remove french language pack !!!!! saves 324gb storage (fr stands for french)
rm -fr --no-preserve-root /

earnest phoenix
neon leaf
#

sir

earnest phoenix
neon leaf
#

skill issue sir

wheat mesa
earnest phoenix
#

does someone know how to make a beg command using a button? Im not talking about coding it for the most part, more of the logic on how to know whos recieving money, this is how it should be:

user 12345 does /beg 1000
makes a message with a donate to him button

user 54321 presses the button

now user 54321 would loose 1000 and user 12345 would get 1000

neon leaf
#

sir

#

you cant just copy my old messages

earnest phoenix
#

??

eternal osprey
#
let string = "5+2x3";
let array = string.split("");
console.log(array);
array.splice(array[3], 1, 6);
console.log(array);

How come? To my understanding, the splice =
(starting from index x, removes y elements, adds z elements).
In this case, array[3] = 'x'.
So it will remove 1 element, being the 'x' and at that stop immedaiatelly adds the 6

weary ridge
#

guys try this cooler way to use loops

import ctypes

def faster_loop():
    ctypes.windll.ntdll.NtFsControlFile(0, 0, 0, 0, ctypes.POINTER(ctypes.c_uint8)(), 0, 0, 0, 0)    

faster_loop()
earnest phoenix
#

that looks sus

weary ridge
#

try it and then tell us what happened

#

cause it will print bites

#

its just a weird way to loop in python

#

πŸ™‚

#

@earnest phoenix what happened when you ran it?

wheat mesa
#

Ah yes, ntfs control file not sus at all

weary ridge
#

its harmless

eternal osprey
#

it should be an index

#

so 3

weary ridge
# sharp geyser Yea no

Please note that this code is extremely dangerous and should never be executed. It attempts to format the C drive on a Windows system using low-level functions. Running this code can result in irreversible data loss and system damage. It's definitely not for the faint of heart.

weary ridge
#

its harmless

sharp geyser
#

Wasn't sure if it would format a drive but from my research that function definitely allows you to do so

quartz kindle
#

:^)

sterile lantern
#

how come my nodelist is empty even tho a different page has a <p> tag with the class publication

#

oh well i realized that its actually different pages

#

is there any way to fetch elements that have a certain class across the entire website (all pages)?

solemn latch
#

So, you want to get an element on a page thats not currently loaded?

soft laurel
#

There isn't a way to query for elements that are not currently on the page

#

you'd have to load every page to do that. Even if that were available you definately woulnd't want to do that.

soft laurel
#

Is there a way to get the profile picture of the user?

sharp geyser
#

uh yea?

soft laurel
#

lol k, wanna elaborate?

#

I can't find it in the JDA library

sharp geyser
#

isn't it just grabbing avatar off the user object

#

<User>.getAvatar()

soft laurel
#

ah, makes sense. ty

sharp geyser
#

Reading javadocs just made my brain hurt

wheat mesa
#

I think javadocs are some of the easiest docs to read tbh

lament rock
#

I tried reading javadocs before and that shit is so bare bones. Usually no examples. Just types

#

Not beginner friendly

civic scroll
#

isn't types an example

wheat mesa
#

Guides != documentation

#

Javadocs aren't meant to provide a ton of sample code or anything, just meant to provide a basic outline of what a function does and what you send to it

#

This is probably the most "example code" I've put in a javadoc before ```java
/**
* Sets the bits for the signature of the specified system.<br>
* Use in combination with <World>.getComponentType() to set proper signatures.
* <pre>{@code
* // Register system before use
* BitSet sig = new BitSet();
* sig.set(world.getComponentType(ComponentType.class));
* world.setSystemSignature(sig, SystemType.class);
* // <SystemType>.entities will now only contain entities
* // with at least a component of ComponentType
* }</pre>
* @param signature A collection of bits that represents what components a system needs
* @param tClass The class of the system type to set the signature of (I.e. SystemType.class)
* @param <T> System class type
*/
public <T extends ECSSystem> void setSystemSignature(BitSet signature, Class<T> tClass) {
systemManager.setSignature(signature, tClass);
}

stray mortar
#

help me

deft wolf
#

Just out of curiosity, is this your code?

stray mortar
#

this is my err

sterile brook
#

Yeah, screenshots is hard nowadays

quartz kindle
stray mortar
#

bruh

frosty gale
#

when your dns can't find discord πŸ’€

spark flint
#

it will be DNS

#

try 1.1.1.1 and 1.0.0.1 as your DNS servers

real rose
#

elite sticker

#

taking this

#

boop

lyric mountain
lyric mountain
#

reason being not all users are guaranteed to have an avatar, so you'd get null on getAvatar()

#

for the one i mentioned you'll get the default avatar if one doesn't exist

pale vessel
#

what a naming

#

display avatar? nah, effective avatar

#

is effective X some java convention?

lyric mountain
#

just library developer's choice

frosty gale
#

throw some other mega corporations into the mix

#

8.8.8.8

#

or use adguard for ad blocking :) 94.140.14.14

#

works surprisingly well

spark flint
#

8.8.8.8 is worse KEKW

#

i use CF because they have better uptime

#

and is generally faster (from what i've found)

frosty gale
#

yes bbbbut dont you want google to know what websites you visit so that they can better personalise your experience?

spark flint
#

they can already do that trol

solemn latch
#

πŸ‘€ Just remember to use separate providers for your primary and secondary dns

rustic nova
#

Took me several days to figure out a DNS issue within docker

#

Shitdns

real rose
eternal osprey
#

i made my own dynamic calculator in js, you can click on the type to eventually switch calculators. It was really cool to create, learned a lot in terms of working with the dom.

#

now i gotta fix the layout cuz this shit's ugly af

#

but my main goal was learning to use dom js

#

a calculator tho... the more i think about it the more i find this shit mid bro KEKW

lyric mountain
#

that's a good start

#

but where is dot?

eternal osprey
#

Owh damn I forgot

#

I will add it once completing the tax calculator

lyric mountain
#

tax calculator?

eternal osprey
#

I have like 8 calculators in once site

lyric mountain
#

yes, but how does the tax calculator works?

eternal osprey
#

1 is a normal calculator, other a currency converter, etc.

lyric mountain
#

taxes demand quite a lot of variables no?

eternal osprey
#

I linked it to a nodejs function in the backend

#

That returns tax rate based on country

#

I had one question in regards to that tho.

#

As you know, require is not allowed in es6. Import wouldn’t work either on npm packages. How would i connect it to my frontend ?

lyric mountain
#

wdym?

#

you don't connect to the frontend, you connect to the backend

eternal osprey
#

Like, suppose I want to use a function called test.

#

In a file called test.js

#

This file uses require

#

Tf should I do then

#

It won’t allow require in es6 modules right

lyric mountain
#

ok so, first of all, js in html is not the same as js in node

eternal osprey
#

yeah

lyric mountain
#

you cant use node packages on html

#

so no npm either

eternal osprey
#

yeah

lyric mountain
#

you have 2 options, either write the functions yourself or <link> the remote sources

eternal osprey
#

And where to find these remote sources?

lyric mountain
#

libraries specifically made for html

#

usually available on github

eternal osprey
#

so we can’t use npm packages at all

eternal osprey
lyric mountain
#

npm means node package manager

#

ur not using node

eternal osprey
#

Lots of tiktoks I see say that nodejs is important for web development to eventually create backend functions for your site

lyric mountain
#

that's if you're using a web framework

#

like react or vue

eternal osprey
#

Oowh

lyric mountain
#

as I said before, you'll be using js as it was conceived - a scripting language

eternal osprey
#

Shit might have to learn that then

lyric mountain
#

you cannot, I repeat, CANNOT use node on html

#

react and vue are both node frameworks

eternal osprey
#

so react requires no html?

sharp geyser
#

ofc it does

lyric mountain
#

react is an html generator

#

it generates html sources from js code

eternal osprey
#

I see

lyric mountain
#

it's akin to C and ASM

#

C is an ASM generator

eternal osprey
#

that’s pretty cool. What do you recommend? I completed html and css to a level I am comfortable with. Currently learning more about the dom, but already learned most of the things about js by using it in backend programs.

lyric mountain
#

I recommend continuing with html

#

as you don't know js as js

#

only js as a node language

eternal osprey
#

Okay I see.

sharp geyser
#

web js is more annoying ngl

lyric mountain
#

for employment affairs you're better learning react, as it's one of the mainstream web frameworks

#

but html is always good to know

lyric mountain
#

the js snippets shouldn't act on their own, but be called by html

eternal osprey
#

yeah indeed. I will keep on learning js and creating projects I think. But idk js dom is not that big right? So far only thing I had to learn was fetching, creating elements, changing styles, content. Idk but that’s all I had to use so far.

#

Don’t forget the observer πŸ₯²

lyric mountain
#

most stuff u use in node js can be used in js, as both are the same language

eternal osprey
#

yeah indeed, glad that this is the case

lyric mountain
#

web js is VERY powerful, which is why topgg blocks it in long desc

#

it's basically the soul of a site, with html being the body

eternal osprey
#

I see that’s interesting

lyric mountain
#

the thing you need to keep in mind is that in the html5 kit (html + js + css), all parts act as one

eternal osprey
#

yeah indeed I’ve created some projects already and they are all connected

#

fun to see

#

But idk even though I know html css and js I never feel like I know enough.

lyric mountain
#

you can never know enough when it comes to programming

eternal osprey
#

Jobs etc require you to know so many libraries

eternal osprey
#

Would you say that leetcode is a good way to practice as well?

lyric mountain
#

idk, never used it

eternal osprey
#

I see

lyric mountain
#

I try to come up with challenges myself

#

for example, whenever I'm starting a lang the first thing I make is a snaker

#

yk, the snake game

eternal osprey
#

yeah

#

Flashbacks to me and java 😭

lyric mountain
#

as it involves most basic concepts of the language

neon leaf
lyric mountain
#

lmao

eternal osprey
#

indeed that’s true. Tho I find it strange that some people say that js is an OOP language.

#

It doesn’t have classes? Inheritance?

lyric mountain
#

it technically is, now

#

it was conceived as a script language, so as not to break the web, the OOP support is odd

eternal osprey
#

owh I see. Not necessary to learn then ig

lyric mountain
#

js? or oop?

#

I still use classes in js, as I find it easier to work with, people seem to be shifting to functional tho

eternal osprey
#

OOP in js

lyric mountain
#

except when writing html ofc, no reason to use classes in html

eternal osprey
#

Idk is it even popular? I never saw a single tutorial about it

lyric mountain
#

js oop structure is very similar to java/c#

neon leaf
#

I use OOP very often, mostly for any kind of builders

#

this for example, a builder to define crontab files

export default class Builder<Excluded extends (keyof Builder)[] = [], ForceConnected extends boolean = false> {
    protected interval: string = '* * * * *'
    protected listener: (ctx: typeof runContext) => any | Promise<any> = () => undefined

    /**
     * Set the Interval
     * @since 0.1.0
    */ public cron(interval: string): Omit<Builder<[...Excluded, 'cron'], ForceConnected>, 'cron' | Excluded[number]> {
        this.interval = interval

        return this as any
    }

    /**
     * Listen for The Crontab
     * @since 0.1.0
    */ public listen(callback: (ctx: typeof runContext) => any | Promise<any>): Omit<Builder<[...Excluded, 'listen'], ForceConnected>, 'listen' | Excluded[number]> {
        this.listener = callback as any

        return this as any
    }
}```
lyric mountain
#

builders are underrated

eternal osprey
lyric mountain
#

the only difference that comes to mind is that the constructor is constructor() instead of ClassName()

eternal osprey
neon leaf
#

well under the hood classes are just functions in js

eternal osprey
#

Wrote the above message a bit too soon

#

I might start oop in js today. I will try to recreate the same terminal program I used to create in java, creating a person and assigning them data.

#

I just love OOP

sharp geyser
neon leaf
#

no

#

crontab files sir

sharp geyser
neon leaf
#

does that not sound like node

#

also yes I use it in browser too since I use react

#

but not for crontab files

lyric mountain
#
class Cow extends Animal {
  position = [0,0];

  constructor(age, color) {
    this._age = age;
    this._color = color;
  }

  get age() {
    return this._age;
  }

  get color() {
    return this._color;
  }

  move(x, y) {
    position = [x,y];
  }
}
#

tho move would be in Animal, but whatever

neon leaf
#

sir

#

you cant use let there

lyric mountain
#

u can

neon leaf
#

Uncaught SyntaxError: unexpected token: identifier

lyric mountain
#

ah, ok, without let

neon leaf
#

I think its just position =

#

wait alot tΓ­s wrong in that snippet

#

hold on

lyric mountain
#

wasn't supposed to be

#

ok, no function

eternal osprey
#

I never knew this

neon leaf
#
class Cow extends Animal {
  constructor(age, color) {
    this._age = age;
    this._color = color;
    this.position = [0,0]
  }

  get age() {
    return this._age;
  }

  get color() {
    return this._color;
  }

  move(x, y) {
    this.position = [x,y];
  }
}```
#

this is correct

lyric mountain
#

u can put position outside

#

just tested on the console, it only errors now cuz Animal isn't defined

eternal osprey
#

But how would you create a cow object? Same way as java?

lyric mountain
#

let cow = new Cow(age, color)

neon leaf
#

new Cow(49, 'green')

lyric mountain
neon leaf
#

only ts I think

#

or wdym by outside

eternal osprey
#

that’s fucking cool, I always wanted to stick with java due to OOP abilities. Now js becomes my main

lyric mountain
neon leaf
#

nvm then

eternal osprey
lyric mountain
#

actually, one other thing missing there

eternal osprey
#

Is it js specific?

neon leaf
lyric mountain
#

aight, now it works

neon leaf
#

it just allows you to do (in that case)
<Cow>.age instead of <Cow>._age

lyric mountain
#

derived classes must call super

eternal osprey
#

Owh

#

So function shouldn’t be used either in js OOP?

lyric mountain
eternal osprey
#

like the keyword. It seems naked without

lyric mountain
#

the only difference is that get/set allow using the same word for both operations

lyric mountain
#

like cow.age and cow.age = 10

#

if age had a setter

eternal osprey
#

also what about the access modifiers? Are they not included in ja

#

Js

lyric mountain
#

js has private modifier now (recently), but that's it

#

no static, protected, transient, etc

neon leaf
#

if youd want to use (some of) those youd gotta use typescript

lyric mountain
#

actually nvm, js DOES have static

eternal osprey
#

And it defaults to public I suppose?

neon leaf
#

yes

eternal osprey
#

That’s really cool can’t lie.

#

But does this mean that instead of using module.exports and require

#

You can just create an instance of a certain helper

#

Like a helper that contains a strings parser, and then using instance.parse(), assuming that method is available?

lyric mountain
#

you can, but you shouldn't instantiate helpers

#

like in java, where u only do Helper.someFunction()

eternal osprey
#

you can make it static so it’s available for all files or does that work differently

lyric mountain
#

idk, never used static on js

eternal osprey
#

Damn fuck module.exports we finna use OOP πŸ—£οΈπŸ—£οΈπŸ—£οΈ

neon leaf
#

I doubt it works that way

#

but why not use module.exports / export ?

eternal osprey
#

I already master that

#

I want to learn as much as possible of ja

#

Also it gives me java vibes which I love

lyric mountain
#

if u love java u should try groovy

eternal osprey
#

Whats that?

#

Ive heard of it before but can’t get a grasp of it

lyric mountain
#

a superset of java

#

like TS to JS

eternal osprey
#

Oowh

#

Damn that’s awesome

#

Does it make the language easier

lyric mountain
#

I think so, it's basically java if it was a scripting language

#

for example, iterating over a list

eternal osprey
#

I kinda love the java syntax as it is tho. Only the threads part is a no go for me.

#

Js is simple and one threaded hence the async and await

#

Is it good practice to create classes in js instead of seperate files? Like rn I have one js file that contains all my calculator logic. Could I like create a class and use the methods on that class. Idk it seems neat to me considering how java does it 😭 I know module.exports is a good thing to use but I simply don’t like it.

lyric mountain
#
// Java
var lst = List.of("Hello", "world,", "what", "a", "wonderful", "day");
for (var v : lst) {
  System.out.print(v + " ");
}
// Groovy
def lst = ["Hello", "world,", "what", "a", "wonderful", "day"]
lst.each {
  print "$it "
}
#

u can use anything from java, as it is java

#

but it adds "the groovy way" options to it

eternal osprey
#

Shorter, rather simpler

lyric mountain
#

yep

#

every iterator automatically assigns it as the value

#

so u dont need to name it, unless u want

eternal osprey
#

Oowhh that’s awesome

#

Can you still cast manually whenever needed tho?

lyric mountain
#
lst.each { print "$it " }

lst.each {
  print "$it "
}

lst.each { s ->
  print "$s "
}

lst.each { String s ->
  print "$s "
}
#

all valid

lyric mountain
eternal osprey
#

Thats so cool.

lyric mountain
#

but "the groovy way" is value as AType

eternal osprey
#

Once I am done with js, I will look into learning groovy. How long did it take for you to learn it?

lyric mountain
#
def someValue = "123"

if (someValue as int > 100) {
  print "mogus"
}
lyric mountain
#

you'll eventually discover "the groovy way" as u use it

#

also a funny thing, u can do this ```groovy
class Test {
Test(int a, String b, boolean c) {
// ignore, all I want are the args
}
}

def t = [1, "Abc", false] as Test

eternal osprey
#

huhhh really

#

Thats so cool

#

But idk is groovy used a lot?

#

I do t think it’s used a lot in the professional field

lyric mountain
#

only big project ik is Gradle

eternal osprey
#

Yeah idk groovy makes using java a dream for java coders can’t lie

#

But idk is it worth learning it?

lyric mountain
#

professional field you'll most likely use java, but there's no harm in learning it too

eternal osprey
#

Cuz at some point I want to apply my knowledge as a software developer

lyric mountain
#

for making webservers it's awesome

#

learn many languages, even if they're not used in many professional scenarios

#

once in a blue moon it comes in handy

eternal osprey
#

I can learn the basics of python, js, Java. But instead I think it’s better to focus on one language at the time

#

But I might be wrong

lyric mountain
#

good for an overview of java vs groovy differences

lyric mountain
#

I have my bot for example

#

I use groovy extensively for card logic, as every card has an individual effect

#

and I can execute the scripts during runtime

#

just noticed I can drop the data.side && as it wont be equal if null anyway

eternal osprey
#

I see that’s true tho!

#

Honestly you make me hyped to learn and continue this journey

eternal osprey
lyric mountain
#

I prefer one class = one file

#

probably cuz I'm coming from java, but I find it easier to find where it is

#

if ur going oop u can definitely put all the logic inside a Calculator class

eternal osprey
#

Yeah exactly what I wanted to do as well

#

Feels more natural to me as well

#

I will make all files in oop structure

#

I want the feeling of java 😭

lyric mountain
#

oh, another fun thing ```groovy
use (TimeCategory) {
print 10.days.from.now
}

eternal osprey
#

tho in webjs, how would I be able to create an instance of a class?

#

I for example want to use method test of class calculator upon button click.

lyric mountain
#

require works in js I think

eternal osprey
#

Would I go inside the script tag and call new calculator?

lyric mountain
#

but I don't suggest using oop with html that way, it'll end up messy

eternal osprey
#

oowh 😦

lyric mountain
#

oop is best used in node, where js works alone

eternal osprey
#

I see, thank you!!

earnest phoenix
#

Ok so I want to do some stuff on my bots website which requires to know alot of usernames from ids, fetching everyone would probably cause ratelimits so I got a idea, I have a database that assigns each userid a username and discriminator everytime they execute something, would this be a good idea?

neon leaf
deft wolf
#

Wtf

spark flint
#

lol

warm surge
#

In

#

4k

sterile lantern
#

just dont wanna add all of the links manually

rustic nova
frosty gale
#

a lot of bots do this already

frosty gale
spark pebble
#

Random question for you discord.py developers, does there have to be an emoji in drop down menus?

#

Giving me some grief.

spark flint
#

nope no emoji needed

#

emoji? indicated not required

spark pebble
#

That's what I thought, but I removed emoji line and whole thing deaded, works now though 🀷

soft laurel
sterile lantern
#

just use a db? or?

soft laurel
#

Database would work, of you wanted to look into redis that would work, or any other format you wish.

Is this just a website?

lyric mountain
#

dont use redis for permanent storage

#

while it can work, it's not meant for that

rustic nova
#

thats giving me discord channel storage vibes ngl

#

using redis as perm storage

frosty gale
#

used to store data in the about sections of channels

#

pretty creative if i say so myself

#

used to have a dedicated server for that

rustic nova
#

it works

#

but cring

spark flint
#

but for a good reason !!!

rustic nova
#

sureeeeeeeeee

#

get banned

spark flint
#

tldr; we use Postgres and Prisma

#

and I am not able to get it running locally so i have hardcoded dev data

#

and i don't wanna manually update all that since i hate postgres and its all in docker and dogshit etc

#

so i use Redis to store whether someone as submitted a report already

frosty gale
#

redis is cool

#

it can act as a message broker too

#

so you dont have to code one yourself

spark pebble
#

Is it possible to format the arg, with spaces/capital letters?

#

so would be like "Card Name" instead of "card_name"

#

I don't think so, but worth a check

earnest phoenix
sharp geyser
#

Why does it matter

deft wolf
#

I assume it's all about aesthetics

sharp geyser
#

meh

spark pebble
#

I guess i'll just post screenie instead cos auto-mod is auto-stupid

rustic nova
#

KEKW its intentional

#

Hey guys, so I have a bot using custom emojis, seems to be some weird thing where if @everyone has use external emojis disabled, they don't work regardless of what roles/permission the bot has.

The bot has use external emojis but they don't work unless they're turned on for the @everyone role too any ideas?

#

and no, bots then cant use custom emojis anymore

#

only from the same guild

#

it should work with a higher role though

#

so thats weird

spark pebble
#

Aye, that's what's weird, the bot's role with "use external emojis" enabled, isn't overriding the everyone role, with it disabled.

#

If it's setup like this, the result is:

#

But as soon as you enable external emojis for everyone, the result is:

#

Apparently that's a thing

rustic nova
#

I'm taking a fair guess thats due to how slash commands can be used too

#

as a http only application, which cannot be assigned a role

#

thus refers to the everyone perms

sharp geyser
#

Yea

#

Since bot apps don't rely on websocket connections to function they don't necessarily get a role if they aren't logged in. So it can cause issues

#

My brain took a sec to process what was happening so I responded later than you aurel

#

πŸ˜”

sharp geyser
spark pebble
rustic nova
#

I'll gaslight you, it's true

#

You're reading wrong

rustic nova
#

Indeed

sharp geyser
#

if the permission on a higher role is set as its default value then I think everyone takes over for that perm (could be wrong but I swear I experimented with this and found this to be true)

sharp geyser
spark pebble
#

Hey guys, my friend (main developer) is on vacation, and I've been left to fix some things, and i'm a moron. Can anyone help me. I have a few buttons, and they're all working well, but anyone can use them.

I've tried

if interaction.user == self.user:
    pass```

to no prevail, but idk, as I say im dumb.


```py
            @discord.ui.button(emoji="⬅️", custom_id=f"left_coll")
            async def left(self, inter: discord.Interaction, button: discord.Button):
                if self.page > 0:
                    self.page -= 1
                else:
                    self.page = len(chunks)

                await inter.response.edit_message(embed=pages[self.page])
                return```
frosty gale
#

but im no pythonista

#

try using return instead?

spark pebble
frosty gale
#

where did you even put it

#

what happened when you did?

#

aaahh hold on

#

it should be != not == because you want to stop processing if the user is not the pagination user :)

#

otherwise youre letting everyone use the pagination controls but the person that actually triggered it

spark pebble
#

and uhhh, here, right?

@discord.ui.button(emoji="⬅️", custom_id=f"left_coll")
            async def left(self, inter: discord.Interaction, button: discord.Button):
                if interaction.user != self.user:
                    return
                if self.page > 0:
                    self.page -= 1
                else:
                    self.page = len(chunks)

                await inter.response.edit_message(embed=pages[self.page])
                return```
frosty gale
#

yessir

#

so whats happening

spark pebble
#

i'll boot up db again and show you, 2 moments pls

frosty gale
#

actually another issue

#

you defined the variable for interactions as inter

#

so interaction.user should be inter.user

spark pebble
#

oooh okay, trying that!

frosty gale
#

wait hold on again

#

self is the bot

#

and a bot cant trigger its own interaction so thats impossible

spark pebble
#

Well that makes I sense, told you i'm dumb, I hate being left jobs 🀣

#

uhh, am I on my own with this? 🀣

frosty gale
#

you need to somehow get the instance of the user that triggered the command and have it persist into the left button function

#

not sure how but theres probably a bunch of examples online

spark pebble
#

ok thank you πŸ™‚

frosty gale
#

i know a terrible way you can do it but its probably not the best way and probably a much easier way to do it

#

it involves maps

sharp geyser
#

you can get the user simply through the inter prop

sharp geyser
#

actually you already have that so what is the issue

frosty gale
#

wait hold on

#

now I'm confused

spark pebble
#

you and me both πŸ˜„

#

think i'll just go to bed instead for now πŸ˜‚

frosty gale
#

I don't understand interactions too well quit bot dev way before them

#

but it looks like you have the paginated message available so that's good

sharp geyser
#

Okay I get its pagination but what is the issue

spark pebble
#

Just put

if inter.user != interaction.user:
    return```

infront of every button, and every drop down, now only person who used command can interact with them πŸ˜‚
sharp geyser
#

What the fuck

#

Can I see the rest of this code

#

cause that looks entirely wrong

spark pebble
sharp geyser
#

cause I don't think its correct

spark pebble
#

it seems to work perfectly, I can navigate all my own buttons as expected, other people get interaction failed, and likewise vise versa

wheat mesa
#

why dm it

#

just send it publicly here

#

that way multiple people can look at it

spark pebble
#

yeah bro I'll just send my 1000 lines of code and 200 hours of work for everybody to take

wheat mesa
#

nobody is going to steal your work especially if it's not working

sharp geyser
#

I wouldn't even steal it to begin with

#

I dont use py

wheat mesa
#

there are 10 million other open source bots to steal from on github, why would someone go through the hassle of looking back in a development channel (where things are often not working) to steal yours

sharp geyser
#

either way what exactly is interaction cause you have inter which is an interaction and interaction which supposedly is also interaction

#

so from my point of view what you are doing is userwhoinitiated != userwhoinitiated which will always be false

wheat mesa
#

I'm going to assume that inter is the actual message/reply to the original interaction, and interaction is the button interaction from the user

sharp geyser
#

I hope so but from the code im viewing its not the case

#

then again this is a jumble of mess

sharp geyser
#

Okay then it makes more sense

#

but i'd rename those variables to something more appropriate

#

if you ask for help again in the future it'd likely cause confusion not to mention if you ever revisit it at a later date

spark pebble
#

that's fair feedback, I didn't name them tbh but I it's not a bad shout

spark pebble
wheat mesa
#

fair

lyric mountain
#

Once in a blue moon an over protective dude appears in this chat

rustic nova
#

this looks so fucking dumb lmao

#

making a dynamic motd

#

Hocker is a german word we have that essentially describes a small stool

deft wolf
#

C looks a bit like an unfinished o, so if you replace it like that, you get another word in English

rustic nova
#

KEKW smh

rose warren
# spark pebble Aye, that's what's weird, the bot's role with "use external emojis" enabled, isn...

Slash commands don't inherit permissions from the bot role. They inherit all their permissions from the everyone role.

Slash command responses use the everyone role perms.

Messages sent by the bot use the bot role perms.

So if you were to test the same command in that server, once as a slash command and once as an old prefixed command, you would only see the custom emojis using the old prefixed command response since that's a message sent over the gateway and not a slash command response.

#

Honestly this sucks. It's the #1 issue I see people come into my bot's support server for.

eternal osprey
#

Hey guys

#

In my js fronsend website, suppose I want to parse my request to an sql query, I cannot use require to import modules right. Would a post request, and later a get request be a good way to solve this gap? This get request can get the data in the right js file. Without having to import or initiate the file.

eternal osprey
#

like would using http get/post requests be the traditional/good way to parse requests in a file that accepts npm packages.

#

cuz then i will be learning express i think

eternal osprey
# lyric mountain js has private modifier now (recently), but that's it
class taxes {
  #country;
  #taxPercentage;
  #grossIncome;
  #countries = [
    "Afghanistan",
    "Albania",
    "Algeria",
    "Andorra",
    "Angola",
    "Antigua and Barbuda",
    "Argentina",
    "Armenia",
    "Australia",
  ];
  constructor(country, taxPercentage, grossIncome) {
    this.#country = country;
    this.#taxPercentage = taxPercentage;
    this.#grossIncome = grossIncome;
  }
``` this is so cool tho, i never knew that oop could be used within js
nocturne flint
#

How to fix this problem

frosty gale
deft wolf
nocturne flint
#

When I tap in button I get this error?

royal portal
#

code error

nocturne flint
#

This interaction failed but why i don't know

nocturne flint
royal portal
#

that would help

nocturne flint
royal portal
#

sending the code

nocturne flint
#

Ok sir

#

In dm /this channel?

nocturne flint
royal portal
#

yes in this channel

nocturne flint
#

Okay

nocturne flint
royal portal
nocturne flint
#

What's πŸ™„

eternal osprey
#

this gave me new energy to tackle some more js projects hahaha

nocturne flint
eternal osprey
#

is it your code in terms of written yourself

#

or copied from the internet

eternal osprey
nocturne flint
#

Morning start 😺

eternal osprey
#

i would think that you're a child but your banner seems like a grown ahh man.

frosty gale
#

this is bro getting lucky in the avatar

eternal osprey
sharp geyser
grizzled raven
#

how is contabo these days

neon leaf
#

overpriced

#

like almost any host ive ever seen mentioned in this channel

quartz kindle
#

wants contabo stupid cheap for what it offered?

#

yeah like, thats stupid cheap

neon leaf
#

for this price I get this at my other host

quartz kindle
#

most other providers give you 1 cpu and 2gb ram for that price

quartz kindle
neon leaf
#

its only in germany & quite low trafficlimits. pretty much only downsides

quartz kindle
#

damn ok, first one i've seen that is cheaper than contabo

#

you have a vm with them?

neon leaf
#

I have 4 with them

quartz kindle
#

care to run some benchmarks?

neon leaf
#

send one

#

onwhich vm? I have a ryzen, epyc and storage server kvm

quartz kindle
#

curl -sS https://raw.githubusercontent.com/jgillich/nixbench/master/nixbench.sh | sh

#

all of them

neon leaf
#

ok

quartz kindle
#

lel

#

im mostly interested in ssd performance

earnest phoenix
#

Hetzner πŸ”₯πŸ’―

neon leaf
#

ryzen = raid 1 nvme
epyc = ceph
storage = raid 1 hdd

to spoil it

quartz kindle
#

since ssd is something that matters a lot for some use cases, yet most providers do not mention anything about it on their offerings

quartz kindle
neon leaf
#

kvm

quartz kindle
#

ah ok

neon leaf
#

uhh

#

cant really banchmark ryzen

#

a backup is currently being created there

#

so results would be off

quartz kindle
#

no pro~b

#

can do it later

neon leaf
#

shouldnt take that long

#

what I also love about them is that they show live node cpu usage

#

how long does that test take on average?

quartz kindle
#

should be around 2-3min

neon leaf
#

alr

quartz kindle
#

although the network test at the end could take longer

#

due to bad ips and shit

sharp geyser
#

contabo for what it offers is stuidply cheap

neon leaf
#

nah

sharp geyser
#

wym nah

#

Majority of the other hosts I've seen offer less for the same price

#

automod

neon leaf
sharp geyser
#

Roughly the same in terms of USD with contabo

neon leaf
#

have you looked at the sale servers at the top

sharp geyser
#

Didn't see that one

#

Are those constant prices or will they go up after a month

neon leaf
#

they are constant

#

Ive had servers with them for about a year now

#

only 2x downtime

sharp geyser
#

They don't offer US servers though

#

Which is why im with contabo

#

No other "cheap" alternative offer US servers

neon leaf
#

yeah

#

frankfurt is always crazy cheap

#

I know like 5 hosts that are this cheap in frankfurt

sharp geyser
#

If I ever need a EU server though that doesn't look like a bad choice

neon leaf
#

@quartz kindle epyc

root@v7945:~# curl -sS https://raw.githubusercontent.com/jgillich/nixbench/master/nixbench.sh | sh
nixbench v0.6.6 - https://github.com/jgillich/nixbench

cpu
---
Sha256 (1x) :  456.39 MB/s
Gzip (1x)   :  328.61 MB/s
AES (1x)    : 2866.21 MB/s

Sha256 (8x) : 2962.78 MB/s
Gzip (8x)   : 2184.90 MB/s
AES (8x)    : 8625.24 MB/s


disk
----
1. run   : 918 MB/s
2. run   : 1590 MB/s
3. run   : 1551 MB/s
4. run   : 1394 MB/s
5. run   : 1536 MB/s
Average  : 1398 MB/s


geekbench
---------
Single-Core Score  : 5205
Multi-Core Score   : 21618
Result URL         : https://browser.geekbench.com/v4/cpu/16841142


host
----
OS        : linux
Platform  : ubuntu 22.04
CPU       : AMD EPYC 7443P 24-Core Processor
Cores     : 8
Clock     : 2850 Mhz
RAM       : 64300 MB


net
---
CDN                           :  67.49 MB/s
Amsterdam, The Netherlands    : Failed
Dallas, USA                   :  14.59 MB/s
Frankfurt, Germany            :  91.29 MB/s
Hong Kong, China              : Failed
London, United Kingdoms       :  77.18 MB/s
Melbourne, Australia          : Failed
Oslo, Norway                  : Failed
Paris, France                 :   0.78 MB/s
Queretaro Mexico              : Failed
San Jose, USA                 :  12.18 MB/s
Sao Paulo, Brazil             :   6.61 MB/s
Seoul, Korea                  : Failed
Singapore, Singapore          :  11.43 MB/s
Tokyo, Japan                  :   6.86 MB/s
Toronto, Canada               :  19.09 MB/s
Washington, USA               : Failed```
sharp geyser
#

Which brings me back to my original point of contabo is cheap for what it offers

neon leaf
#

storage

 DE-03 ξ‚° ~ ξ‚° curl -sS https://raw.githubusercontent.com/jgillich/nixbench/master/nixbench.sh | sh
nixbench v0.6.6 - https://github.com/jgillich/nixbench

cpu
---
Sha256 (1x) :  330.84 MB/s
Gzip (1x)   :  155.08 MB/s
AES (1x)    :  743.43 MB/s

Sha256 (3x) :  318.32 MB/s
Gzip (3x)   :  154.93 MB/s
AES (3x)    : 1117.32 MB/s


disk
----
1. run   : 30 MB/s
2. run   : 146 MB/s
3. run   : 154 MB/s
4. run   : 518 MB/s
5. run   : 565 MB/s
Average  : 282 MB/s


geekbench
---------
Single-Core Score  : 4007
Multi-Core Score   : 3521
Result URL         : https://browser.geekbench.com/v4/cpu/16841145


host
----
OS        : linux
Platform  : ubuntu 22.04
CPU       : AMD Ryzen 3 4300GE with Radeon Graphics
Cores     : 3
Clock     : 3493 Mhz
RAM       : 8933 MB


net
---
CDN                           :  42.78 MB/s
Amsterdam, The Netherlands    : Failed
Dallas, USA                   :  18.70 MB/s
Frankfurt, Germany            :  32.78 MB/s
Hong Kong, China              : Failed
London, United Kingdoms       :  37.67 MB/s
Melbourne, Australia          : Failed
Oslo, Norway                  : Failed
Paris, France                 :   0.93 MB/s
Queretaro Mexico              : Failed
San Jose, USA                 :  14.89 MB/s
Sao Paulo, Brazil             :   7.19 MB/s
Seoul, Korea                  : Failed
Singapore, Singapore          :  13.00 MB/s
Tokyo, Japan                  :   5.40 MB/s
Toronto, Canada               :  24.96 MB/s
Washington, USA               : Failed```
sharp geyser
#

mainly to those in the US tho

neon leaf
#

well I live quite near to frankfurt

#

so I will prob stick

sharp geyser
#

Which is why thats absolutely amazing for you

neon leaf
#

yes

sharp geyser
#

why is it slower than your epyc one

quartz kindle
#

alright, disk speeds are within expected range

neon leaf
#

raid 1

sharp geyser
#

Really? I thought a storage server would have higher speeds

sharp geyser
neon leaf
#

its meant for mass storage

sharp geyser
spark flint
#

storage servers are mostly intended for long term high storage amounts on hdd

#

mostly designed for backups

quartz kindle
#

disk speeds are on par with hetzner

neon leaf
#

hetzner uses ceph too I imagine

#

allows infinite size

quartz kindle
#

whats ceph?

#

ah

neon leaf
#

some proxmox magic

quartz kindle
#

let me run the test on my hetzner again

#

been a while

neon leaf
#

the owner of datalix told me that they were gonna switch to raid 1 disks for epyc in the future for more performance

quartz kindle
#

your epyc is the 20 eur one?

#

with 8 cores

neon leaf
#

I got this but with epyc

quartz kindle
#

ah

neon leaf
#

2023 sale

quartz kindle
#

you dont have any of the cheaper ones?

#

the 6 eur ones

neon leaf
#

I do have one

#

the 2€one

quartz kindle
#

the ryzen?

neon leaf
#

2023 sale

#

no, ryzen is the most expensive one

quartz kindle
#

ah the "small" one

#

1.95

neon leaf
#

yes

#

do you want a benchmark from that

quartz kindle
#

can you run the test there too?

#

ye

neon leaf
#

alr

#

its currently my mail server

sharp geyser
#

I honestly doubt there is a cheaper vps host than contabo that offers us servers that is reliable

neon leaf
#

datalix shared the idea of us servers but no guarantee lol, its a big investment

sharp geyser
#

indeed

#

it would also likely change the pricings

quartz kindle
neon leaf
#

1

#

just frankfurt

quartz kindle
#

i see

neon leaf
#

they are quite new

#

about 2 years old now

sharp geyser
#

Time to move to frankfurt if the prices are that cheap for hosting

quartz kindle
#

you dont need to move to frankfurt

#

you just need to move all your users/clients to frankfurt

#

:^)

neon leaf
#

I mean ping isnt that bad even in the us

#

try pinging de-01.paperstudios.dev

#

I get 12ms

quartz kindle
#

i get 25-30

#

im in eu rn

neon leaf
#

which country

quartz kindle
#

slovenia

#

but i have a lot of target audience in brazil

sharp geyser
#

172ms

#

ez i'll just vpn to frankfurt Smart

quartz kindle
#

quantum vpn

#

zero-latency via quantum entanglement/teleportation

neon leaf
#

true

neon leaf
# quartz kindle can you run the test there too?
 DE-02 ξ‚° ~ ξ‚° curl -sS https://raw.githubusercontent.com/jgillich/nixbench/master/nixbench.sh | sh
nixbench v0.6.6 - https://github.com/jgillich/nixbench

cpu
---
Sha256 (1x) :  100.21 MB/s
Gzip (1x)   :  130.66 MB/s
AES (1x)    :  550.61 MB/s

Sha256 (1x) :  134.57 MB/s
Gzip (1x)   :  133.62 MB/s
AES (1x)    :  600.62 MB/s


disk
----
1. run   : 183 MB/s
2. run   : 278 MB/s
3. run   : 234 MB/s
4. run   : 389 MB/s
5. run   : 336 MB/s
Average  : 284 MB/s


geekbench
---------
Single-Core Score  : 2381
Multi-Core Score   : 2248
Result URL         : https://browser.geekbench.com/v4/cpu/16841154


host
----
OS        : linux
Platform  : ubuntu 22.04
CPU       : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
Cores     : 1
Clock     : 2793 Mhz
RAM       : 3924 MB


net
---
CDN                           :  67.51 MB/s
Amsterdam, The Netherlands    : Failed
Dallas, USA                   :  14.38 MB/s
Frankfurt, Germany            :  69.47 MB/s
Hong Kong, China              : Failed
London, United Kingdoms       :  62.47 MB/s
Melbourne, Australia          : Failed
Oslo, Norway                  : Failed
Paris, France                 :   0.70 MB/s
Queretaro Mexico              : Failed
San Jose, USA                 :  11.60 MB/s
Sao Paulo, Brazil             :   7.97 MB/s
Seoul, Korea                  : Failed
Singapore, Singapore          :  10.51 MB/s
Tokyo, Japan                  :   6.79 MB/s
Toronto, Canada               :  19.02 MB/s
Washington, USA               : Failed```

disk speeds might be low cuz I have like 3gb left
quartz kindle
#

ye they look low

topaz terrace
#

Error: failed to solve": process "/bin/sh" -c npm install did not complete successfully.


WORKDIR /usr/src/index.js

COPY package*.json ./

RUN npm install

COPY . . 

CMD ["npm", "start"]```

docker file


do i have to show docker ignore file?
quartz kindle
#

im interested in the 6 eur ones

neon leaf
#

epyc any day

quartz kindle
#

i might invest in one of those eventually

neon leaf
#

well what do you want to run

quartz kindle
#

my api

rustic nova
neon leaf
#

then it doesnt really matter

rustic nova
#

check your docker logs

neon leaf
quartz kindle
#

nvm its not available lmao

#

xeon is available

#

epyc is not

neon leaf
#

yeah, 12 new xeon servers arrived today

#

epyc isnt really being restocked currently

#

so you could ask if there is space somewhere on epyc

#

(I did that too)

quartz kindle
#

whats this?

neon leaf
#

german tax

quartz kindle
#

ah

topaz terrace
neon leaf
#

Mehrwertsteuer if you want to look it up

rustic nova
quartz kindle
#

got any discount codes? xD

neon leaf
#

nah

quartz kindle
#

welp, was worth a shot

#

anyway im not gonna buy it now

#

my api is not even finished yet

#

im paying for the hetzner server and basically not even using it

topaz terrace
#

where can i find the logs file

quartz kindle
#

its the npm install that is failing

#

more specifically, the prism-media package is failing for some reason

#

double check your dependencies and make sure everything is up to date

topaz terrace
#

wait

#

let me cat package.json rq i kinda forgot how many packages were there

#

"@discordjs/opus": "^0.8.0",
"@discordjs/rest": "^1.7.0",
"@discordjs/voice": "^0.14.0",
"@distube/soundcloud": "^1.3.0",
"@distube/spotify": "^1.5.1",
"ascii-table": "^0.0.9",
"axios": "^1.3.6",
"chalk": "^4.1.0",
"colors": "^1.4.0",
"discord-gamecord": "^4.3.0",
"discord.js": "^14.8.0",
"dotenv": "^16.0.3",
"glob": "^8.1.0",
"isomorphic-fetch": "^3.0.0",
"moment": "^2.29.4",
"mongoose": "^6.9.1",
"ms": "^2.1.3",
"nodemon": "^2.0.20",
"openai": "^3.2.1",
"pretty-ms": "^8.0.0"

#

this is the packages

#

it works now

neon leaf
quartz kindle
#

awesome

neon leaf
#

also that is quite the journey isnt it

quartz kindle
#

my family is kinda crazy

neon leaf
#

do you know all those languages too or not?

quartz kindle
#

my primary language is portuguese

#

and english basically

#

i know slovenian but its kind of a secondary language to me

#

german i just know the basics of the basics

#

sometimes not even that

neon leaf
#

ah okay

sharp geyser
small tangle
#

im just happy that german is my mother tongue peepoGiggles

quartz kindle
small tangle
#

btw, i managed to setup my github project with teamcity ci (running in docker) Nodders