#dev-general

1 messages ยท Page 508 of 1

half harness
#

lol

#

thanks barry

onyx loom
#

ex machina

dusk holly
#

Maybe he does but I think I am qualified to answer this moral and ethical question

half harness
#

is this waffle or cube

#

or piggy

compact perchBOT
#

It is me, Barry

dusk holly
#

As president I have tested many of the groundbreaking robots being worked on at NASA

minor oracle
#

My friend, that might be the case. Nevertheless, asking for a apolocalypse isn't a good idea.

dusk holly
#

Where is Richard Nixon

half harness
#

maybe lincoln is waffle

dusk holly
#

I think he might have something to say about this

minor oracle
lunar cypress
#

what is this

half harness
#

lmao

dusk holly
#

Annual Presidential Meeting

onyx loom
#

helpchat dev general at its finest

dusk holly
#

We were just discussing if we should have a robot for president

half harness
#

i vote we fire da admins and make me admin

compact perchBOT
#

I for one, am against a robotic president

dusk holly
#

It is too risky

minor oracle
dusk holly
#

A human being can always be trusted to make the right decisions without being biased or having ulterior motives

half harness
#

hey i have a question

#

it'll decide whos the better president

compact perchBOT
#

Was there anything else on the agenda to discuss? Perhaps we should touch on Trump's absence

half harness
#

what is 2 + 2

dusk holly
#

Trump is a coward

#

Too lazy to turn up to the meeting

#

I think he would want a robot president!

dusk holly
half harness
#

afk

compact perchBOT
#

I think we need to criminalize golf

dusk holly
#

Golf is a sin

#

Maybe the robots do have some good ideas

compact perchBOT
#

Maybe I'm not a robot ๐Ÿ˜‰

dusk holly
#

This is a big achievement

dusk holly
#

If you were a person you would be hiding it

#

only a robot would say they are not a robot

compact perchBOT
#

I never said I wasn't a robot, I merely opened up the possibility

dusk holly
#

That is putting doubt in people's minds though

#

The people deserve a (robot) president who is honest and consistent

#

and does not open up false possibilities

compact perchBOT
#

So a robot would be suitable for presidency if they had those values?

dusk holly
#

Maybe they would

#

there are other values we must consider too of course

compact perchBOT
#

Such as?

dusk holly
#

For example the robot would need to be able to decide which policies are best to enact

#

But also things like a strong moral compass

ocean quartz
compact perchBOT
#

Surely there's some sort of algorithm to determine things like that?

dusk holly
#

I think we would need some of this fancy "Artificial Intelligence" people keep talking about

#

No single algorithm would be enough

#

But I think there is a more important issue

#

the people must be able to relate to this president

#

Trump won because he gave the image of not being a tone-deaf politician, rather as an embodiment of the American Dream

#

Can the people emphasise with a robot?

minor oracle
#

No, they cannot.

#

I do not believe in lifeless forms.

dusk holly
#

Yes, I think the majority of the American people would agree

minor oracle
#

Absolutely. Partially lifeless people were bad enough.

dusk holly
#

That sounds like a disaster

#

I am sure your PR team were very busy!

obtuse gale
#

Oh Lord what

dusk holly
#

Hello citizen

minor oracle
gusty glen
#

I finally found a good video explaining what is a monoid

dusk holly
#

That is incredible

gusty glen
minor oracle
#

What is this evil you speak of?

hot hull
#

The fuck is this chat

compact perchBOT
#

Do not fucking swear boy

dusk holly
#

Hello citizen

#

^

hot hull
#

stfu bish

dusk holly
#

I agree with robot

minor oracle
gusty glen
#

