#dev-general

1 messages ยท Page 86 of 1

prisma wave
#

or use private set

jovial warren
#

I'm not saying Java's getter and setter boilerplate isn't unnecessary

#

I'm saying there's a reason to stop editing of the internal values

prisma wave
#

eg ```kotlin
var age = 30
private set

jovial warren
#

does that just stop you setting the value?

prisma wave
#

it makes a private setter

frail glade
#

Alrighty who was the other Spring person here

jovial warren
#

which overrides the default public setter

frail glade
#

Was that you Mitten

prisma wave
#

uh

#

possibly

jovial warren
#

there was definitely Niall

frail glade
#

Ahh crap no matter what I'm going to have to push an update.

#

I was trying to force clear spring cache

#

But I'd need to push an endpoint for that or just reboot it.

jovial warren
#

what you working on?

frail glade
#

MCBanners. The cache between it and Spigot is broken so I was going to try to clear it.

jovial warren
#

cache?

#

what you caching?

frail glade
#

Locally, resource and author icons show, but in prod they aren't.

#

Err, the banners.

jovial warren
#

ah okay

frail glade
#

Si

jovial warren
#

also can someone please explain to me what the purpose of loading configuration values in to memory is when bukkit already does that for you

prisma wave
#

type safety

#

static type checking

#

slightly faster

#

DRY

jovial warren
#

getString() returns a String object from the cached YamlConfiguration object

#

which means it's already cached by bukkit

prisma wave
#

to a degree

jovial warren
#

I suppose if you wanted ORM for files it could be pretty handy

prisma wave
#

A big reason to use it is compile time typo checking

#

if you're doing getString("blah.elqj") a lot you could easily make a typo

jovial warren
#

good point

prisma wave
#

you can also do more complicated object loading (eg loading a ConfigurationSection into a proper object)

jovial warren
#

but you generally wouldn't want to repeat that code

#

repeated code is bad practice apparently

prisma wave
#

well precisely

#

so calling getString over and over is repeating yourself

#

compared to a direct property access

jovial warren
#

so what you do it the LuckPerms way and load config values as a map of paths to values?

prisma wave
#

you also get type safety (eg you would know connectionTimeout is an Int, so you couldn't accidentally do getString instead)

#

that seems pointless

#

MemorySection is a map anyway

jovial warren
#

what I was thinking

prisma wave
#

although it's possibly slightly faster

jovial warren
#

so what else do you do?

prisma wave
#

because getString("path.path1.path2") performs string splitting on the .

jovial warren
#

I want this plugin to be as optimised and efficient as possible

prisma wave
#

My go-to is a data class that wraps the config values, then you load that once on startup from the config and then pass around

jovial warren
#

at the moment my plugin takes about 10-15 seconds to load on startup

prisma wave
#

yikes

jovial warren
#

wait what @prisma wave

prisma wave
#

what are you doing?

jovial warren
#

creating db tables

topaz bay
#

how the fuck

jovial warren
#

idk why it causes so much lag though

prisma wave
#

you should do db stuff asynchronously

jovial warren
#

I am

#

I think

#

actually no it's using .join() so I can see when it throws errors

#

I'll fix that later

prisma wave
#
data class ConfigWrapper(
  val connectionTimeout: Long
  val someOtherConfigValue: String
)

val config = ConfigWrapper(
  config.getLong("blah"),
  config.getString("blah2")
)```
#

completablefuture in kotlin

#

ew

jovial warren
#

actually no db queries are done synchronously I don't think

#

yeah I'll probably use Hikari and/or coroutines

#

CompletableFuture is just what I was using before

topaz bay
#

those are not mutually exclusive

jovial warren
#

that's why I said and/or

topaz bay
#

?

jovial warren
#

since I wasn't sure if I should be using both or if coroutines pool

topaz bay
#

but why would you use hikari OR coroutines?

#

That doesnt make sense

prisma wave
#

You can use both just fine

jovial warren
#

I don't know how either of them work

prisma wave
#

Coroutines are lightweight threads

#

Similar to how BukkitScheduler works

#

Hikari does connection pooling

jovial warren
#

guessing they're better than using regular threads?

prisma wave
#

You can use the two together fine

#

they're better in that you can switch between them easily and dispatch them easily

jovial warren
#

ah okay

prisma wave
#

They're like the Bukkit scheduler on steroids

jovial warren
#

yeah I'll have to look in to that then

prisma wave
#

You can switch between a thread pool and blocking really easily

#

Very cool stuff

jovial warren
#

how am I supposed to replace methods like thenApply and thenCombine?

prisma wave
#

pretty much just write normal code

jovial warren
#

ah okay

#

yeah I'll look in to it when I get back anyway

#

dinner's here

#

brb

prisma wave
#

Kk

onyx loom
#

explain varargs. now.

topaz bay
#

damn... Im hungry

prisma wave
#

They definitely have a bit of a learning curve and I'm not 100% confident but you can do some fancy stuff with coroutines

topaz bay
#

variable... arguments..

#

varargs

prisma wave
#

can be any amount of arguments

topaz bay
#

its just fancy syntax for passing an array

prisma wave
#

^

onyx loom
#

ok. thx.

prisma wave
#
fun sumValues(vararg values: Int)

