#dev-general

1 messages ยท Page 109 of 1

remote goblet
#

orjustlikelearnjavaandcreateyourownframework

hot hull
#

(UP ew)

errant geyser
#

Ori shut

#

If people did that I wouldn't be able to flex on Frosty that he needs my framework

obtuse gale
#

orjustlikelearnjavaandcreateyourownframework
@remote goblet I can but idk i am working on a really big project and i am just looking for now for a framework

hot hull
#

Katsu, I don't, I mean it'll save me like 10 minutes overall :kek:

errant geyser
#

Still 10 mins saved

#

I'm taking it

#

Let me have it, ok?

hot hull
#

You can btw, (gonna be doing that myself tommorrow), was planning on having a map with items in a specific slot, and just iterrating through it while on a delay

ocean quartz
#

But yes you can make animations with it

heady birch
#

AnimationsExpansion

obtuse gale
#

@errant geyser how do i set titles on items and lores then

#

oh wait

#

nvm

#

lmao

errant geyser
#

k

topaz bay
#

@quiet depot you can read kotlin right?

quiet depot
#

probably

#

never really tried

#

@topaz bay ping cuz late response

topaz bay
#

I'm gonna put something on github, and I want your opinion.

quiet depot
#

ok

topaz bay
#

Its kinda big, I'm sorry

quiet depot
#

so, what kind of opinion do you want?

#

like a code review or something?

topaz bay
#

@prisma wave @ocean quartz feel free to opine as well

#

Uhhh I don't actually know...

#

I just want to know whats in your head as you look at that codebase

quiet depot
#

srp violation in Arcade.kt imo

#

"stupid arrow game" oitq is great, not stupid

ocean quartz
#

Is val currentGame = null as? Game the same as val currentGame: Game? = null?

topaz bay
#

Yes

#

@quiet depot do elaborate on how arcade is in violation of SRP?

quiet depot
#

oh it's not, nvm

#

i'm not very kotlin literate apparently

#

could Arcade#namespace be a constant?

topaz bay
#

yes, and no

#

Yes, because you can create a namespace instance without a plugin

#

No, because they tell you literally to not do that

#

lol

quiet depot
#

oh

#

Game.kt would probably benefit from being split up a bit lol

#

nearly 1k lines damn

topaz bay
#

I tend to not worry much about line count

#

I could theoretically move the listeners out of the class

#

But they are extremely tightly coupled

#

Doesnt really make sense in my head

quiet depot
#

idk dude

#

from what I've seen so far, everything looks fine

#

I personally find it extremely confusing, but I assume that's due to my lack of experience with kotlin

topaz bay
#

Anything in particular you find confusing?

#

That kinda sucks to hear, I tried to make it really simple

quiet depot
#

I find the kotlin syntax confusing, your logic flow is fine

#

I'll see if I can find a specific example

topaz bay
#

Damn

#

You should learn kotlin dude

#

Its the fuutttuuurrreee

ocean quartz
#

I think it's fine as well, easy to understand what does what

topaz bay
#

Now... say for example... someone were to present this repository as previous work on an application

#

How do you think that would work out for them?

quiet depot
#

I doubt the interviewer would even mention it

topaz bay
#

wdym?

quiet depot
#

well, imagine you got far enough for an irl interview, and you had that link on your original application

#

I doubt it would come up in conversation. The interviewer probably didn't even thoroughly look at the code, they didn't need to. You'll be proving you can write code during that irl interview

topaz bay
#

Well the thing is, its remote work, and its specifically work that has to do with what this is

quiet depot
#

o, so no irl interview

#

in that case, it would probably come up in conversation lol

#

and would be a great indicator of competence, once there's documentation

topaz bay
#

Well thats not good

#

I like coming off as incompetent

#

lol

quiet depot
#

I'll amend my statement

topaz bay
#

APPEND

#

LOL

quiet depot
#

and would be a great indicator of competence, once there's documentation, and a respectable brace placement

topaz bay
#

SUCK MY ASS

obtuse gale
#

If I have

data class RoleData(
        @JsonProperty("role_id")
        val roleId:String,
        @JsonProperty("emote_id")
        val emoteId:String
)``` and a `Map<String, RoleData>` is it possible to get a roleId by a emoteId?
topaz bay
#

Allman is supreme

quiet depot
#

supremely trash

topaz bay
#

wrong

quiet depot
#

wtf is JsonProperty

topaz bay
obtuse gale
#

jackson

quiet depot
#

just use a field naming policy

obtuse gale
#

idk how to do that with jackson lol

#

just ignore it tho

quiet depot
#

then use gson

#

what you need jackson for

obtuse gale
#

Its already in my project from spring

quiet depot
#

lame

topaz bay
#

Could also just use korm

#

lol

obtuse gale
#

na

topaz bay
#

North America

obtuse gale
#

any idea tho lol?

topaz bay
#

I don't use jackson

#

So no...

obtuse gale
#

its not really a jackson question lol

quiet depot
#

jackson has field naming policies, use them please

obtuse gale
#

how

quiet depot
obtuse gale
#

alright

topaz bay
#

what is the string in that map?

#

the role_id value?

obtuse gale
#
{
  "x": {
    "role_id": 2222222,
    "emote_id": 333333
  },
  "y": {
    "role_id": 444444,
    "emote_id": 55555
  }
}```
#

x or y

#

obv that will be changed tho

topaz bay
#