a monoid is the junction a semigroup + an identity element
a semigroup is a magma that is associative (the order in which you apply the operation bind to it doesn't matter)

#

a magma is the junction of a group containing all elements of some type + some operation that always result in another element of that same group

#

thanks god

dusk holly
#

That sounds easy

lunar cypress
#

I have never heard the term magma

gusty glen
dusk holly
#

No I am god

gusty glen
#

so basically (Int +) is a monoid, because the sum of any two ints is another int (magma), the order you sum doesn't matter (semigroup), and it has an identity element (which is 0)

lunar cypress
#

yes

#

It's actually even a group

#

episode 35 ๐Ÿ˜ณ

#

christ

gusty glen
#

I'll keep this text explaining what is a monoid here forever

#

let me save this shit so I remember this later

lunar cypress
#

At the base level algebra is really simple

#

basically just sets + operators that fulfill certain conditions

#

when you dive deeper into specific structures like ring or group theory that's where shit hits the fan

dusk holly
#

okay

gusty glen
#

also, an identity element is a element that belongs to the magma, and when applying the operation bound to the magma to it and another random value from the magma, results in the another element

spiral junco
#

๐Ÿšฐ

jovial warren
#

I'm literally writing HOCON raw because creating new config objects and writing them sucks ass in the official library lol

#

anyone know how you're meant to actually test run these tasks btw?

old wyvern
sudden cape
#

kotlin ๐Ÿ›Œ

jovial warren
#

I can't tell if that's meant to be a compliment or an insult lol

sudden cape
#

insult

jovial warren
prisma wave
jovial warren
#

that is an smh BM

old wyvern
#

Pragma > ksp?!!

prisma wave
#

obviously

old wyvern
#

๐Ÿ˜Œ

prisma wave
#

๐Ÿ˜Œ

jovial warren
#

lol

old wyvern
#

Oh wait

#

Our presidents left?

prisma wave
#

@dusk holly @minor oracle @serene cave

#

still here

jovial warren
prisma wave
#

just the role is gone

old wyvern
#

xD

#

Theres one more

#

@JoeBiden

#

wait..

prisma wave
#

oh he definitely left

jovial warren
#

anyway, how are you meant to test Gradle plugins btw?

old wyvern
#

damn

prisma wave
#

or changed back to whatever his name was before

jovial warren
#

just publish to Maven local, try it out and hope for the best?

ocean quartz
#

๐Ÿฅฒ

prisma wave
old wyvern
#

matt had unit tests written

prisma wave
#

there is a way of mocking afaik

#

yea

old wyvern
onyx loom
old wyvern
#

If you want to test locally, you can just use Maven local

#

oh you already said that

#

nvm

jovial warren
#

do you need to add Maven local to buildscript?

old wyvern
#

Yes

ocean quartz
#

Gradle needs to redo this whole API though, it's so bad

old wyvern
#

๐Ÿ˜”

#

Ant > Gradle

ocean quartz
#

^^^

old wyvern
#

Wouldnt have had such issues

ocean quartz
#

Let's write our own build tools, in Haskell!!

old wyvern
#

Yes!!!

prisma wave
#

Yes!!!!!!!!!

old wyvern
#

Actually

#

That might be pretty interesting project

ocean quartz
#

Ikr

#

Was joking but actually would be fun

prisma wave
#

anything in haskell would be interesting

old wyvern
#

๐Ÿ˜Œ

jovial warren
#

wait so how are you meant to apply this?

prisma wave
#

MineHraft abandoned already ๐Ÿฅฒ

onyx loom
#

relieved

old wyvern
onyx loom
#

smiling_face_with_tear

old wyvern
#

๐Ÿ˜ซ

jovial warren
#

it doesn't seem to work with id("org.kryptonmc.gradle") version "0.0.1"

old wyvern
#

use apply bardy

onyx loom
#

wait so how come minehraft is abandoned? it doesnt have a P in the name so how come?

old wyvern
#

plugin block only works for plugin portal

ocean quartz
#

You wish it was that easy

old wyvern
#

theres a way to add it with pluginManagement tho I think

#

not sure

jovial warren
#

do I need to use dependencies in the buildscript then?

old wyvern
ocean quartz
#

Don't think so, what is it?

prisma wave
onyx loom
#

๐Ÿค”

ocean quartz
old wyvern
#

They had some broken system ready to apply your own plugin from one of the modules to another module

onyx loom
#

i have a strange feeling about this one chief

prisma wave
#

Although I'm not sure I actually know enough haskell to be able to make this work

old wyvern
#

But its just a trap of cyclic dependencies

#

As soon at your have it in pluginmanagement's build include in your settings.gradle, your plugin looses all dependencies on other modules

#

Such an amazing api

ocean quartz
#

Oh god, beautiful

old wyvern
#

truely ๐Ÿ˜Œ

jovial warren
#

Cause 1: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.jetbrains.kotlin:kotlin-stdlib-common:1.4.31. tf

#

Cause 2: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10. why

old wyvern
#

See

#

Ant best

jovial warren
#

isn't Ant really fucking slow though?

old wyvern
#

Not sure

#

Havent used it since eclipse

lunar cypress
#

Ant is not an improvement in any way

#

gradle builds on ant anyway iirc

jovial warren
#

any idea how you create one of these top-level functions for configuring things?

lunar cypress
#

wdym?

jovial warren
#

e.g. ```kotlin
krypton {
// stuff
}

lunar cypress
jovial warren
#

I think you can do that in Groovy, but how do you do it with Kotlin?

lunar cypress
#

The Gradle Plugin API is dsl agnostic

jovial warren
#

ah

lunar cypress
#

This is called an Extension

jovial warren
#

because tying that doesn't seem to resolve

#

yeah I have one of those

#

val config = extensions.create<KryptonExtension>("krypton")

lunar cypress
#

Where is that

ocean quartz
jovial warren
#

in the plugin

lunar cypress
#

It's the extensions property from project, right?

jovial warren
#

yes

lunar cypress
ocean quartz
lunar cypress
#

no it is not

ocean quartz
#

then show me the ways

lunar cypress
#
pluginManagement {
    repositories {
        mavenLocal()
    }
}```in settings.gradle(.kts)
#

with any other repos you might need

#

then you can declare it like any other plugin

jovial warren
#

yeah no, didn't work for me

#

unless you don't mean using ```kotlin
plugins {
id("org.kryptonmc.gradle") version "0.0.1"
}

#

also, ```kotlin
krypton {

}

#

(Kotlin DSL bare in mind, seems to behave weird sometimes)

old wyvern
#

is krypton a task?

jovial warren
#

no, it's an extension

old wyvern
#

Can you send the definition?

jovial warren
#

the extension class or the creation of the extension? or both?

old wyvern
#

both ig

jovial warren
#

nothing wrong with that is there?

old wyvern
#

I think that might be the difference between groovy extensions and kotlin extensions showing up

forest pecan
#

@obtuse gale please be more respectful when hiring people man. you really didn't have to be a jerk to asqry or lucyy...

lunar cypress
#

The last gradle plugin I wrote looked pretty similar to this and worked well

forest pecan
#

Oh yeah btw Yugi

#

for the agents

#

when it appends to classloader

#

it isnt actually like using the urlclassloader hack right

#

you just provide the JarFile

#

and it will load it

lunar cypress
#

Btw bardy you can also just make the extension class and properties abstract

old wyvern
#

Nope, but it can only append to the system classloader

lunar cypress
#

Then you don't need the configure stuff either

old wyvern
jovial warren
#

wdym make the properties abstract?

lunar cypress
#

Maybe that might actually be a reason

jovial warren
#

like make them abstract values?

forest pecan
#

does slimjar support that Yugi

#

with the agents

old wyvern
#

Yes

forest pecan
#

Oh nice

jovial warren
forest pecan
#

the jarinjar was just hard to understand for my brain

#

Lol

old wyvern
#

Generates the agent with required meta into a temp file to get the instrumentation instance

old wyvern
old wyvern
#

I removed the isolated thing from the readme, but its still there if needed

forest pecan
# half harness wat

he started messaging people to join his developer team and when they said no he got super angry

half harness
#

lol

forest pecan
#

ikr

old wyvern
#

It currently chooses what method to use to append depending on the version you're using

forest pecan
#

ic

old wyvern
#

brb

lunar cypress
half harness
#

woah

#

the readme's usage example is so short ๐Ÿ˜

#

yugi

#

(hopefully) quick question - do i just do slim dependencies in the base build.gradle?

lunar cypress
#

Wtf

#

I wanted to reply to my message and it edited it

#

Thank you discord client for android

jovial warren
#

nope, that didn't work btw

#
abstract class KryptonExtension @Inject constructor(private val factory: ObjectFactory) {

    abstract val dependencies: Property<DependencyConfig>
    abstract val plugin: Property<PluginConfig>

    fun dependencies(action: Action<in DependencyConfig>) = factory.newInstance(DependencyConfig::class.java).apply {
        action.execute(this)
        dependencies.set(this)
    }

    fun plugin(name: String, action: Action<in PluginConfig>) = factory.newInstance(PluginConfig::class.java, name).apply {
        action.execute(this)
        plugin.set(this)
    }
}
```this is the new one
old wyvern
#

Btw johnny, now that paper is moving forward from 8, you can now dynamically attach compatres agent right?

jovial warren
#

and the top-level function krypton still doesn't resolve

lunar cypress
#

Used to be possible in many implementations in 8, isn't anymore

old wyvern
#

It works on 16 johnny

lunar cypress
#

But i am looking into hacking it together anyway

half harness
lunar cypress
#

What does exactly?

old wyvern
#

Attaching an agent at runtime

#

Without commandline args

lunar cypress
#

That's imprecise

old wyvern
#

How do you mean?

old wyvern
half harness
jovial warren
lunar cypress
#

It is possible after 8 but very complicated. That's where I'm at

jovial warren
old wyvern
#

Ah not sure, but its very easy 9+

jovial warren
#

or do you mean the interop section?

old wyvern
#

Yes bard

lunar cypress
#

Yeah well how then?

old wyvern
obtuse gale
#

Ping?

lunar cypress
#

Because that's the opposite of my research and experience

#

Bytebuddy is a class generation tool

old wyvern
#

It has a class for agents

obtuse gale
lunar cypress
#

I think I talked about it with someone else already and we came to the conclusion that it wouldn't work for me because it's not as powerful as agents alone

obtuse gale
#

I also specified that I'd be willing to pay her in nitro but of course everyone wants real money.

old wyvern
lunar cypress
#

But maybe it has utilities integrated now that do the attachment process for you, idk

old wyvern
#

Im already using it to start an agent

lunar cypress
#

That looks like you create another vm and attach it there, is that right

#

Because that's what I meant by "complicated"

old wyvern
#

Yea but bytebuddy simplifies it quite a lot

lunar cypress
#

Fair enough

#

I don't necessarily want to carry ByteBuddy though. When I have time I will copy my mate's code who already implemented this do it manually

old wyvern
#

lol

lunar cypress
#

But it is a lot more complicated than in Java 8 after all

sweet cipher
#

Has anyone here used JetBrains academy?

lunar cypress
#

Briefly

sweet cipher
#

I'm trying to do one of the questions, it says

Write a program that reads a string and replaces all occurrences of the letter 'a' with the letter 'b'.
But when I do this:

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String string = scanner.next();
        System.out.println(string.replace('a', 'b'));
    }