can be ```kotlin
sumValues()
sumValues(1, 2, 3)
sumValues(1, 2, 3, 4, 5, 6...)
sumValues(1)

#

any amount of arguments

topaz bay
#

That bothers me

prisma wave
#

why

#

i mean apart from the unclear behaviour of sumValues()

topaz bay
#

because there is a case for no arguments

prisma wave
#

yeah lol

#

i guess it would be 0

#

i couldn't really think of a practical example

topaz bay
#

or, two values and then the varargs

#

:OOOOO

prisma wave
#

woah

#

if only i did any android development

topaz bay
#

dude...

#

ij 2020.2 opens SO fucking fast

prisma wave
#

it broke half my plugins

topaz bay
#

Oh thatll probably do it

frail glade
#

Is it an EAP?

prisma wave
#

lmao

#

yeah

frail glade
#

I just allocated more RAM to it and it sped up.

prisma wave
#

hm

onyx loom
prisma wave
#

it's weird, IJ reports it's only using about half a GB in the bottom right, but htop says differently

frail glade
#

I give it like 8GB or something

prisma wave
#

๐Ÿ˜ณ

topaz bay
#

WHAT

prisma wave
#

i give like 3

#

max

topaz bay
#

That is WAY too much

heady birch
#

Is it any good

frail glade
#

I mean it isn't slow anymore

#

I also open it using Paper flags

#

^Kidding

topaz bay
#

@prisma wave ij probably only shows its own direct usage

#

but htop is probably including any sub process as well

prisma wave
#

yeah that makes sense

#

@frail glade lmao

frail glade
onyx loom
#

how does one allocate ram to ij

frail glade
topaz bay
#

Dude... that is seriously way too fucking much

frail glade
#

Fine, I'll make it like 2

topaz bay
#

Mine is literally 1 gig

#

and it works fine

frail glade
#

Yeah it still opens fine.

topaz bay
onyx loom
#

mine has defaulted to 2gb lol

#

let me just double that

jovial warren
#

Is it an EAP?
when you google EAP and it returns "employee assistance program" lol

prisma wave
#

early access program

jovial warren
#

makes sense

#

also who thinks I should convert my completablefutures to coroutines in this commit

prisma wave
#

more like who doesn't

jovial warren
#

currently this commit includes a complete overhaul of the plugin, rewritten in Kotlin, with separate bukkit and bungee modules

prisma wave
#

that's a big commit

jovial warren
#

I know

#

can't really go back now though

#

and it's still a snapshot at it's current local point in development

#

so hold on

#

do I just make that return Unit?

#

and then start up new coroutines rather than using thenApply and thenCombine

#

when you can't remember where you put one of your methods :/

#

fun <T> transaction(statement: Transaction.() -> T): CompletableFuture<T> = CompletableFuture.supplyAsync { transaction(get<Database>(), statement) } current transaction method

#

what should I have that return?

prisma wave
#

it should return T

#

and be a suspend fun

jovial warren
#

why suspend?

#

what does that do?

prisma wave
#

my knowledge on this is not perfect

#

but I believe suspend means it has to be run in a coroutine context

jovial warren
#

also what should I replace CompletableFuture#supplyAsync with?

prisma wave
#

you just return the direct value

#

you write coroutine code as if you were blocking

jovial warren
#

ah okay

prisma wave
#

because you can safely block a coroutine

jovial warren
#

so just transaction(get<Database>(), statement) instead of supplying that to a CompletableFuture

prisma wave
#

yes

jovial warren
#

seems legit

#

suspend fun <T> transaction(statement: Transaction.() -> T): T = transaction(get<Database>(), statement)?

prisma wave
#

yep

jovial warren
#

alright

prisma wave
#

there's some very clever stuff going on behind the scenes

jovial warren
#

what does suspend do?

#

ah okay

#

"The suspend keyword means that this function can be blocking."

prisma wave
#

pretty much yeah

jovial warren
#

so you said I write this as if it's going to block the main thread

prisma wave
#

yes

#

in practice you probably won't, you'll block a coroutine thread instead

jovial warren
#

I don't need to change player or dbSender's code then

#

and now I'm getting an error saying suspend functions should only be called from other coroutines

prisma wave
#

Precisely

jovial warren
#

so I can just have this entire command execute asynchronously then?

prisma wave
#

Don't do it all async

jovial warren
#

why not?

prisma wave
#

Bukkit stuff doesn't always work async

#

Although you may be able to

jovial warren
#

unless this is a completely stupid idea, I run under the policy of: if it can be run asynchronously, it should be run asynchronously

prisma wave
#

Actually try it all async

#

That's a somewhat stupid idea

#

Not exactly

#

but somewhat

#

because often async actually serves no benefit and makes your code more confusing

jovial warren
#

what I did before is just ran kickPlayer synchronously and everything else was async pretty much

rotund egret
#

Some operations aren't thread safe

prisma wave
#

Indeed

jovial warren
#

good point

prisma wave
#

Especially not in bukkit

jovial warren
#

isn't thread-safe basically avoiding race conditions?

prisma wave
#

Pretty much

jovial warren
#

if it's all done on the same thread though (a bit like the main thread), then race conditions don't apply here

prisma wave
#

thread safe means you can interact with an object from several threads without encountering problems

jovial warren
#

since there won't be any race conditions if it's done on the same asynchronous thread

prisma wave
#

Indeed

jovial warren
#

since you can't have a single thread race to assign a value

prisma wave
#

In purely sequential code race conditions are borderline impossible

jovial warren
#

sequential?

#

meaning all on the same thread?

#

no

#

all in order

prisma wave
#

They kind of mean the same thing in this context

jovial warren
#

no calling iterator.next() on a separate thread since that puts in a race condition

prisma wave
#

Something all on a single thread would naturally be sequential

#

yes

pale shell
jovial warren
#

for now I could just wrap this all in the same thread and if it doesn't work I'll fix it later

prisma wave
#

Technically yes

#

I'm getting slightly out of my depth here but I don't think that's how you should do it

jovial warren
#

I mean, other than the kicking of players, nothing else in here needs to be done on the main thread

pale shell
#

Getting out of your depth?

#

I thought you know all of java

jovial warren
#

we're talking about coroutines

prisma wave
#

I believe coroutines are better used as a form of ExecutorService - you dispatch the tasks you need to a coroutine and use a callback for the result

#

This is kotlin

pale shell
#

Same thing

prisma wave
#

However the callbacks can be written as sequential code

pale shell
#

Kotlin java they're both the same

prisma wave
#

I think

jovial warren
#

can't you use Hikari for pooling rather than ExecutorService

#

@pale shell you mad?

prisma wave
#

Thread pooling and connection pooling are not the same thing

pale shell
#

If it posts hello world its the same

prisma wave
#

Blatantly untrue

#

but ok

jovial warren
#

anyway

pale shell
#

How so

jovial warren
#

so ExecutorService does connection pooling and Hikari does thread pooling?

prisma wave
#

The other way around

jovial warren
#

ah okay

#

also can't I launch a new thread using GlobalScope.launch or is that a bad idea

prisma wave
#

You can launch a new coroutine with that

topaz bay
#

so ExecutorService does connection pooling and Hikari does thread pooling?

prisma wave
#

And I don't think that's a bad idea no

prisma wave
#

lol

jovial warren
#

look, I've never done pooling before

topaz bay
#

I meeeaaannn, when youre using these, its not like you do anything special

prisma wave
#

You used coroutines much sx?

topaz bay
#

Not happily

jovial warren
#

also what do I replace thenApply with?

prisma wave
#

Darn

topaz bay
#

porquoi?

prisma wave
#

I am getting out of my depth here and wondered if you could offer more insight

topaz bay
#

context?

prisma wave
#

replacing futures with coroutines

#

db calls and such

jovial warren
#

pretty much

topaz bay
#

All you have to do is just write the code?

#

Although, I will ask.. is this a plugin?

jovial warren
#

so I just remove thenApply and thenCombine methods?

topaz bay
#

Because Skedule...

jovial warren
#

and yes it is

prisma wave
#

I believe so

#

yeah get skedule too

jovial warren
#

what's Skedule?

prisma wave
#

It integrates coroutine stuff into the bukkit scheduler

topaz bay
jovial warren
#

ah okay

topaz bay
#

oh wow... ole lookin good

jovial warren
#

this isn't just a bukkit plugin though

prisma wave
#

which is kind of like putting a plaster o top of a gaping wound but better than nothing

topaz bay
#

Not really?

#

Its pretty barebones integration

prisma wave
#

I mean the very idea of using coroutines in bukkit

jovial warren
#

can't use that in my common though

prisma wave
#

it feels wrong because you know you'll have to return to the main thread eventually

jovial warren
#

since common doesn't depend on Bukkit or Bungee

#

I don't know how to define it properly

prisma wave
#

@jovial warren I believe you bungee is more lenient regarding asynchronous code

jovial warren
#

I need an implementation that works for both

topaz bay
#

then just use coroutines normally?

prisma wave
#

Write the common stuff to use coroutines without bukkit, then use skedule when applicable

jovial warren
#

which means I'd prefer to do it without the context of either Bukkit or Bungee

#

then just use coroutines normally?
that's what I'm trying to do...?

#

just never ever used them before so got no idea how the hell they work

topaz bay
#

What are you even returning with this?

#

And why?

prisma wave
#

From a structural point of view your command executor is doing way too much anyway. All the DB related stuff should be delegated to an abstraction that means your commands don't care how you are storing data

jovial warren
#

returning?

topaz bay
#

Youre returning a completable future of any

#

why?

jovial warren
#

it returns a completablefuture, used in testing

topaz bay
#

WAIT IS THIS A COMMAND

jovial warren
#

that's used so I can call .join() in tests so it throws errors properly

#

YES

topaz bay
#

WHAT

#

WHY

#

???????

jovial warren
#

wdym why?

prisma wave
#

SRP is a thing

jovial warren
#

SRP?

topaz bay
#

Wdym you use join to throw errors properly?!?!??!

prisma wave
#

Single responsibility principle

topaz bay
#

You can throw errors properly without join

jovial warren
#

in testing @topaz bay

prisma wave
#

A command handler shouldn't even know that a database exists

topaz bay
#

In testing of what

jovial warren
#

src/test/java

#

command testing

#

I use mockk

#

I don't know how to properly explain it

topaz bay
#

....

#

WHY ARE YOU DOING THIS

jovial warren
topaz bay
#

Fucking throw it all away

jovial warren
#

wdym "fucking throw it all away"

topaz bay
#

This is honestly... not good..

jovial warren
#

also from those tests can you see why it returns a CompletableFuture now?

topaz bay
#

No...

prisma wave
#

That command handler (and the tests for that matter) are a massive violation of the SRP

topaz bay
#

Not only that, but youre designing based on testing???

jovial warren
#

also that wasn't me who made it return a CompletableFuture

#

you have to test to make sure things work properly

topaz bay
#

...

#

You could also just write sensible code

#

Instead of this monstrosity

jovial warren
#

I'm new to Kotlin alright gimme a break

topaz bay
#

This has nothing to do with Kotlin

prisma wave
#

If you want to get the messages just mock Player and store the params of sendMessage()

topaz bay
#

mocking spigot plugins is honestly just stupid

prisma wave
#

this structure is very question

pale shell
#

@jovial warren sx is being kind if you can't handle how Sx says things gl my guy.

prisma wave
#

questionable

jovial warren
#

IT ISN'T A SPIGOT PLUGIN

#

it's both

topaz bay
#

ITS STILL A PLUGIN

jovial warren
#

this part of the plugin isn't dependent on either Bukkit or Bungee

prisma wave
#

Abstract it then

jovial warren
#

abstract what?

#

common is abstract

prisma wave
#

Either Player or ProxiedPlayer

#

Into an abstract type that you can do sendMessage and things with

#

then you can write that code without caring about the implementation

jovial warren
#
interface Sender {

    val uuid: UUID

    val name: String

    fun hasPermission(permission: String): Boolean

    fun sendMessage(message: String)
}
prisma wave
#

yeah pretty much

jovial warren
#

that's copied straight out of my existing Sender

prisma wave
#

then just mock that?

jovial warren
#

I DID

prisma wave
#

to store the messages

topaz bay
#

WHY ARE YOU MOCKING AT ALL

jovial warren
#
val sender = mockk<Sender> {
            every { uuid } returns UUID.randomUUID()
            every { name } returns "Charles"
            every { hasPermission(any()) } returns true
        }
```?
#