so like... values.find { it.emote_id == {what I'm looking for} }?

obtuse gale
#

val type = fileComponent.readRoles().values.find { it.emoteId == "2222222" }
So would this give me a RoleData? that has the emoteId 33333

topaz bay
#

Yes

#

It's worst case O(N) though

#

So like....

obtuse gale
#

just wondering, this will never happen, but what if two things had 222222

topaz bay
#

beware...

obtuse gale
#

also wtf is O(N)

topaz bay
#

The method youre using, "find"

#

will return the first object it comes across

#

that matches the predicate

obtuse gale
#

ah ok

topaz bay
#

O(n) is time complexity

#

It means the time it takes to do that operation is directly proportional to the amount (n) of elements

obtuse gale
#

ah

topaz bay
#

It is "worst case" O(n) because the element youre looking for can be anywhere in that collection

#

Could be the first, could be the last

#

This is in contract to index lookups, like get on a map being O(1)

#

Meaning the time it takes to find an element by its key is constant

#

No matter how many things are stored in a map

obtuse gale
#

ah

topaz bay
#

Fun right?

#

Google "big o cheat sheet" if you want to look at a bunch of examples of time complexities for common operations

heady birch
#

remember

#

higher the better

prisma wave
#

O(n!) Masterrace

pastel imp
#

yo bois.. soo.. never used loops before so I am kinda confused.. but.. like.. I am trying to add 10 to num each time it loops one thing... so... like
world1 = 10
world2 = 20
etc etc...
I remember skript works like this from some ages ago when I worked with it but I don't rlly remember when I learned java about this... or atleast I think I never saw it...

obtuse gale
#

you're making a new int every iteration arent you?

prisma wave
#

declare num outside of the loop

#

Yes

#

Also is this forge? It's definitely not spigot

obtuse gale
#

also eclipse

hot hull
#

How have you never made a loop

#

And did you just mention doodoo, you should be ashamed for that

prisma wave
#

Comparing Java to skript

#

Unacceptable

hot hull
#

That's death by stonning

obtuse gale
#

frcsty theres only one person here who should be ashamed of something

hot hull
#

And that's not me

obtuse gale
#

you know what im talking about

#

deny it all you like

pastel imp
#

I am not creating the int inside the loop.. I already have it outside... it just hasn't a value... and also.. I did loops... but never rlly learned or atleast remember learning how I would do what I am speaking about rn...

obtuse gale
#

you are creating it inside the loop lol

hot hull
#

You're defining num inside the loop tho

pastel imp
#

also.. I also say skript isn't even near to java.. obviously... I was a skripter some big 4 years ago that's just what I remembered

#

and srry if I somehow ofended you?

#

also.. it's mcp... and yes... eclipse

hot hull
#

Nah it's just skript ew

#

Anyhow, define the num outside the loop

pastel imp
#

yes.. defining num inside the loop

obtuse gale
#
int num = 0
for(SaveFormatComparator world : worldsList) {
num += 10
}```
pastel imp
#

but not creating it

obtuse gale
#

you have int in front of it tho

hot hull
#

defining = creating

#

most of the time

pastel imp
#

ok yes most of the time

hot hull
#

It applies in this case as well

obtuse gale
#

show the code where you make the int then

pastel imp
#

and aj I will see that

#

it's literally a private in num;

#

has no value

#

and then

hot hull
#

remove the int before num then

pastel imp
#

that should fix the issue then?

hot hull
#

Since rn you're just doing this

int num += 10

Which is always 10

Instead of

int num = 0;

num += 10;
pastel imp
#

yes ok but it still didn't fixed the main issue

hot hull
#

Which is?

pastel imp
#

"issue"

#

which is to do that each time it loops one thing.. it adds 10

hot hull
#

Do what I told you..

#

Define num outside the loop

old wyvern
#

int num =+ 10

#

xD

pastel imp
#

I did exactly what you told me

hot hull
#

Show me what you have rn

old wyvern
#

oh btw frosty

#

The xor thign worked

#

thanks

hot hull
#

I'm confused rn, what did I help you with?

pastel imp
old wyvern
#

inverse of xor

#

โ˜ ๏ธ

pastel imp
#

(private int num; above btw)

hot hull
#

That's correct now

pastel imp
#

yes.

hot hull
#

(I'm also bothered by that mix of allman and k&r)

prisma wave
#

This is accurate

pastel imp
#

but it's still drawing every string in the same Y

obtuse gale
#

isnt it meant to be +=?

#

or is it the same thing

pastel imp
#

and what I want is to draw each string separatly

hot hull
#

Same thing I believe

pastel imp
#

with a differance of 10

#

in the Y

prisma wave
#

no they're different things

#

Use +=

hot hull
#

oh

old wyvern
#

its supposed to be +=

prisma wave
#

=+ means set num to +10

pastel imp
#

oof

hot hull
#

eeee

old wyvern
#

a =+ 10 means a is positive 10

hot hull
#

btw Yugi, I'm not the one who told you that btw?

old wyvern
#

wait what?

#

oh it was piggy

hot hull
#

kek

#

My wisdom is immence ik

old wyvern
#

๐Ÿ˜‚

pastel imp
#

oof

prisma wave
#

(also just saying this channel isn't for support)

hot hull
#

Can we talk about that mix of allman and k&r now?

old wyvern
#

allman bothers me

prisma wave
#

allman good

old wyvern
#

K&R gang

onyx loom
#

@prisma wave lmao that picture

prisma wave
#

allman objectively more readable gang ๐Ÿ˜Ž

#

it's very accurate @onyx loom

onyx loom
#

u never fail to amaze me with kotlin memes

#

thank u good sir

prisma wave
#

Ty Ty

old wyvern
#

as much as I want to start trying out kotlin I keep procrastinating

prisma wave
#

I will try and make a kotlin meme at least once a week

#

Do it

#

Do it now

hot hull
#

Still waiting for those 400$, then I'm gonna try it

old wyvern
#

๐Ÿ˜‚

pastel imp
#

oof didn't saw the other development channel

#

xd

old wyvern
#

Kotlin design is kinda alien to me

onyx loom
#

i look forward to saturday 27 june in that case

errant geyser
#

As someone who was avidly anti-kotlin gang, its pretty epik

prisma wave
#

๐Ÿ˜Ž ๐Ÿ˜Ž

hot hull
#

katsu stop saying it's nice and go finish the lib

prisma wave
#

any new language will be alien @old wyvern

old wyvern
#

no I mean like some features specifically

hot hull
#

KM, if you learn Slovenian, I'll learn kotling ๐Ÿ˜Ž

prisma wave
#

hmmm

#

Define "learn"

onyx loom
#

worth

prisma wave
#

Do I have to become fluent?

hot hull
#

Yes

prisma wave
#

that will take years lmao

#

how about

hot hull
#

Exactly ๐Ÿ˜Ž

prisma wave
#

If I get a 30 day streak on Duolingo you learn kotlin

#

that seems fair

hot hull
#

Sure

prisma wave
#

okay

hot hull
#

You gotta provide evidence every day tho

prisma wave
#

Let's go

old wyvern
#

Question. How should one maintain object logic and top level logic there

prisma wave
#

Ofc

#

wdym?

old wyvern
#

Like

#

wait uh, my own question confuses me

#

one sec

prisma wave
#

Ok lol

#

Ah Duolingo doesn't have Slovenian time to find another app

hot hull
#

Such a supreme language the bird can't teach you it

#

kek

normal talon
#

So if I need vault in my plugin do i need to download the plugin and add it to external lib

hot hull
#

Use the dependency

prisma wave
#

dumb bird

#

It has a gradle dependency you can use

onyx loom
#

Ah Duolingo doesn't have Slovenian time to find another app
@prisma wave frosty trash language OMEGALUL

prisma wave
#

a deal is a deal ยฏ_(ใƒ„)_/ยฏ

hot hull
#

On day 30 you're gonna go into vc with me, and introduce yourself

prisma wave
#

oh god

#

ok

#

can't be that hard

onyx loom
#

๐Ÿ˜‚

hot hull
#

Gonna say the same thing for kotlin

prisma wave
#

kotlin is ez

#

slovenian is not ez

#

๐Ÿ˜ฆ

regal gale
#

I'm not even familiar with Slovenian

#

What is that ;p

hot hull
#

Why would you be?

onyx loom
#

who is?

prisma wave
#

eastern european language

hot hull
#

And you're fucked when it comes to actually speaking it

heady birch
onyx loom
#

thien, what do u speak in vietnam?

prisma wave
#

vietnamese?

regal gale
#

Wot

#

^

onyx loom
#

vietnamese an actual langauge?

#

lol

regal gale
#

It is

heady birch
#

Yeah

onyx loom
#

i had it in my head but it just didnt seem right

regal gale
#

Also

hot hull
#

Imagine only speaking 1 language

#

Weak

onyx loom
#

๐Ÿ™

hot hull
#

KM is gonna be able to say he speaks 2 after this

prisma wave
#

not fluently lol

onyx loom
#

lmai

regal gale
#

There are 29 alphabets in this country, along with 26 latin letters excluded f, w, z

onyx loom
#

i speak ENGLISH and SLOVENIAN

hot hull
#

I speak 3 :c

regal gale
#

Just like france, but different

#

;p

hot hull
#

Well speak is an over statement

regal gale
#

At least I can code with latin, u nerds ๐Ÿ˜›

hot hull
#

Boutta go code in arabic

#

right to left

onyx loom
#

๐Ÿ˜‚

regal gale
#

Pretend if I could write down entire class with Japanese...

#

Wait, does any programming language included japanese lol

hot hull
#

Most programming languages are english, except for those private experimental ones

proper patio
#

Hello

regal gale
#

Well, we still have to learn Pascal or Python, so there's an extreme odds to have a very own vietnamese coding language

old wyvern
#

esoteric languages

#

xD

regal gale
#

I think

proper patio
#

What's best of kotlin and java?

regal gale
#

Uh oh

hot hull
#

java doodoo, kotling good

prisma wave
#

:D

old wyvern
prisma wave
#

technically it's personal preference but objectively kotlin has more features

regal gale
#

I'ma just.. get outta here for now

old wyvern
#

yoo chill barr man

proper patio
#

What about C++ and java?

prisma wave
#

you can't really compare the 2

hot hull
#

Wait, origin in a random is the lowest possible right?

prisma wave
#

c++ is more low level than Java, they are for different things

old wyvern
#
hai 1.2
  can has stdio
  visible "hai world!!!1!"
kthxbye```
#

xD

proper patio
#

Quality code.

old wyvern
hot hull
#

kotlin can still have ; correct?

old wyvern
#

Its their example code

#

lol

proper patio
#

Wait, does that code snippet actually run?

old wyvern
#

yes in lolcode

ocean quartz
#

@hot hull Can but why would you?

proper patio
#

...

hot hull
#

Cause I'm used to it Matt

old wyvern
#

Thats hello world in piet

hot hull
#

And I'm not a savage like the rest of you

prisma wave
#

you get un used to it pretty quickly

#

the only reason you would want a semicolon is for 2 expressions on the same line

#

which is a bad idea anyway

ocean quartz
#

You're just typing things that you don't need
Plus you get used to it pretty easy

old wyvern
#

how about when you are writing multiline statements?

hot hull
#

You aren't ๐Ÿ˜Ž

prisma wave
#

the only reason you would want a semicolon is for 2 expressions on the same line

old wyvern
#

not 2 on the same line

prisma wave
#

oh i see

#

still don't need one

#

it carries over fine

#

the parser is clever

old wyvern
#

ah I see

hot hull
#

So close to having this animation perfect ;C

#

Either my brain is dumb af

[13:12:55 INFO]: 0, 1, 2
[13:12:56 INFO]: 1, 2, 3
[13:12:57 INFO]: 2, 3, 4
[13:12:57 INFO]: 3, 4, 5
[13:12:58 INFO]: 4, 5, 6
[13:12:59 INFO]: 5, 6, 7

Or this sequence is for some reason screwing up?

onyx loom
#

technically it's personal preference but objectively kotlin has more features
@prisma wave this is incorrect and u know it

prisma wave
#

The second part is correct

#

And it is technically an opinion

#

but hur dur java sucks Java users have no opinions kotlin good

onyx loom
#

thats my boy

hot hull
#

So I currently have it so it gets set back to 0 if the index is 14,
but now I need to somehow retain the previous stack and just change the index

[13:16:18 INFO]: 8, 9, 10
[13:16:19 INFO]: 9, 10, 11
[13:16:19 INFO]: 10, 11, 12
[13:16:20 INFO]: 11, 12, 13
[13:16:21 INFO]: 12, 13, 14
[13:16:22 INFO]: 0, 1, 2

(0 would be 13, and 1 would be 14, whereas 14 would become 1)

topaz bay
#

@hot hull modulus

#

Show me the codez

hot hull
#

I figured it out, it's ugly and I don't want to be bullied

topaz bay
#

Which means you should 100% be bullied for it

#

Send.

hot hull
#
    private static int getColor(int color, final int slot) {
        if (color > 14) color = 14;

        if (slot == 0) {
            if (color == 0) return 14;
            else return color-1;
        } else if (slot == 1) {
            return color;
        } else {
            if (color == 14) return 0;
            else return color + 1;
        }
    }
topaz bay
#

what

#

the hell

hot hull
#

Go away

topaz bay
#

I just dont understand what Im looking at

hot hull
#

Neither do I, but hey it works GWcmeisterPeepoShrug

#

Probs unnecesarry shit, but cba to comprehend this rn

topaz bay
#

What is your code here?

hot hull
#

What?

topaz bay
#

omg...

#

goal*

#

I just woke up, dont @ me

hot hull
#

X X X
X X X
X X X
I have this, each vertical line is a row, and I have numbers 0 - 14
middle row is my base point, then it's + 1 and - 1 for the upper and lower point

#

And since max point is 14, I have to properly get the - and + from the previous one

#
[13:47:17 INFO]: 14, 0, 1
[13:47:17 INFO]: 0, 1, 2
[13:47:18 INFO]: 1, 2, 3
[13:47:19 INFO]: 2, 3, 4
[13:47:20 INFO]: 3, 4, 5
[13:47:20 INFO]: 4, 5, 6
#

This is probs gonna be easier to understand (this being only 1 vertical row)

topaz bay
#

And whats the callsite?

hot hull
#

The what?

topaz bay
#

The call site

hot hull
#

No clue what you mean by that

topaz bay
#

Where do you call this method

hot hull
#

Ah, in my gui open

topaz bay
#

I meant show me

hot hull
#
for (int i = 0; i < 3; i++) {
   gui.updateItem(slots.get(i), new GuiItem(colors.get(getColor(color, i))));
}
#

color being a random int from the list size (0-14)
random.nextInt(colors.size() - 1);
which I increase every time it runs that

topaz bay
#

you generate the random number once, and then increment by 1 in each loop?

hot hull
#

Yea

topaz bay
#

gross

obtuse gale
#

IntelliJ and Kotlin devs are probably less efficient in coding because they spend 80% of their time telling everyone else to use it

regal gale
#

?

onyx loom
#

not true

hot hull
#

90% for kotlin devs, and 40% for java

onyx loom
#

the time wasted spreading the word is gained back by kotlins efficiency in writing the code

topaz bay
#

You stole that joke @obtuse gale

obtuse gale
#

hm?

#

where

jovial warren
#

good afternoon all

onyx loom
#

greetings

prisma wave
#

where
From me who stole it from Reddit

obtuse gale
#

o

prisma wave
#

It's something of a classic

jovial warren
#

anyone know a good way I can split a list in to chunks?

old wyvern
#

List#sublist?

prisma wave
#

there's a kotlin collections function for that

#

Possibly List.windowed

prisma wave
#

But yeah sublist does the job too

jovial warren
#

I should probably commit this absolutely horrendous code to GitHub by now lol, still gotta implement a way I can not have to push my token

prisma wave
#

Environment variables

jovial warren
#

so what just take an argument in my main function?

inner umbra
#
Map<integer,list> chunks = new HashMap<>();
int chunk = 0;
List editable = new ArrayList<>();
for(Object o : list) {
    editable.add(o);
    if(editable.size() >= maxchunkSize) {
        chunk++;
        chunks.put(chunk, editable);
        editable = new ArrayList<>();
    }
}
```Call this pseudo code xD
old wyvern
#

No

#

Environment variables

jovial warren
#

how am I going to use environment variables in this case?

old wyvern
#

System.getProperty(propertyName)?

jovial warren
#

and how do I pass it that environment variable?

old wyvern
#

You have to add it to your env variables manually

jovial warren
#

that's easy then

#

export ENV_VARIABLE_NAME=my_value

#

ez

#

though I'm forgetting that export works per-terminal

#

how tf can I set an environment variable then?

#

there ain't really a way you can do that globally and persistently on linux afaik

rotund egret
#

Google ๐Ÿ‘€

#

There is, I just forget the process

#

Oh I guess only if your version of linux has etc/environment

#

Otherwise theres no global

old wyvern
#

add the export command to the user's .bash_profile

jovial warren
#

you sure that one's gonna work?

rotund egret
#

And yeah, you could do it per profile ^
I think you can also set in /etc/profile.d

jovial warren
#

Oh I guess only if your version of linux has etc/environment
which ofc it does

old wyvern
#

Should?

jovial warren
#

And yeah, you could do it per profile ^
I think you can also set in /etc/profile.d
which I just did lol

#

now gotta reboot I think

#

yeah that worked

#

also, it isn't System#getProperty, it's System#getenv

jovial warren
#

okay now this bot is getting good

hot hull
#

The true response to that is, Launching nukes.

jovial warren
#

lol

jovial warren
#

the last thing I've got to implement is splitting the queue in to pages of 10 tracks per page if there are more than 10 tracks in the queue

#

which is going to be a pain the way my code is structured

#

that is what you call 0/10 readability

hot hull
#

I just had a neat idea of something to make for showcase

jovial warren
#

what is it?

#

"how not to code" with my QueueCommand as the example?

hot hull
#

Nah, something amazing

#

You'll see tommorrow

topaz bay
#

@jovial warren gross

runic flume
#

Hey, I'm looking for a elegant IntelliJ theme

#

Soft colors, no custom icons

#

Any suggestions?

topaz bay
runic flume
#

oh damn

#

Thanks

jovial warren
#

@topaz bay how could I make it look better?

#

and function better

errant geyser
#

Pay Sx or KM to make it for you

jovial warren
#

lol

#

not happening

errant geyser
#

They'll argue for about 30 minutes per line about what the best practice is for x

jovial warren
#

HAHAHAHA

#

that's brilliant

hot hull
#

@runic flume You should use my material theme one, it's got amazing colors

runic flume
#

ehhh no

errant geyser
#

Essentially you get to sponsor the best argument in history, while we all sit here dying watching it ๐Ÿฟ

runic flume
#

Materal sucks

hot hull
#

You suck

normal talon
#

hello

jovial warren
#

I find the default darcula theme looks quite good

#

I really like the orange

hot hull
#

I posted mine in this chat a while back

onyx loom
#

They'll argue for about 30 minutes per line about what the best practice is for x
@errant geyser this is SO TRUE

errant geyser
#

lol

hot hull
#

Wait Bardy, did you make anything out of puches yet?

#

Pouches*

prisma wave
#

They'll argue for about 30 minutes per line about what the best practice is for x
very true

topaz bay
#

exceedingly accurate observation

#

@jovial warren You can start by not writing it ugly

onyx loom
#

and then everyone else will just stare at the conversation PES_JesusChrist

prisma wave
#

free xp ยฏ_(ใƒ„)_/ยฏ

topaz bay
#

Like...

#

Why

#

WHY

onyx loom
#

LMAO

#

allman ๐Ÿ˜ฆ

jovial warren
#

what's so bad about that?

#

is it the one-line if?

prisma wave
#

curly brackets + new lines work wonders for readability

topaz bay
#

You have this exact same code

#

at least 5 times in this file

jovial warren
#

that second part is the worst part about it I agree

#

the first part is in lots of different commands yeah can't disagree with that either

topaz bay
#

How do you consider this

#

more readable

#

just use braces

#

omg

jovial warren
#

yeah that's terrible for readability I agree

#

more readable
never said it was more readable though

onyx loom
#

๐Ÿ™‚

topaz bay
#

This is more a matter of taste

jovial warren
#

the forEach?

topaz bay
#

When a function block has more than 1 line of code

#

give the value a name

#

I tend to give the value a name all of them time right now

ocean quartz
#

Agree yeah

jovial warren
#

I'm surprised you didn't bring up the nowPlayingString code sx

topaz bay
#

I literally cannot traverse this code

#

Like my brain

prisma wave
#

am i being dumb wdym by

give the value a name

topaz bay
#

Can.Not.

prisma wave
#

like loop@?

topaz bay
#

Instead of using it

prisma wave
#

ah yeah

topaz bay
#

Yeah, I didnt even NOTICE

#

this was an else condition

jovial warren
#

I should turn this code review in to a video with that guy laughing meme over it

topaz bay
#

Because it just blends in

#

This is why we use braces

#

Allman braces

jovial warren
#

yeah true

#

not allman braces but true

#

I should be using braces there

topaz bay
#

kotlinOptions.freeCompilerArgs += ["-Xopt-in=kotlin.time.ExperimentalTime"]

jovial warren
#

it's just a clusterfuck of shit let's face facts here lol

topaz bay
#

Add this to your build.gradle

jovial warren
#

kotlinOptions.freeCompilerArgs += ["-Xopt-in=kotlin.time.ExperimentalTime"]
at the bottom?

topaz bay
#

And then just remove all the @ExpirementalTime annotations

#

No

#

It goes into the compileKotlin closure

#

You can also put it inside the compileTestKotlin one

jovial warren
#

okay done

topaz bay
#

Or remove them both and use this

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
  // put your configuration shit here
}
jovial warren
#

okay

#

anyway

#

let's get to fixing up whatever the fuck this thing is that I'm looking at with the file name "QueueCommand.kt"

#

so what changes do you propose?

#

I've already braced the else statement that you said wasn't noticeable

#

any suggestions like "use allman" are just going to get disregarded though

topaz bay
#

In a world where you write code like this, one would expect you to be more open to different styles

jovial warren
#

alright, I'll look at different styles

#

I'm not using allman though

errant geyser
#

He's already using Kotlin, what do you want from this man

jovial warren
#

the first brace on a new line ain't happening

hot hull
#

Bardy

trim hare
#

Patreon donations?

topaz bay
#

Kotlin is not a different style

hot hull
#

Answer my question ;(

jovial warren
#

what question?

#

Wait Bardy, did you make anything out of puches yet?
oh this one

#

yeah I kinda did

hot hull
#

Talk

jovial warren
#

wdym talk?

hot hull
#

As in elaborate

jovial warren
#

I converted most of the project to Kotlin, but I was still working on changing a few things to make them better when I last left it

topaz bay
#

Now convert it all to allman

#

:)

jovial warren
#

you can do that if you want when I push my commit

topaz bay
#

Absolutely not.

jovial warren
#

suit yourself then

#

also, you know my queue command?

#

I just made it worse lol

#

also, I thought allman was bad

#

then I saw:

if  ( hours   < 24
   && minutes < 60
   && seconds < 60
)
{return    true
;}         else
{return   false
;}
#

on Wikipedia

ocean quartz
#

Oh that's not even the worse

jovial warren
#

also @topaz bay another reason why I won't use allman is because it breaks Kotlin's official coding conventions/style

#

Oh that's not even the worse
show me worse then lol

topaz bay
#

And?

#

You do that like... a lot already

#

I hope you know that

#

lol

jovial warren
#

true I guess

topaz bay
#

Whenever you use a defense, its important to actually know the parameters involved

#

I can break convention as much as I want to, because I know exactly where I do

jovial warren
#

I'm not saying my style is in any way a good style

topaz bay
#

Your style isnt a style

jovial warren
#

exactly

#

it's just a clusterfuck

#

basically "just make it work"

topaz bay
#

So why are you quoting kotlin's conventions?

jovial warren
#

because you keep promoting allman to me

#

does allman even allow for expression bodies to be used?

topaz bay
#

But you aren't using kotlin's conventions

#

WHAT

jovial warren
#

I doubt any of us are anyway

topaz bay
#

Allman is a brace style dude

#

Literally no one perfectly follows a style guide

#

This is why linters exist

jovial warren
#

true

#

I'm not asking for a better coding style anyway, I'm asking for a better method of doing what I'm doing

#

but I should really improve my coding style

hallow crane
#

Should I run every second and only do a task if the current second is a multiple of my interval or should I create a repeating task every interval-seconds and execute each time?

topaz bay
#

How long are the intervals?

#

You should definitely not do polling

#

Polling is bad

hallow crane
#

I was simplifying. I am running every MC tick, intervals can be anywhere from 1 tick to 1000

#

Or any long for that matter

topaz bay
#

Yeah. No.

#

Polling is bad

hallow crane
#

Polling?

#

You mean task for each?

topaz bay
#

Just make your task schedule itself in the future

#

Should I run every second and only do a task if the current second is a multiple of my interval

#

This is polling

hallow crane
#

Okay, I won't do that

#

Is it that hard on performance?

topaz bay
#

Not necessarily in itself no

#

Its just a massive waste

#

Especially for something that has an interval

#

scheduler your task to run in the future, and then have that task schedule the next task in the future

#

No wasted computation

hallow crane
#

That's going to build the callstack, no?

topaz bay
#

No?

hallow crane
#

there's just a method called tick(). If I make a task to run in the future and it calls itself then...

topaz bay
#

Youre not directly calling it though

#

Youre scheduling it to be called later

hallow crane
#

I'll just use bukkit's async timer scheduler

topaz bay
#

o...k...

ocean quartz
#

@topaz bay Speaking of that, on the custom entities, the pathfinder goal run every tick, to avoid it searching for items every tick i made the counter that'll count up to twenty and reset, and only run on then, which seems like you said a waste
How would you do that? Since I can't just have the method called every x ticks instead

topaz bay
#

I would use actual time deltas instead of a counter

#

store the last time it was ran, and on tick, check if its past a certain delta

ocean quartz
#

Gotcha

topaz bay
#

I just got a github notification for it

ocean quartz
#

Oh yeah I remember, clip didn't merge it because of the String.valueOf calls, and I had no idea about what else to do to reduce it xD

topaz bay
#

ugh.... why is scala so fucking ugly

#

I am so unbelievably thankful that Kotlin exist

errant geyser
#

Jeez what the fuck is that

ocean quartz
#

That is awful holy

topaz bay
#

I am so sorry for what I'm about to do

#

Please forgive me.

errant geyser
#

The amount of imports on that gave me aids

ocean quartz
topaz bay
#

God, its such a trash language

errant geyser
#

Is that => the same as pythons

import x as y ?

topaz bay
#

why...

#

How could you do this to me

prisma wave
#

Do what?

topaz bay
#

That class

prisma wave
#

Ah

#

Good question

#

Is there an alternative that I forgot about?

topaz bay
#

At least like 40 of them

#

CharStreams from guava

#

You could read it as a stream

#

and join it

prisma wave
#

Ah yes

topaz bay
#

(you could also use kotlin)

#

;(

prisma wave
#

gotta keep the size down

#

I've just realised that "never shade again" is kinda untrue since you'll have to shade that library lol

topaz bay
#

Theres also like.... 0 reason for that getaddurlmethod to have a sync lock on the reflection resolution

#

Theres no reason for that to not be resolved statically with the class

prisma wave
#

Better safe than sorry with the lock, it's very multithreaded so

#

wdym by resolved statically? In a static intializer?

topaz bay
#

Yes

prisma wave
#

yeah should probably do that

topaz bay
#

Also, wdym better safe than sorry?

#

Its a volatile field

prisma wave
#

My brain was numbed from all the CompletableFuture debugging

topaz bay
#

from a static context

prisma wave
#

ah

topaz bay
#

Theres no thread level caching

prisma wave
#

Good point

#

I am somewhat dumb

#

like I said blame it on the futures

#

They are the bane of my existence

topaz bay
#

Why use them then?

prisma wave
#

There's not really any alternative

#

Not in this scenario anyway

topaz bay
#

I mean... there kinda is

#

You can use just normal callbacks internally

#

And expose those as completable futures

prisma wave
#

True

topaz bay
#

also... what the hell?

prisma wave
#

What

topaz bay
#

Why.... not use the one that accepts a throwable?

#

And simply append the dependency to the string?

prisma wave
#

The linter got angry

#

I was doing that originally

lime agate
#

hi is anyone here able to help me with a deluxetags issue?

prisma wave
lime agate
#

ok

topaz bay
#

....

#

A linter...

#

A linter got mad

prisma wave
#

Ik they aren't the law

topaz bay
#

Linters are specifically designed to be mad about everything

prisma wave
#

I could use the Throwable, Supplier<String> one ig

#

Look I wasn't thinking straight

#

3 hours of trying to figure out why a future is never being completed will do that

prisma wave
#

quite

#

I'll clean it all up in the morning

#

it's very early stages

errant geyser
#

I told ya you guys could argue about one line for ages

prisma wave
#

Indeed

#

Although this is more of a massacre than an argument

topaz bay
#

We're not even talking about one line

prisma wave
#

oh

#

it's orange

#

includes the blue light filter in a screenshot like a boss

topaz bay
#

lies

prisma wave
#

what's lies

topaz bay
#

idk

prisma wave
#

me neither

topaz bay
#

LIES

prisma wave
#

NO

#

TRUTHS

#

MANY TRUTHS

topaz bay
#

Is there any such thing as true?

normal talon
#

is there anyway to make a ban gui, like /ban (user) opens a gui

#

then u select time reason

foggy axle
#

yes?

oak raft
#

@normal talon thereโ€™s an awesome plugin called PunishmentGUI on spigot, only issue is you canโ€™t change the things in the GUI quite yet, theyโ€™re releasing an update with that

#

Wait uh oh I just realized this was dev general, did you wanna make your own GUI? Lmao

onyx loom
#

dev general for configurators Kappa

hallow crane
#

CozyLeprechaun94 that's not really a question

#

Just....make a gui with a gui library / inventory thingy and listen for clicking

hot hull
#

I've somehow managed to make a random always result in the same number ๐Ÿคฆ

errant geyser
#

Nice

obtuse gale
#

Question

#

Why does my github default pfp look like a schlong

heady birch
#

๐Ÿ˜•

obtuse gale
heady birch
#

Lmao

#

You broke the rules

#

-well, they broke the rules

obtuse gale
#

I can never change this

heady birch
#

Think of it as upside down mosquito

obtuse gale
#

What kind of mosquitos do you have??

heady birch
#

eyes

#

nose

obtuse gale
#

oh i kinda seei t now

errant geyser
#

Hey Frosty I'm getting side tracked by commissions, ItemActionsLib is still comin, but not in like, the next few days

prisma wave
hot hull
#

katsu, u getting paid well for the commission?

old wyvern
#

Hyperskill inverted the hamming code error correction order for their proj โ˜ ๏ธ ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚

supple kraken
#

any1 who could help with the config of deluxechat?

hot hull
supple kraken
#

i already did that

#

and told me was succesful

hot hull
#

When did you purchase the plugin?

supple kraken
#

today

hot hull
#

@pallid gale Duty calls

pallid gale
#

done

supple kraken
#

ty ๐Ÿ™‚

#

so what should i delete on the config file so it wont be comments

pallid gale
#

This channel is for development, not configuration. use #deluxechat

obtuse gale
#

bUt DEveLopMenT is ConFiguRatiOn

errant geyser
#

No ItS nOt

hot hull
#

Aj

obtuse gale
#

mmmmmm?

regal gale
#

They are different moderately

onyx loom
#

mr. @prisma wave thank for meme

prisma wave
#

You're welcome

frail glade
prisma wave
#

I've used it

#

It's not bad, seemed to be lacking a lot of features so I've got a fork with a bit more implemented

frail glade
#

Oh yeah?

prisma wave
#

Yeah. I don't remember everything but ACF couldn't register commands, and enchantments weren't implemented at all last I checked, so I had to do them myself - https://github.com/knightzmc/MockBukkit

#

Haven't updated the readme though lol

frail glade
#

Well if you ever do, I'll happily try it out.

#

I do use ACF in what I want to do a Mock of, so, that'll come in handy.

jovial warren
#

I heard Bukkit testing was the biggest pain in the ass

prisma wave
#

It's very annoying

#

But yeah being able to test commands is handy

#

Although coupling can make it frustrating

jovial warren
#

I test commands by making a server and adding it as a build configuration to IntelliJ

frail glade
#

I mainly just need to test itemstacks against custom model data and whatnot.

#

Make sure enchants work, etc.

jovial warren
#

also, my boy's code has been cleaned up a lot now

prisma wave
#

I implemented enchantments and a lot of the ItemStack methods so I'd recommend using my fork for that

jovial warren
#

though that probably means nothing to you glare since you have no idea what I'm on about

frail glade
#

That is correct.

#

Yeah KM, I'll happily play with it.

jovial warren
#

I'm on about BardyBot

#

specifically, his old queue command code

frail glade
#

Nice.

jovial warren
#

a lot of the messy multi-line messages are now string literals, and the messy if statements have been replaced with when statements

frail glade
#

KM, have you implemented any other mock events? Like item drops and stuff.

prisma wave
#

I don't think so

frail glade
#

Kk

prisma wave
#

Implementing them is fairly easy or I can do some of you want though

frail glade
#

I'll check it out probably tomorrow. Preoccupied today.

prisma wave
#

๐Ÿ‘

jovial warren
#

any way to pass a constructor param to a class annotation?

prisma wave
#

Nope

#

annotations are class based not instance based

jovial warren
#

yeah true

#

so guess there isn't a way of doing what I want to do using matt's framework then ๐Ÿค”

#

there's gotta be another way I can not have to repeat the same code throughout many different classes

prisma wave
#

Abstract class

#

?

jovial warren
#

yeah that's what I was thinking

#

but how am I gonna do that with matt's framework

#

it depends on annotations outside of the class

jovial warren
#

also, found the perfect method for splitting this in to pages

#

Iterable<T>#chunked

#

takes a size value, returns a List<List<T>> of chunks

prisma wave
#

Ah yes that's it

#

Not windowed

jovial warren
#

it does literally just return windowed though lol

#
public fun <T> Iterable<T>.chunked(size: Int): List<List<T>> {
    return windowed(size, size, partialWindows = true)
}
prisma wave
#

Oh lmao

jovial warren
#

just trying to figure out how exactly to store these as pages

#

I'm thinking of storing them as a list of strings (each string being a page) and then just getting the indexed page on request

prisma wave
#

I wouldn't store it as strings

jovial warren
#

what should I store it as then?

prisma wave
#

Store the objects then convert to strings ad-hoc

jovial warren
#

ad-hoc?

#

meaning?

prisma wave
#

ie whenever you actually need to display it

jovial warren
#

which is only in this method

prisma wave
#

you'd probably want to be storing more than just the name internally - video id, length, etc

jovial warren
#

I'm not intending on storing the name in the string

#

I'm intending on storing the entire page content

#

though that's probably not a good idea

#

maybe I should create a custom Page class that stores all the things I need, and then format that later

prisma wave
#

why not just a List<List<SearchResult>> or whatever?

#

Or a typealias

jovial warren
#

because it's not a search result

prisma wave
#

oh it's a queue

jovial warren
#

it's a queue

#

yes

prisma wave
#

same principle though

heady birch
#

Page

#

Page object

jovial warren
#

what about it?

heady birch
#

just trying to figure out how exactly to store these as pages

jovial warren
#

you think I should store them as a list of page objects?

prisma wave
#

I mean it's an option given how cheap classes are in kotlin

#

But I would just use a 2d list, with an optional typealias

jovial warren
#

@ocean quartz is @Optional not compatible with integer types either?

#

because I want an optional page number

#

I wanna either give it a page number, or have it default to 1

prisma wave
#

Use a nullable Int i Guess

jovial warren
#

so pageNumber: Int? = 1?

heady birch
#

Are you using spring

jovial warren
#

no

#

no reason to yet

#

might use it in the future sometime if I really need it

main nova
#

Would anyone know what would be a reason for bungeecord not linking to hub and making this error:
> 14:49:40 [SEVERE] Jun 21, 2020 2:49:40 PM net.notfab.hubbasics.bungee.listeners.JoinListener onJoin WARNING: No available lobby servers!
The ports are all correct, bungeecord is enabled on hub, lobby is labelled in hub and there arent any changes to query ports. it was working before but now doesnt.

prisma wave
#

I'd do the default with the Elvis operator since the framework might provide null @jovial warren

jovial warren
#

yeah it does but I've fixed that now

#

then the issue was that it was 0 size but I was trying to get index 0

#

so I fixed that by only trying to get index 0 if the size is greater than 0

#

now I'm going to test it again

prisma wave
#

List.isNotEmpty I hope

#

None of those old fashioned size checks

hot hull
#

List.isNotEmpty

#

What kinda weed you smoking

prisma wave
#

Kotlin ๐Ÿ˜Ž

ocean quartz
#

@jovial warren All parameters need to be nullable

heady birch
#

if (list.size == Integer.MIN_VALUE + Integer.MAX_VALUE)

#

eh that might be -1 actually

jovial warren
#

yeah dw I fixed it

ocean quartz
#

Niall that's going to be 0.5 no?

#

Oh wait no

#

that'll be negative half the amount of min_value

heady birch
#

what was i thinking

distant sun
#

Any cheap vps suggestions?

heady birch
#

ovh

prisma wave
#

contabo

distant sun
#

2gb should be fine I guess

heady birch
#

ovh

#

4 pound a month 2gb

distant sun
#

Contabo it's shit

prisma wave
#

โ‚ฌ5 for 8gb

#

no??

distant sun
#

Yes ??

prisma wave
#

I use it

#

it's fine

distant sun
#

And it sucks

prisma wave
#

really cheap

#

how lol

heady birch
#

Hm nice

distant sun
#

Have you look at their hardware?

#

Hmm

#

I want it as web server, to host a rest api and a website that will display data from the api - nothing too heavy ig

prisma wave
#

"We use Intelยฎ Xeonยฎ E5-2620v3, E5-2630v4, 4114 and AMD EPYCโ„ข 7282 CPUs"

#

you don't need much for that

#

But might as well get the machine with better specs

distant sun
#

I dont think you can choose which one to get

prisma wave
#

Any of those will be fine though

obtuse gale
#

password literally isnt in the email

#

._.

prisma wave
#

Different email?

#

also digitalocean bad unless you have free credit

distant sun
#

Will see KM

heady birch
#

You get a seperate one

obtuse gale
#

i got free credit

prisma wave
#

Ah alright

obtuse gale
#

and I havent got any other emails

heady birch
#

I think it comes a few mins later

prisma wave
#

They're pretty expensive normally

obtuse gale
#

5 bucks am onth

prisma wave
#

Yeah be patient and check spam

obtuse gale
#

and ive got 55 bucks free credit

prisma wave
#

$5 for like 1gb

#

and 20gb storage or smth

obtuse gale
#

in terms of spam

#

welp

#

ive got some nudes and bitcoin apparently

prisma wave
#

oh damn you're rich

jovial warren
#

IT WORKS

#

finally

obtuse gale
#

I wonder if this is digital oceans one

prisma wave
#

probably

#

"who needs Viagra when you've got fast, accessible vps's?"

obtuse gale
#

exactly

#

got 927 of these

distant sun
#

6$ for 2GB sounds good

prisma wave
#

eh

#

It's not great

distant sun
#

On OVH

prisma wave
#

there are better providers imo

distant sun
#

Such as?

prisma wave
#

price wise anyway

obtuse gale
#

oof still no email

prisma wave
#

contabo, north networking was decent in my experience

obtuse gale
#

can i reset my password for phpmyadmin someway through SSH

#

cos ive got access to that

prisma wave
#

does phpmyadmin even have specific passwords?

obtuse gale
#

no clue

prisma wave
#

I thought it just used SQL users

obtuse gale
#

probably does

jovial warren
#

"who needs Viagra when you've got fast, accessible vps's?"
and overpriced

prisma wave
#

Very overpriced

obtuse gale
#

how can i change my sql password then lol?

jovial warren
#

I suppose so is Azure

distant sun
#

contabo, north networking was decent in my experience
@prisma wave i dont like contabo because you have to pay install fees lol :))

prisma wave
#

true

#

but not much

old wyvern
#

contabo seems nice

jovial warren
#

but neither Azure nor DigitalOcean are made for enthusiasts, they're made for businesses

prisma wave
#

and you save more money in long term

old wyvern
#

48$ for a year

prisma wave
#

Contabo has been really good in my experience

jovial warren
#

which is why it confuses me that those are in the GSDP (GitHub Student Developer Pack)

prisma wave
#

The prices are insane

old wyvern
#

What OS do you recommend bm?

#

cent 7

#

?

prisma wave
#

Ubuntu?

jovial warren
#

CentOS 8

#

for a server

prisma wave
#

Never used centos personally

jovial warren
#

CentOS is great

prisma wave
#

I'm more familiar with Debian based distros

old wyvern
#

8 doesnt come with lamp pre installed xD

jovial warren
#

CentOS is backed by RedHat

#

8 doesnt come with lamp pre installed xD
I didn't know that was an option for 7 either

distant sun
#

Red Right Hand

old wyvern
#

It is