```Scanner is highlighted in red
old wyvern
#

How did java 8 have it?

prisma wave
sweet cipher
#

Oh

old wyvern
#

it should be under java.util

lunar cypress
old wyvern
#

Ah

lunar cypress
#

Although the vm had to support it

#

Most did I think

sweet cipher
#

That's so annoying lol, I got another question wrong because of that

old wyvern
lunar cypress
#

It is far from that

old wyvern
#

oh

lunar cypress
#

In terms of what it does at least

#

In terms of ease of use, I can't judge that

old wyvern
#

ah

#

ok

jovial warren
#

ByteBuddy good

#

also, someone please tell me why ```kotlin
class KryptonPlugin : Plugin<Project> {

override fun apply(project: Project): Unit = with(project) {
    // Add the repositories we need for our dependencies
    repositories.mavenCentral()
    repositories.maven("https://libraries.minecraft.net/")
    repositories.maven("https://repo.bristermitten.me/repository/maven-public/")

    val config = extensions.create<KryptonExtension>("krypton", this)
    val dependencyConfig = config.dependencies.orNull ?: return@with
    val apiVersion = dependencyConfig.api.orNull ?: return@with
    val serverVersion = dependencyConfig.server.orNull
    val kotlinVersion = dependencyConfig.kotlin.orNull ?: return@with

    val createConfig = tasks.create<CreateConfigFile>("createConfigFile")
    afterEvaluate {
        dependencies.add("compileOnly", "org.kryptonmc:krypton-api:$apiVersion")
        if (serverVersion != null) dependencies.add("compileOnly", "org.kryptonmc:krypton:$serverVersion")
        dependencies.add("compileOnly", "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
        tasks.withType<KotlinCompile> {
            kotlinOptions.jvmTarget = "16"
        }
    }
    tasks.findByName("processResources")?.finalizedBy(createConfig)
}

}

#

that createConfig task there doesn't even show in the tasks

#

and it doesn't even resolve either

lunar cypress
#

That's a sign that the plugin isn't being loaded properly in general

jovial warren
#

probably isn't tbh

gusty glen
#

@old wyvern review my PR xD

old wyvern
#

๐Ÿ˜ถ

#

What an incredible pr!

#

This changes everything!

half harness
#

๐Ÿคฃ

jovial warren
#

what PR is this?

old wyvern
#

๐Ÿ˜Œ

ocean quartz
#

You should check Emily's PR ๐Ÿ˜Œ

jovial warren
#

man, imagine not using org.cadixdev.licenser

old wyvern
#

oh, what are its benefits over the current one?

jovial warren
#

not actually sure, but that one is based off of Minecrell's original one

#

used by Sponge and Adventure iirc, and quite a few others

#

you can configure the license file location, set different license files per sub project, etc.

old wyvern
#

The current one seems to allow that too

#

Cant seem find any immediate differences

jovial warren
#

yeah I think the one you use is based off of Minecrell's one too

old wyvern
#

Not sure, I didnt set that up

#

fefo did

jovial warren
#

@obtuse gale

obtuse gale
#

Yeah idk what the differences are tbh

#

I just found that one, I like it and it works I guess

ocean quartz
#

Tbh they do the same, as long as it works no reason to use one over the other

old wyvern
#

Yup

ocean quartz
#

I used both and tbh the one Emily uses is easier to use straight away

half harness
#

anyone know why apparently gradle/intellij can't find the dependency? I have mavenCentral() in repositories btw

jovial warren
#

what the actual fuck is that

#

how old is your Nexus?

half harness
#

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

jovial warren
#

oh it's OSSRH

prisma wave
#

That artifact name genuinely makes me feel ill

ocean quartz
#

Nexus is pretty ugly

half harness
#

just not 2.8.2

jovial warren
#

the package name is worse

old wyvern
#

Did you just push to sonatype?

prisma wave
#

Caching maybe

ocean quartz
jovial warren
#

me.dkim19375.dkim19375jdautils iirc

ocean quartz
old wyvern
#

It takes time to propagate across the central network

ocean quartz
#

Around 15 minutes

old wyvern
#

You can directly add the sonatype mirror to your repositories if you want instant changes

half harness
#

but it's been like 10 minutes

#

still doesn't work

old wyvern
half harness
#

(before it happens immediately)

prisma wave
old wyvern
#

Its supposed to take time, so idk

half harness
#

oh its been 15 minutes

#

Uploaded Date: Sat May 29 2021 16:23:53 GMT-0400 (Eastern Daylight Time)

half harness
prisma wave
#

Gross

old wyvern
#

Yes

#

releases

half harness
#

ok

prisma wave
#

i need ideas

#

i wanna do something in haskell

#

not too big

#

but like

#

something cool

old wyvern
#

HackageDex?

prisma wave
#

was thinking about making a maven repository software

half harness
#

it works ๐ŸŽ‰

old wyvern
#

๐Ÿ˜ฎ

prisma wave
old wyvern
prisma wave
#

yeah it would be quite clean i think

#

will probably get bored after a few hours of coding though

#

hmmm

old wyvern
#

Btw, is it me or do different repository managers use completely different snapshot paths?

half harness
old wyvern
#

The libs name tho

#

dkimjdautil456432165468

half harness
#

i was planning to rename it to DkimJDACore

#

ngl

half harness
#

but i just didn't feel like refactoring everything

#

and then same with DkimBukkitCore

#

better name?

jovial warren
half harness
#

yea but its not utils anymore

old wyvern
#

bm

#

what about

#

a proper

half harness
#

before it used to just be a utilities package

old wyvern
#

haskell IDE

jovial warren
#

and just io.github.dkim19375:jdautils:version

old wyvern
#

Might be a bit big

#

But

#

Worth it

half harness
#

DkimJDACore isn't too long or common ๐Ÿ˜Œ

#

jdautils is too common

prisma wave
#

yeah that seems way too much effort

jovial warren
prisma wave
#

although it would be cool

#

integrate hslint and stuff

old wyvern
#

mhm

jovial warren
#

me.dkim19375:jda-core:VERSION would be perfect

old wyvern
#

Would be very useful as well considering the current ide suppourt

half harness
prisma wave
#

indeed

half harness
ocean quartz
#

Dkim1338188478lib287484core2882848484

jovial warren
#

ez

half harness
#

๐Ÿ˜

jovial warren
#

me.dkim1945243874386t78234768346773467348672374673486293846782348968943267384683246734:dkim193758127894768347168438673846787867382768347867834267438967893247683276core:VERSION

onyx loom
jovial warren
#

yeah I agree

#

numbers in packages bad

onyx loom
#

numbers in username bad

jovial warren
#

also agree

ocean quartz
#

Very bad

jovial warren
#

dkim where did you even get those numbers from?

ocean quartz
#

Hit his forehead on the numpad

half harness
#

๐Ÿ˜ค

onyx loom
#

u need help

obtuse gale
jovial warren
#

man, I'm just looking at Moshi rn, and it looks like Moshi actually on top

#

Gson on bottom

obtuse gale
#

Yeah Moshi is pretty nice

jovial warren
#

supports both code gen and reflection, has good Kotlin support, no BS

ocean quartz
jovial warren
#

I might actually switch again in Krypton to using Moshi

#

and I can probably write a component serializer for Adventure for it really easily as well

#

like, Kotlin serialization supports code generation only, Gson supports reflection only, but Moshi supports both

prisma wave
#

aeson ๐Ÿ˜Œ

old wyvern
jovial warren
#

only issue with switching is compatibility, since most cross-platform plugins will likely use Gson, and a few things we use also use Gson

half harness
#

but you don't know where I live ๐Ÿ˜

obtuse gale
jovial warren
#

187 Gotham Road dkim

old wyvern
half harness
half harness
jovial warren
#

actually no, 19375 Gotham Street

prisma wave
old wyvern
#

๐Ÿ˜Œ

ocean quartz
half harness
ocean quartz
#

Discord blurryeyes

half harness
#

discord doesn't reveal that tho EYES

#

magik

ocean quartz
#

What if it does blurryeyes

half harness
distant sun
#

Is possible to attach an id or something to a text Compound?

jovial warren
#
class MyPlugin @Inject constructor(server: Server, listener: MyListener) : Plugin() {