mocks the sender

prisma wave
#

there's no reason to return a ConpletableFuture

#

From a command

jovial warren
#

as I said, returning CompletableFuture wasn't actually my idea

prisma wave
#

then change it?

jovial warren
#

I am now I'm using coroutines

prisma wave
#

yes but

jovial warren
#

I should be returning Unit correct?

prisma wave
#

Why is your command handler returning anything

#

Yes it should be unit

#

all your command handler should do is validate user input and send messages. Anything more than that should be done in another class

jovial warren
#

also do I just remove the CompletableFuture methods?

prisma wave
#

Yes

#

At this point I would just completely rewrite it

#

This is a huge refactor

jovial warren
#

completely rewrite the command handler?

#

alright I'll do that tomorrow

topaz bay
#

Fucking throw it all away

jovial warren
#

not happening

#

why would I throw it all away?

topaz bay
#

Because its for the best

prisma wave
#

Rewrite from the ground up with coroutines and actually following the SRP

jovial warren
#

I'll throw away the old code and replace it with new stuff

#

but I'm not just throwing away the old code and being done with it

#

anyway it's bed time now

#

I'll see you lot tomorrow

#

bye

prisma wave
#

ok

#

gn

topaz bay
#

@prisma wave I am thoroughly enjoying IntelliJ just completely not working

#

Infinitely analyzing

prisma wave
#

That's why you don't use EAP

#

What's it analysing?

#

the debug control flow analysis?

topaz bay
#

This is the highlighter

prisma wave
#

Oh lol

topaz bay
#

Wow... battle net isnt working

#

Im having a FUN TIME

prisma wave
#

Perhaps your pc is cursed

topaz bay
#

That seems like a reasonable conclusion

obtuse gale
#

I really need to drop this habit of naming my main class Main lol

ocean quartz
#

Actually i can make that better

#

Nice, now is just if (link.isPaste())

hot hull
#

How do I register an existing project as maven?

#

Found it

old wyvern
#

how better is PPPoA over PPPoE?

frigid badge
#

one is over ATM and other over Ethernet

#

basically ATM is asynchronous afaik

old wyvern
#

Yea but is the difference visible?

frigid badge
#

iirc ATM is short for something like Asynchronous xxx

old wyvern
#

Async Tranfer Mode

#

but

#

Issue is

frigid badge
#

well you don't really notice it

old wyvern
#

I got my connection back yesterday

#

but upspeed is so fucked

frigid badge
#

just that you don't have any MTU issues as well as less overhead

old wyvern
#

hmm

#

I think for now ill have to switch to 4g for uploads ๐Ÿ’€

hot hull
#
> [14:44:56 WARN]: [ProtocolLib] [PacketFilterManager] [DistrictCreeperEggs] Unsupported server packet in current Minecraft version: Dynamic-91871dbe-c8fb-4766-b470-5c3c92299197[LEGACY, SERVER, -1, classNames: [] (unregistered)]
> [14:44:57 WARN]: [ProtocolLib] [PacketFilterManager] [DistrictCreeperEggs] Unsupported server packet in current Minecraft version: Dynamic-c90ec39d-8a67-4ecb-bcd3-c088f6fd0afd[LEGACY, SERVER, -1, classNames: [] (unregistered)]
> [14:44:59 WARN]: [ProtocolLib] [PacketFilterManager] [DistrictCreeperEggs] Unsupported server packet in current Minecraft version: Dynamic-03a44df7-5ac1-4855-aadc-b307dc852513[LEGACY, SERVER, -1, classNames: [] (unregistered)]
> [14:45:01 WARN]: [ProtocolLib] [PacketFilterManager] [DistrictCreeperEggs] Unsupported server packet in current Minecraft version: Dynamic-debb335f-f07e-41c6-8fb3-0b143df6336d[LEGACY, SERVER, -1, classNames: [] (unregistered)]

Any suggestions on easiest way of hiding this?

onyx loom
#

hideConsole();

old wyvern
#

suppressed reports:

#

Add the REPORT_UNSUPPORTED_SERVER_PACKET to there @hot hull

#

ProtocolLibrary.getConfig().setSuppressedReports(-);

sullen storm
#

it's possible to make an itemstack with negative amount ?

heady birch
#

I don't think so

#

Not sure what happens if you try, probably illegal argument exception

old wyvern
#

I think in newer versions it just removes the item

sullen storm
#

there is not a way around the problem?

hot hull
#

Why do you even want negative amounts lol?

brave minnow
#

@prisma wave you told me to setup gradle can you explain me how pls ? D:

prisma wave
#

Sure

#

In Intellij it's very easy - go to new > project > gradle

#

Put in your group id (eg me.bristermitten) and artifact id (eg myprojectname)

#

And you're pretty much done

#

I'm about to shower but I can give more info soon

brave minnow
#

np

#

this part was the one I knew but I don't know how to add dependencies ^^'

prisma wave
#

You should find this useful

brave minnow
#

yep already saw it thx ๐Ÿ˜„

prisma wave
#

Np

old wyvern
#

oh I just noticed he wrote rank out write for the first time

heady birch
#

lol

#

Rang

brave minnow
prisma wave
#

That URLClassLoader is invalid for one thing

#

new URL[]{mriUrl}

#

Then you can do Files.copy(InputStream, Path) to copy from the resource to the file

topaz bay
#

lol

prisma wave
#

It's too big probably

#

The kotlin repo is huge

jovial warren
#

lol

#

doesn't codacy cost?

onyx loom
#

so then guys. day 2 of kotlin ๐Ÿ’ฏ

onyx loom
jovial warren
#

can we get a memes channel please admins

#

lol

prisma wave
#

I guess that's just off topic

prisma wave
#

hehe

jovial warren
prisma wave
#

I saw

#

Lemme find my personal favourite

jovial warren
onyx loom
#

that ones great

prisma wave
hot hull
#

lol

old wyvern
#

xD

onyx loom
#

๐Ÿ˜‚

jovial warren
#

lol

old wyvern
#

Yes!

obtuse gale
#

Did you guys know that kotlins better

jovial warren
prisma wave
#

Wait really

#

Kotlin's better