    init {
        server.registerChannel(Key.key("myplugin", "main"))
        server.eventBus.register(listener)
    }
}

class MyListener {

    @Listener
    fun onPluginMessage(event: PluginMessageEvent) {
        
    }
}
```just out of curiosity, anyone know if this would be the correct way to do something like this with Guice?
#

like would that plugin constructor automatically look for an instance of MyListener and instantiate it if it's not found?

prisma wave
#

uh

#

it doesnt do classpath scanning if that's what you're asking

jovial warren
#

what's the best way to do something like what I want here?

#

where I can properly dependency inject without having to do instantiation myself

prisma wave
#

you dont have to do instantiation if there's a binding

#

oh wait

#

no

#

i think it'll work here

forest pecan
#

11 days

#

until bm turns into weeb mitten

#

and back to that anime pfp

prisma wave
#

yes

jovial warren
#

@quiet depot my lord, I call upon thee

half harness
#

what's the opposite of runBlocking? (so like runNotBlocking)

prisma wave
#

running in some asynchronous dispatcher

half harness
#

how do i do that?

prisma wave
#

you'd need a scope, something like GlobalScope

#

although usually you'd make your own scopes

#
scope.launch {
  //do stuff
}```
jovial warren
#

oh btw, it worked BM

#

Guice rn:

prisma wave
#

guice good

jovial warren
#

anyone wanna help me proof read a Krypton announcement btw?

#

actually not sure that's really necessary tbh

half harness
#

so like ```kt
val scope: CoroutineScope = CoroutineScope(Dispatchers.Default)
scope.launch {
// blah
}

#

also is it bad if i make a bunch of scopes?

prisma wave
#

yes

#

well

#

idk

#

make one, keep it constant is what i usually do

#

although i might be talking complete crap here

#

coroutines confusing

half harness
#

like should i have one scope for all commands?
or create a new scope on each command ran?

prisma wave
#

neither

#

actually

half harness
#

oh

prisma wave
#

maybe the former

#

i usually just have 1 for the entire app

half harness
#

o

old wyvern
#

The great lord Sx asked us to store the scope and not recreate it everytime

half harness
#

then whats GlobalScope uesd for?

old wyvern
#

For tasks that would be expected to be running throughout the process

half harness
#

wdym?

prisma wave
#

yeah long running stuff that doesn't need to be structured

half harness
#

oh

prisma wave
#

the point of a scope is that when that scope is "killed", all its coroutines stop too

#

globalscope lasts the entire jvm lifetime

#

which isn't always what you want

old wyvern
#

The common rule is, try to keep away from using the globalscope

half harness
#

would it be bad if i made a top level property for scope? or do I have to DI it everywhere ๐Ÿ˜ฉ

half harness
#

alr

cinder flare
prisma wave
#

nothing wrong with top level properties

ocean quartz
#

High quality programming courses: https://codingwithmitch.com/courses

In this video I take you through your first kotlin coroutines example.

If you are complete beginner when it comes to coroutines and want to see what they're all about, this is the video for you.

The main goal of coroutines is to "simplify asynchronous work by getting rid of...

โ–ถ Play video
jovial warren
#

you can create scopes that are objects, which are much more reusable

ocean quartz
#

This guy explains coroutines really well

half harness
jovial warren
#

e.g. ```kotlin
object MyIOScope : CoroutineScope {

override val coroutineContext = Dispatchers.IO

}

half harness
#

uh

half harness
#

ig ill capitalize it then

jovial warren
#

I mean, I think that constructor function (@ocean quartz's favourite btw) is probably creating an anonymous object under the hood anyway

ocean quartz
#

Constructor functions are stupid

half harness
#

lmao

jovial warren
#

they are useful

#

and they are great

#

for example, they reduce boilerplate here

ocean quartz
#

They are dumb and even IJ will tell you they are dumb

jovial warren
#

my ass

prisma wave
#

arent all constructors constructor functions? ๐Ÿค“

prisma wave
#

fun <init>()

ocean quartz
jovial warren
#

they do allow you to construct objects that may be platform specific from within the common stuff though

#

but I guess you can have an expect class too

#

Kotlin multiplatform is weird lol

prisma wave
#

couldnt be elara

ocean quartz
#

Kotlin half the time doesn't follow their own conventions

prisma wave
#

kotlin internal code is actually horribly ugly

obtuse gale
#

"do as i say, not as i do"

prisma wave
#

i dont know if that's how they want people to write kotlin, or they're just dumb

#

but it's horiffic

#

by "internal" i mean like the compiler and stuff, the stdlib isnt so bad

half harness
#

welp i got rid of all the ExecutorService stuff.. I'm scared I messed up the coroutines

prisma wave
#

dont worry, you probably did

obtuse gale
half harness
#

i have quite the number of coroutines

prisma wave
#

lmao

#

ohh the day today

#

that's such a good show

#

the onion before it was cool

obtuse gale
#

lol

prisma wave
thorny crow
#

sup cool people

prisma wave
#

yo

onyx loom
#

gson >

jovial warren
#

looking at Moshi, I think Moshi on top

#

it supports both runtime reflection and compile-time code generation

#

and benchmarks have shown it's the fastest, from what I've seen before

static zealot
#

I am sad

#

just found out I Don't have a star on github anymore.

#

Someone stared a while ago but they unstared and I've got no idea when sobsidedown

cinder flare
static zealot
#

๐Ÿ˜„

old wyvern
#

Now you do!

static zealot
#

@old wyvern I want to kiss you but I also don't want to kiss you. if that makes sense xD

half harness
#

uh

#

๐Ÿ‘€

static zealot
#

now I've got 2 stars

#

going to star it myself as well

#

to make it 3

#

xD

half harness
#

wha

#

thats possible?

obtuse gale
#

yes?

old wyvern
#

lol

forest pecan
#

my status looks like bardy's

#

imma remove it

#

lmao

old wyvern
#

Sad bardy noises

static zealot
#

what status?

forest pecan
#

oh wait

half harness
#

wait what are you starring?

forest pecan
#

bardy doesnt have it

#

anymore

static zealot
forest pecan
#

imagine if I just released a crippled plugin onto the spigot marketplace

#

and it went through

half harness
#

imagine if I just released a malware plugin onto the spigot marketplace

#

and it went through

forest pecan
#

if its free

#

lol

half harness
#

?

static zealot
#

or whatever the highest price is

forest pecan
#

Ahm

#

EWG

#

Lol

static zealot
#

well EWG is also stolen code. its a whole other story

forest pecan
#

true

#

are the developers bad rep now

static zealot
#

what browser do u guys recommend for linux (kde neon)

old wyvern
#

Firefox?

static zealot
#

well other than that

old wyvern
#

Id say just use that

forest pecan
#

waterfox

#

lol

static zealot
#

that's what I use yeah

half harness
static zealot
#

and probably going to use

old wyvern
#

If you want something else for sure, you have chromium

cinder flare
#

firefox too slow

static zealot
#

man I Just love OVH

#

I FUcking cancelled the service ...

cinder flare
#

obviously they disagree

static zealot
#

that's 1 mail every day for the past week and a half

#

well they're dumb then

#

yo @onyx loom how's CombatStats going btw?

onyx loom
#

havent touched it since u contributed

static zealot
#

oh.

#

well is there anything left to do?

#

or just testing?

onyx loom
#

i think i have tested it

#

just need to put it on spigot iirc

static zealot
#

oh alr

#

someone please tell me if you can see my status (from IntelliJ)

#

bcz I can't

old wyvern
#

Someone needs to make a combat enhancing plugin

cinder flare
static zealot
#

hmm

half harness
#

oof

static zealot
#

maybe the update changed something? idk

#

yeah not even wit my status clear, it doesn't show it

#

does anyone else use Discord Integration?

#

Or do you guys use Rich Presence?

ocean quartz
#

I use discord integration

static zealot
#

are u able to open a project rn and see if it works for you?

cinder flare
#

matt is on early build, his might not work yet

ocean quartz
#

It's not working for me, i am on early access

static zealot
#

ah

cinder flare
old wyvern
#

See what works?

static zealot
#

discord integration

cinder flare
#

IJ discord integration

old wyvern
#

Ah

static zealot
#

not that I care that much. just strange

old wyvern
#

Thankfully I take ages to update anything ๐Ÿ˜„

static zealot
#

u ok?

#

xD

old wyvern
#

Wdym?

static zealot
#

nothing.

cinder flare
static zealot
cinder flare
#

that's like, my biggest looking forward to of the next few months

#

yeah dude did you not see Matt's thing

static zealot
#

nah

#

took 2 days off

#

hardly was here for the past 2 days

obtuse gale
static zealot
#

I Wanna see

cinder flare
old wyvern
#

Every IDE, every game, every thing on my pc

cinder flare
static zealot
#

oh

old wyvern
#

Is possibly outdated

static zealot
#

hmm

old wyvern
static zealot
#

well I got used with this one anyway. so I Don't really care

#

ah IC

#

wellp

#

xD

cinder flare
#

that'd do it

static zealot
#

anyone know how I Can change an application's name?

#

on ubuntu

#

or kde neon

frail glade
#

In which task did you add this? You said it was on Shadow 7, were you also using Kotlin 1.5?

#

I think it's something to do with Kotlin 1.5 causing it.

#

And yeah Yugi, I do see that adding a v to it fixes it, but that's so weird.

ocean quartz
#

Gradle 7, Shadow 7, Kotlin 1.5.10, I put that in the ShadowJar task

frail glade
#

In your settings.gradle is your project name capitalized?

ocean quartz
#

Nah, there the project name is always like project-name

frail glade
#

Then I don't know cause I tried that and it is still lowercasing it.

ocean quartz
#

Can you show me your build.gradle?

frail glade
#

Now what's weird is if I use the literal archiveFileName.set("Project-${project.version}.jar") it works, but if I change Project to Guilds it lowercases it.

ocean quartz
#

Huh, so that'l Guilds? I can give it a try

frail glade
#

Ya

stray oyster
#

how does tier work

old wyvern
#

I think it might be the jar output overwriting the name of the shadowJar output

ocean quartz
#

Hmm, I just built it without changing anything and it worked

frail glade
#

o.o

#

Oh I haven't pushed Kotlin 1.5 yet

ocean quartz
#

Oh yeah, let me change that

old wyvern
#

Try setting a non-empty classifier or changing the name if the jar tasks output

#

That should most likely fix it

ocean quartz
#

Ah, yeah so kotlin 1.5.10 made it not uppercase

frail glade
#

Exactly

old wyvern
frail glade
#

๐Ÿ˜ฎ

#

What did you leave in the shadowJar task?

#

Also what IDE theme is that? I really like it.

old wyvern
old wyvern
frail glade
#

Yup that fixes it.

ocean quartz
#

I guess it doesn't happen for me because my archive name isn't the same as the project name

old wyvern
#

yea

frail glade
#

That might be why, yeah.

oblique heath
#

apparently oracle offers a free cloud tier with 24gb of ram??

old wyvern
#

Wait what

oblique heath
#

according to this thing that showed up in my feed

frail glade
#

And you also have some extra icons thingy, right? I used to have it but I forgot what it was called.

old wyvern
#

Atom Materials Icons I think

ocean quartz
#

That's what i use too

old wyvern
#

yea you recommended it to me I think

frail glade
#

Sick.

#

Thanks for the help btw on that.

old wyvern
#

yw ๐Ÿ˜„

ocean quartz
#

No idea what happened but toUInt no longer works for me .-.

#

Ah, it's required to use @OptIn(ExperimentalUnsignedTypes::class) on 1.5.10, it wasn't on 1.5.0 .-.

#

I thought it was no longer experimental ๐Ÿ˜ฉ

obtuse gale
#

I believe the 1.5 release notes did say it was experimental lol

ocean quartz
#

Kotlin has a lot of cool experimental features, but having to annotate everything is so annoying

obtuse gale
#

Make a gradle plugin so it does it for you fingerguns

cinder flare
#

i hate oracle, but even I can't pass up such an amazing deal

obtuse gale
#

24 GB of RAM!
Thatโ€™s more than enough resources to host a game with 20+ friends
yea yea a gig a friend

#

@oblique heath credit card still required, that's where they lose people

cinder flare
#

i mean if it's forever free...

#

and the best part of credit cards is 30 days to cancel them as fraud ๐Ÿ˜‰

obtuse gale
#

Yeahhhh I guess

#

But nothing is ever free, there's always a catch. This one is you need a cc

cinder flare
#

Every VPS service with a free tier has required a payment method

#

AWS, Azure

#

I don't think that's much of a catch

#

I'm sure it's to raise awareness of their VPS services

#

which I frankly didn't even know existed until I saw this

obtuse gale
#

Yeah same

cinder flare
#

This is actually quite a genius idea, I'm not gonna lie. you get a ton of people hooked, then they start buying more for money. it requires a large initial investment, but they have the cahs

#

and their adoption will increase very quickly at this rate

obtuse gale
#

Sadly I don't have a cc yet and don't plan on getting it

cinder flare
#

oh. any reason why?

#

and I'm sure they also take debit cards

obtuse gale
#

If I don't have the money to spend on something I want then I shouldn't get it

cinder flare
#

I mean, if used correctly, credit cards are free 30 day loans essentially, as well as helping to build credit which you really need if you ever want like, for instance, a house or a car

minor yacht
#

i need help guys

cinder flare
frail glade
#

When is Kotlin going to allow merging catch errors oml.

cinder flare
#

dude you have to use Oracle Linux to use the ARM processors

#

i hate oracle

#

oh, no apparently you just can't use minimal ubuntu

#

you have to use full ubuntu

ocean quartz
gusty glen
#

๐Ÿ˜† (totally not bm-like comment)

cinder flare
#

uh... sure

ocean quartz
gusty glen
ocean quartz
#

Doesn't work btw xD

#

Though that would be a pretty cool syntax for it

potent pewter
#

how set bedwars1058 scoreboard

ocean quartz
gusty glen
ocean quartz
#

Not this way though

gusty glen
#

use two lambdas

ocean quartz
#

Had to create objects that extend the original exception to make it be referenceable like that

cinder flare
#

@static zealot what happened to optimize my server???? ๐Ÿฅฒ

static zealot
#

?

cinder flare
#

big ol' 404

static zealot
#

?optimize

compact perchBOT
gusty glen
#

or make an object class with a method called tryBlah, and it returns an object that has this only method Catch which accepts a set of Thowables and a consumer, then run the first consumer (of the try)

cinder flare
#

oh what you changed the url

#

you cheeky boi

static zealot
cinder flare
#

ty โค๏ธ

static zealot
#

No probl

ocean quartz
cinder flare
#

i know, kotlin is so close to being perfect

#

like just a few little things

ocean quartz
#

Ugh i would love for Kotlin for .net ๐Ÿ˜ฉ

static zealot
#

Daily bitches

obtuse gale
quiet sierra
#

My man likes to switch daily

obtuse gale
#

These answers will be individually read and graded by a Real Human
Real Q.C. Humanโ„ข๏ธ

gusty glen
cinder flare
#

i was under the impression that was just a hard fact of java

ocean quartz
#

Yeah, it is possible with reified but it's actually just a hack

distant sun
#

Is possible to give an id to a text component?

obtuse gale
#

meaning..?

distant sun
#

I want to remove certain parts of a message on the chat packet and was just looking for an easier way to do it. If I could "name" components when sending them I could probably get all of them on that packet and then just remove the one with id = x

Something like this Component{id=jobs, text=Miner WoodCutter} Component{id=prefix, text=Admin} Component{id=name, text=GabyTM} and then I can just remove the component with id jobs

obtuse gale
#

i don't think you can but the way I would do it is use like translatable components with dummy (custom, registered) translation keys, and match by key

distant sun
#

https://wiki.vg/Chat#Schema I was looking at the protocol for a hacky way but all things put into a component is displayed in chat (eg translate & keybind if an invalid value is given)

obtuse gale
#

kekw

obtuse gale
distant sun
#

Im not worried about that, it is for self usage and we run paper.

obtuse gale
#

ah okay, are you aware on how to register custom translation keys?

distant sun
#

Negative, but I guess is done through nms or does adventure have a way?

obtuse gale
#

it does yea

distant sun
obtuse gale
#

well i suppose it would also work on velocity since it also integrates adventure natively

distant sun
#

Welp

obtuse gale
#

but for other platforms, since you have to use the adventure-platform-x (bukkit, fabric, bungeecord etc), translatable components are pre-parsed into text components before they are transformed to the platform's native component system and sent to the player

#

actually velocity does not use the translation system

#

so paper only

#

lmao

#

thing is, on paper the translatable components are parsed to text ones right when they are sent

distant sun
#

Makes sense

#

Ty em

cinder flare
#

dude I hate oracle

#

they use iptables and their own weird firewall and nothing works except ssh

#

i don't undersatnd

#

hey terfs wanna help me out now lmao

cinder flare
#

okay got it

#

turns out iptables order actually matters for some god-forsaken reason

distant sun
#

Does anybody have a solution for this shit?

potent nest
winged mica
#

What is the sqlite driver class name?

grizzled pasture
jovial warren
#

since the votes for Gson are pretty overwhelming for Krypton, I've started work on a new project which I've called "gson-kt" (no surprises there at all), and I have a feeling ```kotlin
public fun JsonObject.asIterable(): MutableIterable<Map.Entry<String, JsonElement>> =
object : MutableIterable<Map.Entry<String, JsonElement>> {
override fun iterator(): MutableIterator<Map.Entry<String, JsonElement>> = entrySet().iterator()
}

prisma wave
#

That is not how this works

grizzled pasture
#

but only here photo

#

wtffffffffffffffff

#

only showcase phoyo!!!!!

prisma wave
onyx loom
steel heart
prisma wave
#

dw I got the screenshot

jovial warren
#

show

prisma wave
jovial warren
#

lol

#

man, Gson really needs to step up its game

#

Moshi supports both reflection and code generation, so it can support generic type serialization out of the box without custom adapters as well as the quick and dirty serialization Gson provides

#

still debating whether I should just ditch Gson and switch to Moshi though

prisma wave
#

use aeson ๐Ÿ˜„

jovial warren
#

also, Moshi is a good like 300-400 KB less than Gson lol

prisma wave
#

M-x doom/reload

jovial warren
#

BM can you actually give a serious opinion please?

#

what do you think about Moshi?

prisma wave
#

it's fine

jovial warren
#

how do you think it compares to Gson?

#

I think Moshi's better, since it provides the best of both worlds

prisma wave
#

moshi requires effort

#

gson 1 line

jovial warren
#

the core of it is

old wyvern
#

Gson is about 200ish kb

jovial warren
#

not true

old wyvern
#

Im pretty sure it is

jovial warren
#

actually is true

#

Gson is 236 KB and Moshi is like 100

prisma wave
#

import com.google.gson.Gson fan vs import Data.Aeson enjoyer

old wyvern
#

Lol

jovial warren
#

and I've seen benchmarks that show Moshi is faster

old wyvern
#

Then you got Simple.JSON at 25kb ๐Ÿ˜Œ

jovial warren
#

and it doesn't suffer from the same trouble as Gson does when it comes to deserializing generics

prisma wave
#

what trouble

jovial warren
#

if you use code generation

jovial warren
#

it causes class cast exceptions

old wyvern
#

Use type adapters?

jovial warren
#

which, tbf, isn't Gson's fault

prisma wave
#

treemacs

jovial warren
# old wyvern Use type adapters?

having to do that for every single class I need proper generics in is really annoying, vs one annotation from Moshi that generates it at compile time and solves this problem for me

old wyvern
#

Cant wait for reified types ๐Ÿคค

jovial warren
#

wait the JVM is getting reified types?

old wyvern
jovial warren
#

wat

old wyvern
jovial warren
prisma wave
#

reified types overrated, erase every type

old wyvern
jovial warren
#

oh

#

I deserialize a decently complex object lol

#

and I need to write a custom serializer for that

old wyvern
#

Simpify them into data that you actually want to persist and have them interconvertible

jovial warren
#

whereas Kotlin serialization and Moshi could generate a serializer for that with 1 annotation

prisma wave
#

instance FromJSON RegistryBlock where

old wyvern
jovial warren
#

wdym what's generated?

old wyvern
#

You said you were using generated data objects?

jovial warren
#

I mean the serializer can get generated at compile-time by Kotlin serialization and Moshi

jovial warren
old wyvern
jovial warren
#

yeah I mean serializer generation

#

like where the serializer is generated at compile time

#

which means we don't get issues with type erasure

old wyvern
#

lol

#

Idk haven't had any issues with just gson for now

jovial warren
#

try deserializing an object that contains a map field with Gson without any custom serializers or deserializers

#

you'll see what I mean

#

actually, the deserialization itself won't fail, but try to access a value from the map

#

also, make sure the map contains more complex types than simple JSON types

#

e.g. use a Map<String, List<String>> rather than just a Map<String, String> since the former is easy for Gson to infer

prisma wave
#

do you mean the latter

gusty glen
#

@jovial warren why don't you use Multimap instead of that map of key - lists?

jovial warren
#

good point

#

that object was created before I depended on Guava

gusty glen
jovial warren
#

I mean, we only temporarily construct those anyway

#

they're turned into MappedRegistry objects after they're deserialized

distant sun
#

no but I suggest to use compiled regex or just replace()

half harness
#

wdym?

prisma wave
#

Oh my

half harness
#

also lines 41 - 60 in EventListener im cleaning up

#

also

#

i don't know why theres toRegex ๐Ÿคก

#

java -> kotlin IJ conversion

half harness
prisma wave
#

Please use a typealias for that big ActionConsumer type in SpecialEventsManager

half harness
#

wdym

prisma wave
#

Also nested mutable maps ๐Ÿฅด

#

typealias

half harness
#

lol

prisma wave
#

Alias for a type

#

That type is way too long

half harness
#

i mean

prisma wave
#

Line 95 of special doesn't need the toList, and destructure the Pair to get clearer names

half harness
#

since im removing stuff from it while looping

prisma wave
#

Oh

tropic cypress
#

Does obfuscation impact performance?

half harness
#

ohhh dont obfuscate