onyx loom
#

kotlin is definitely better

#

kotlin kotlin kotlin

prisma wave
#

?? isn't a thing tho ๐Ÿค”

jovial warren
#

it's a meme lol

obtuse gale
#

๐Ÿค”

prisma wave
#

imagine making a meme that's factually incorrect

#

Couldn't be me

jovial warren
#

not my meme

prisma wave
#

then you should write an angry comment to whoever made it

jovial warren
old wyvern
quiet depot
#

ew facebook

old wyvern
jovial warren
#

lol

prisma wave
#

lmao

old wyvern
#

xD

prisma wave
ocean quartz
#

I don't see how labeled expression would be bad in this case, i mean you need it to be

jovial warren
#

with caption "friendly reminder from Google that it's time to move on"

prisma wave
#

@ocean quartz labelled expressions are kinda ugly imo

#

given that you can do it without any return

old wyvern
#

ayy

#

xD

prisma wave
#

Does anyone actually use Haskell?

#

like anyone?

jovial warren
#

what even is haskell?

#

lol

onyx loom
#

never heard of it tbh

jovial warren
#

same

prisma wave
#

Some obscure functional language

#

The syntax is nice enough but I've never heard of anyone using it

#

Ever

jovial warren
#

what even is purely functional programming

#

Wikipedia time

ocean quartz
#

I agree, but the thing is some of them aren't really possible without the return, or at least I can't see how it would work

old wyvern
#

wha

heady birch
#

๐Ÿ˜ฎ

old wyvern
#

I posted a language dammit

prisma wave
#

In your example you don't need the return at all @ocean quartz

ocean quartz
#

For example:

commandManager.registerParameter(Member::class.java) { argument ->
    if (argument == null) return@registerParameter TypeResult(argument)
    val numericArg = argument.toString().replace(("[^\\d]").toRegex(), "")
    val guild = jda.guilds.firstOrNull() ?: return@registerParameter TypeResult(argument)
    return@registerParameter TypeResult(guild.getMemberById(numericArg), argument)
}
frigid badge
#

I've used Haskell

#

cause I wanted to learn to use it

prisma wave
#

:O

frigid badge
#

never actually had a practical use for it nor used at work

old wyvern
jovial warren
#

that type of return should only be used when there is more than one return context

onyx loom
#

what the fuck is that

prisma wave
#

Which there is

old wyvern
#

a esoteric language

prisma wave
#

Brainfuck is cool

quiet depot
#

SPL is the best language

onyx loom
#

pig

#

now

jovial warren
#

what's SPL?

quiet depot
#

why the shakespeare programming language of course

jovial warren
#

get out

old wyvern
#

wha

#

gods

#

xD

#

what the hell xD

jovial warren
#

is that a hello world program

prisma wave
#

Cook is nice too

old wyvern
#

seems to be xD

jovial warren
#

not even a language

#

that's just a play script lol

quiet depot
old wyvern
#

lol

jovial warren
#

all that for a hello world program

#

as I said, not even a language

frigid badge
#

kotlin be like

#

'it'

old wyvern
jovial warren
#

tf is that?

quiet depot
#

what's that old ass language that uses a bunch of symbols

#

apl?

frigid badge
#

emoji code is

#

weird

quiet depot
frigid badge
onyx loom
#

๐Ÿ˜‚ thonking ๐Ÿ˜ข

prisma wave
#

You've just segfaulted

quiet depot
prisma wave
#

Nice one

jovial warren
#

these types of languages are just jokes

quiet depot
#

apl is a legit language

prisma wave
#

Esoteric is the term

frigid badge
#

๐Ÿ ๐Ÿ‡
๐Ÿ˜€ ๐Ÿ”คHey!๐Ÿ”คโ—๏ธ
๐Ÿ‰

jovial warren
#

wtf is grapes supposed to mean?

#

the flag means start

rotund egret
#

open bracket

jovial warren
#

ah okay it's just the start of a code block

old wyvern
#

brainfuck is not a joke

rotund egret
#

void {
print(" Hey!");
}
effectively

jovial warren
#

HAHAHAHA

#
fun main() {
    println("Hello World!")
}
#

I bet that can be simplified

#

fun main() = println("Hello World!")?

#

or do you not even need a main function there

#

no you do

prisma wave
#

.kts

println("Look mum, no main function!")```
jovial warren
#

ah okay

prisma wave
#

That's only for scripts mind you

jovial warren
#

that's kotlin for py actually

#

did you know you can actually write a Minecraft plugin in Python if you want to lol

rotund egret
#

Minecraft plugins in brainfuck when

jovial warren
#

lol

#

I think graal actually supports more than just Python as well

prisma wave
#

Graal is very cool

#

although Jython is a thing

#

so you technically don't need graal

jovial warren
#

is jython just python that runs on the JVM?

#

also you know Kotlin is named after an island in Russia near St. Petersburg lol

#

go figure

#

Java was also named after an island

lunar cypress
#

Jython is a python port to the jvm, yes

topaz bay
#

Trash

obtuse gale
#

AHH

lunar cypress
#

Not particularly great, though

obtuse gale
#

I just got a NPE for the first time in ages

jovial warren
#

Python is one of those duck typing languages though

lunar cypress
#

So?

jovial warren
#

well I guess Python isn't as bad as other duck typing languages that say "true + true = 2"

lunar cypress
#

That is something different

jovial warren
#

I guess things like that are just typical JS

lunar cypress
#

Also I wasn't saying that Python isn't great, but that Jython isn't great

jovial warren
#

yeah

lunar cypress
#

I have nothing against the language really. It's just... ports

#

They tend to suck

jovial warren
#

I think graal isn't too bad

prisma wave
#

Just stick to the language you're using, don't try and make some amalgamation of 2 completely different languages together

#

Graal is a different thing though

jovial warren
#

yeah

lunar cypress
#

^

#

The JVM has its own rules and ports like Jython decide to not embrace them and instead build their own incompatible thing on top

prisma wave
#

Precisely

#

It's dumb

lunar cypress
#

It may have some niche applications but you should generally avoid it

quiet depot
#

like, avoid python at all costs in general

#

yucky ducky

#

ducks are meant to be cute

#

python aint cute

lunar cypress
#

Python is absolutely cute

onyx loom
jovial warren
#

I have to use python since it's what my school teaches lol

#

and no matter how many times I ask the GOD DAMN IT TEAM TO GIVE ME FUCKING INTELLIJ THEY JUST DO NOTHING

onyx loom
#

lmao look at the 4th image caption

jovial warren
#

sorry that just really pisses me off

quiet depot
#

at least your school embraces computers

#

my school is in the stone age

jovial warren
#

yeah

distant sun
#

fr

onyx loom
#

just move school

lunar cypress
#

How can you complain about learning python at school lol

onyx loom
#

not hard

jovial warren
#

one of the deputy head's is my senior link and she said she'd deal with it, and she's still done absolutely fuck all

#

and to even get attention it took me taking my laptop in

quiet depot
#

what ide are you using for python rn?

jovial warren
#

right now? not using python

#

at school we use pyscripter

obtuse gale
#

im gonna have to do php next year in school

jovial warren
#

and it's dog shit

quiet depot
#

did you mention that pycharm is free for educational institutions?

jovial warren
#

we only use pyscripter though because it's portable and so doesn't allow people to run python scripts on the main machine

#

I should do that

quiet depot
#

oh so the real problem is that they lack a competent it department

#

got it

jovial warren
#

I've told the head of Computer Science about GitHub Campus so I'm hoping they'll look in to it

#

but chances are they'll do fuck all

onyx loom
#

is that even a chance

jovial warren
#

and yeah, they've got no idea

#

definitely lack of incompetency

quiet depot
#

that is definitely not what I said

obtuse gale
#

I tried to get my media teacher off dreamweaver

#

did not go well

jovial warren
#

when you know more about programming than like the entire department you know there's something wrong with competency

#

combined may I add

#

they really don't teach the teachers much though

lunar cypress
#

No offence, but you sound a little hard to deal with

jovial warren
#

guess I get free repl.it with the github student developer pack, probably the best I'm going to get

quiet depot
#

my school had a programming teacher for one term, he just happened to teach java, by some great fluke. I demonstrated my knowledge, he asked what IDE I used for personal development, and I said intellij. He said he never heard of it, and said he used android studio. At that point, I knew for certain that my school had no hope whatsoever of ever having a competent computer related subject

obtuse gale
#

._.

onyx loom
#

๐Ÿ˜‚

quiet depot
#

just incase you're confused

#

android studio = intellij with some bubbles and fluff

old wyvern
#

he used android studioxD intellij

jovial warren
#

yeah I know

obtuse gale
#

my schools just tought me HTML for the past 5 years

onyx loom
#

bruh

obtuse gale
#

And I still dont know it that well

onyx loom
#

bruh

old wyvern
#

You can use android sdk on intellij itself right?

jovial warren
#

my school teaches python and it's really annoying

quiet depot
#

yes

obtuse gale
#

html is like the go to school "coding" language

quiet depot
#

intellij ultimate has the functionality of all jetbrains ides

jovial warren
#

yeah

old wyvern
jovial warren
#

pretty much

old wyvern
#

it has on community too

#

afaik

jovial warren
#

wait Minecraft is an option?

old wyvern
#

plugin

quiet depot
#

that's a plugin

jovial warren
#

ah okay

#

I usually choose the maven option from that list

prisma wave
#

ew

quiet depot
#

consider picking gradle next time

prisma wave
#

gradle good java bad

jovial warren
#

might have to start using gradle if it actually does build faster

prisma wave
#

it does

#

massively faster

quiet depot
#

speed isn't really the primary factor

jovial warren
#

what is?

quiet depot
#

it's more so that gradle is infinitely simpler

jovial warren
#

isn't for me

prisma wave
#

simplicity, accessibility, extendability

#

gradle is much less verbose, it's actual code so you can do much more, it's faster,

jovial warren
#

I just don't like the way it's written, I personally prefer maven's XML layout, personally I find that easier to read

prisma wave
#

๐Ÿค”

jovial warren
#

but if it's faster I'll switch

prisma wave
#

it is

#

much much faster

jovial warren
#

if the days of it taking like two minutes to build my little project can be gone then I'll happily switch

topaz bay
#

Fun fact, a snake's pit organs are fucking gross

prisma wave
#

wow

#

very fun

jovial warren
#

lol

#

also, does anyone here use PIT? just curious

#

if you don't, you should check it out

quiet depot
#

well, compare this:

repositories {
  maven {
    url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots"
  }
}

dependencies {
  compileOnly "org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT"
}```
```xml
<repositories>
    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.15.2-R0.1-SNAPSHOT</version>
           <scope>provided</scope>
    </dependency>
</dependencies>```
if you can look at that, and say maven is simpler, you're off your chops
topaz bay
#

ugh

#

fucking disgusting

#

GROSS

prisma wave
#

ok

jovial warren
#

basically it mutates your code (not actually, but in it's own thing), and finds where the program survives (surviving means you didn't test that part)

#

well, compare this:

repositories {
  maven {
    url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots"
  }
}

dependencies {
  compileOnly "org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT"
}```
```xml
<repositories>
    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.15.2-R0.1-SNAPSHOT</version>
           <scope>provided</scope>
    </dependency>
</dependencies>```
if you can look at that, and say maven is simpler, you're off your chops

must be off my chops then lol

quiet depot
#

can confirm, you're off your chops

frail glade
#

Also with Gradle you can specify which things come from which repo

prisma wave
#

definitely off it

old wyvern
#

what does off my chops mean?

topaz bay
#

stupid

#

lol

old wyvern
#

ah

jovial warren
#

pretty much

#

out of your mind is another one

quiet depot
#

^

#

that's more like it

#

not necessarily stupid

topaz bay
#

nah

#

stupid better

quiet depot
#

just not thinking straight at that moment

jovial warren
#

yeah

old wyvern
#

I see

jovial warren
#

but no, if gradle is going to make a significant enough difference in performance at least then I'll switch

prisma wave
#

it will

topaz bay
#

You would choose maven over gradle?

#

Thats just dumb

jovial warren
#

not now I know gradle performs better no

topaz bay
#

Even if it performed the same

#

Gradle is infinitely better

jovial warren
#

if it performed the same I'd choose maven

quiet depot
#

๐Ÿ˜ฆ

topaz bay
#

Why...

quiet depot
#

bardy it's not your fault

topaz bay
#

XML is fucking stupid

quiet depot
#

majority of spigot community is brain washed

prisma wave
#

lmao

jovial warren
#
  1. Because I'm used to it
  2. Because I prefer the layout of XML personally, don't even begin to ask why it's just a personal preference
prisma wave
#

"i use eclipse build path because it works fine and a youtuber said to"

jovial warren
#

get out

topaz bay
#

Wdym you prefer the layout of xml

jovial warren
#

I prefer how everything is laid out

#

you know, you have your group id, then your artifact id, then your version, then your scope, your type, the sections just make it easier for me to read

onyx loom
#

"i use eclipse build path because it works fine and a youtuber said to"
@prisma wave
lmao

jovial warren
#

idk

prisma wave
#

Gradle does all of that in 1 line

topaz bay
#

You say that as if you cant define dependencies like that in gradle

jovial warren
#

Gradle does all of that in 1 line
that's the part I don't quite like

#

I know it makes more sense but

#

I just don't like it

prisma wave
#

"not enough boilerplate"?

jovial warren
#

it's just a personal preference

#

no

topaz bay
#

compile group: 'org.spigotmc', name: 'spigot-api', version: '+'

jovial warren
#

that's better

prisma wave
#

i would take 10 lines of groovy over 150 lines of XML any day

jovial warren
#

compile group: 'org.spigotmc', name: 'spigot-api', version: '+'
that's more like it

prisma wave
#

that's ugly tho

topaz bay
#

Are you unable to process a colon delimiter?

jovial warren
#

I find that easier to read than "org.spigotmc:spigot-api:SPIGOT-VERSION"

#

no

#

as I said it's just personal preference and what I'm used to

jovial warren
#

I guess the "groupid:artifactid:version" fits in more with my code style

onyx loom
jovial warren
#

if you aren't familiar with what said style is, basically it's compactness and efficiency over readability

prisma wave
#

ew

jovial warren
#

kinda the way I live the rest of my life

prisma wave
#

readability directly correlates with efficiency

#

basing code on compactness is generally a bad idea

jovial warren
#

as long as I don't spend hours making my code look nice I'm good

quiet depot
#

that's exactly what you should be doing

topaz bay
#

I mean... if youre a good programmer it doesnt take hours

onyx loom
#

@topaz bay im struggling to understand what that guy is touching in that gif

topaz bay
#

It just flows out

#

@onyx loom I think hes turning the fan off?

jovial warren
#

gimme an example of what good looking code is to you

onyx loom
#

idk man

#

the fan keeps spinning

jovial warren
#

and I'll show you what I'd write instead

onyx loom
#

maybe there isnt enough time for it to turn off fully

quiet depot
jovial warren
#

that's Java

onyx loom
#

thats java

topaz bay
#

@jovial warren literally the complete opposite of whatever that completablefuture shit you wrote was

jovial warren
#

yeah I'll give you that

quiet depot
#

oh you want kotlin

prisma wave
#

java can still be clean

jovial warren
#

using a future there was a bit of a java thing

quiet depot
#

look into sxtanna's highest effort project then

#

whatever that is

prisma wave
#

boilerplate != unclean code

jovial warren
#

it's just what I was using in my old code

winter ravine
#

how can i cancel the PlayerArmorChangeEvent when a player join the server?

jovial warren
topaz bay
#

Heres some amazing code

#

LMFAO

jovial warren
#

that snaky, mountainous crap

#

meaning my code, not yours

ocean quartz
#

welcome to the korm fields

topaz bay
#

@ocean quartz FIGHT ME

jovial warren
#

allman

topaz bay
#

Yes?

prisma wave
#

korm is bad

jovial warren
#

probably my least favourite style

prisma wave
#

doesn't even work

#

i'm having to fork it to fix it

jovial warren
#

some of these should be expression bodies

topaz bay
#

I mean.... thats the point of OS?

jovial warren
#

OS?

#

open-source

topaz bay
#

open source

prisma wave
#

ik

#

but i don't wanna have to fix your mess

#

it's depressing

jovial warren
#

also, that style goes against kotlin's official coding conventions

topaz bay
#

Exactly what are you fixing?

prisma wave
#

korm can't deserialize lists properly

#

cannot cast ParameterizedTypeImpl to Class

jovial warren
#

what's korm?

prisma wave
#

a language

#

json but cleaner

jovial warren
#

ah okay

topaz bay
#

@prisma wave thats just not true

prisma wave
#

I literally have logs of it happening

ocean quartz
topaz bay
#

And I have millions of usages of it working properly

jovial warren
#

you should just use exposed for object-relational mapping imo

prisma wave
#

i...

topaz bay
#

You can say that it cant deserialize whatever youre throwing at it

prisma wave
#

so I'm making it up?

topaz bay
#

Which is fine to say

#

But to say that it cant deserialize lists is bullshit

#

Its one of the core fucking data types in korm

prisma wave
#

i have no clue how it works

#

i'm getting paid to fix your mess lmao

frail glade
#

@ocean quartz I love that so much.

ocean quartz
#

I'm glad

jovial warren
#

wait this allman style looks an awful lot like JSON

prisma wave
#

it might be being used as a string instead of a list

topaz bay
#

No, youre getting paid to work with someone I dont have the willpower to work with anymore

jovial warren
#

is this your project?

#

this korm thing

topaz bay
#

It has my fucking name in the link doesnt it?

#

jesus christ

jovial warren
#

good point

#

well ya never know

#

glare uses clip's package name in voteparty

#

ya never know

prisma wave
#

No, youre getting paid to work with someone I dont have the willpower to work with anymore
and the thing I am getting paid for is fixing bugs

topaz bay
#

Its literally a repo ON MY GITHUB ACCOUNT

jovial warren
#

alright alright, no need to bite my head off

topaz bay
#

@prisma wave Good, take his money

prisma wave
#

i don't want to ๐Ÿ˜ฆ

topaz bay
#

A normal person would have made an issue

prisma wave
#

it's confusing

topaz bay
#

A normal person would report the bug

prisma wave
#

apparently he did ยฏ_(ใƒ„)_/ยฏ

jovial warren
#

no such thing as a "normal" person mate

prisma wave
#

or do you mean me

topaz bay
#

A weird person complains about it, and then complains about something not working

#

Im talking about you

prisma wave
#

oh

topaz bay
#

Youre complaining about not knowing how it works, and that you have to fix the mess

prisma wave
#

He said he'd contacted you already so

topaz bay
#

But I strangely dont see a fucking issue on this repo

jovial warren
#

you go from 0 to about 5000 in about 0.2 seconds dude chill man

prisma wave
#

well I'm happy to make some if you like

#

but I was under the impression that you're not at all interested in working on the project anymore

topaz bay
#

No, it pisses me off when people dont use their brain properly

#

Like evolution came THIS far

#

For you to just throw away the billions of cells

onyx loom
#

not very far then

topaz bay
#

in your head

prisma wave
#

...

jovial warren
#

does that also apply to opinions then?

topaz bay
#

huh?

jovial warren
#

because you seem to take a chunk out of anyone who doesn't agree with you

prisma wave
#

and what exactly would be the point of making an issue if apparently you've been completely ignoring the project for over 3 months?

topaz bay
#

@jovial warren You have the right to hold an opinion, and I have the right to say youre an idiot for it

#

@prisma wave what??

#

If theres an issue with something not working, make an issue for it

#

And I will fix it...

prisma wave
#

bruh

jovial warren
#

I know that, but I'd rather not have my head bitten off for stating my opinion, please

prisma wave
#

I was told you've been completely ignoring chris so how was I to assume that you'd suddenly be interested in doing bugfixes

topaz bay
#

@jovial warren then dont state them in a public forum?

#

You dont have the right to be unopposed

#

@prisma wave korm is not related to chris bruh

#

chris has nothing to do with my language

prisma wave
#

korm is only 1 problem

#

most of the problems are in the main project

topaz bay
#

Korm is the problem you just brought up

prisma wave
#

hm

jovial warren
#

no but you don't have the right to take the piss out of people just because their opinion differs from yours either

onyx loom
topaz bay
#

korm is bad
doesn't even work
i'm having to fork it to fix it

prisma wave
#

fine

#

i'll make an issue

topaz bay
#

@jovial warren yes I do

prisma wave
#

but that's not gonna help with the rest of my problems

topaz bay
#

freedom of speech bruh

#

If you dont like it, block me

#

simple

#

@prisma wave I dont care about the rest of your problems

#

Youre the one being paid to worry about it

jovial warren
#

you've got a bad attitude wow

topaz bay
#

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

prisma wave
#

evidently

topaz bay
#

Did you assume I was supposed to?

#

????

prisma wave
#

given that they're problems in your code, then yes

topaz bay
#

Yeah, the code YOURE being paid to "fix"

prisma wave
#

the fact that he's having to pay someone is a problem in itself

topaz bay
#

?????

jovial warren
#

paying someone else to fix your problems is just laziness

#

and also, most of the time, things actually get done when you do it yourself because it's your task so you usually have the most motivation to do it

prisma wave
#

it's not my code, he shouldn't need to pay someone else to fix bugs

topaz bay
#

You dont even know what youre talking about bruh...

#

@prisma wave Your issue is that you clearly dont understand the scope of what this is

#

What you have in front of you is not the original project

#

Its LITERALLY around the 30th iteration of it

#

Every iteration worked fine, until he wanted some other feature

#

Some new hook into some other random bullshit

#

Almost all of the issues on that project had to do with working with other plugins

#

I dont have the time, nor the will to keep fucking around with other shit all damn day

jovial warren
#

sounds like it would cause problems tbf

topaz bay
#

The original project, what he originally wanted, worked fucking perfectly fine

prisma wave
#

nah you got a point

topaz bay
#

That was nearly 3 years ago

prisma wave
#

but how was I supposed to know that

topaz bay
#

You could probably start by fucking asking

#

Like NORMAL people do

#

kjndaszvkhjcXvbkc

prisma wave
#

asking what exactly?

heady birch
#

Hold up

#

What seems to be the issue here

#

๐Ÿ˜‹

jovial warren
#

nobody asks a question when they don't even know what they're asking

topaz bay
#

shutup niall

#

lmfao

prisma wave
#

good question

jovial warren
#

and also, no such thing as a normal person

heady birch
#

Lol

prisma wave
#

but fr what was I supposed to ask?

onyx loom
#

im with niall on this one

heady birch
#

I dont even know whats going on

#

Just stick a nice emoji into the conversation

jovial warren
#

basically BM has been paid to fix someone else's code

prisma wave
#

incidentally i've realised why korm broke

#
lines: "

&bTemple Name:
  {temple_name}
 
&bClaimed By:
  {group_name}
  
&bStatus:
  {temple_status}
  
"``` this ain't a list
onyx loom
#

๐Ÿค“

#

random emoji @heady birch

heady birch
#

๐Ÿ˜ซ

topaz bay
#

That would be because you have an outdated version

#

I changed the scoreboards to be a single a very long time ago

prisma wave
#

pretty sure i cloned from the latest on space

topaz bay
#

And wow, crazy... turns out... Korm DOES work

#

WOW

#

Imagine that

jovial warren
#

space?

prisma wave
#

jetbrains space

jovial warren
#

tf is that?

prisma wave
#

it's like project management mixed with Git