#dev-general

1 messages · Page 214 of 1

onyx loom
#

disgusting

obtuse gale
#

random question

#

how fast can everyone type here

hot hull
#

Very fast

obtuse gale
#

wpm?

hot hull
#

Fast as fuck boi

#

2 wpm

obtuse gale
#

so....

#

like 1/3 of a word per 10 seconds?

onyx loom
#

i type like 60wpm

#

pretty slow tbh

obtuse gale
#

I just make loads of typos when I type fast...

#

Between 75 and 80wpm

#

Inclined towards the lower bound :peeposad:

#

I think I get similar....

#

Just anytime theres an apostrophe or quotation marks is where I get messed up

#

Can I @Autowire a bean into a kotlin extension method parameter?

#

how would one make a predicate kinda thing in kotlin

#

is it just like a ()->(Boolean) kinda thing?

heady birch
#

Can I @Autowire a bean into a kotlin extension method parameter?
@obtuse gale Not really as I think extension methods get compiled to a static method and that wont be spring-managed

obtuse gale
#

yeaaaaaah

#

rip

#

ill just have to autowire it into the calling class i guess

#

or

heady birch
#

I'd put the method in a service/factory class and autowire the dependency there, what does the method do?

obtuse gale
#

it just sends a message in discord and then uses my event waiter, which is a bean

#

in b4 frosty makes a bean joke btw

onyx loom
#

BEAN

#

baked beans

obtuse gale
onyx loom
#

thx

obtuse gale
#

np

#

you too

hot hull
#

@distant sun Did you have any luck with Moodle? I'm thinking of finding out if it has an API so I can track added assignments, cause it's a bitch and I don't get sent any notifications

obtuse gale
#

I havent used that shit since year 7 bruh

distant sun
#

@hot hull kinda, I have used their sandbox to access the docs

hot hull
#

Got any usefull links?

distant sun
#

uh

old wyvern
distant sun
#

search for moodle sandbox

#

that's for plugins

#

you have to use the mobile app api or smth

prisma wave
#

@obtuse gale 94 wpm if i'm tryharding

obtuse gale
#

its the punctuation that keeps fucking me over

prisma wave
#

yeah that's kinda annoying

obtuse gale
#

what?

#

ok

steel heart
#

Not the right channel

quiet depot
#

94 wpm pff

#

get out of here

#

120+ wpm gang

steel heart
light venture
#

god my college use moodle as a portal page 😂

onyx loom
#

portal page?

#

so they dont use it for any assignment work or nothing

prisma wave
#

no

#

primitives cannot be null

#

?

#

what

hot hull
#

:what:

prisma wave
#

No it can't be null

hot hull
#

Why static

onyx loom
#

public static Map<UUID, Integer> stMap;

hot hull
#

How about you don't ping

frail glade
#

Why are you saving on getting?

onyx loom
#

u spelt strength wrong 🙂

#

getStregnth setStregnth 🙂

frigid badge
#

a good ide should tell you

hot hull
#

What's a WeakHashMap

#

@prisma wave You'll probably be able to answer that

prisma wave
#

a hash map with weak keys

hot hull
#

Which means what exactly

prisma wave
#

that the keys don't count as a reference for the garbage collector

hot hull
#

I see

light venture
#

weak hash map also mean its a map which is old which is falling apart so when u go camping it will be useless

prisma wave
#

yes precisely

light venture
#

ty

distant sun
#

how to add ternary operator to kotlin:

fun <T> ternary(bool: Boolean, a: T, b: T): T {
    return if (bool) a else b
}```
prisma wave
#

close enough

distant sun
#

xd

onyx loom
ocean quartz
prisma wave
#

rename to ? and :

#

rip

#

That broke

ocean quartz
onyx loom
prisma wave
#

🥲 🥲

ocean quartz
onyx loom
#

lol

ocean quartz
#

It works btw xD

distant sun
#

what about |

ocean quartz
onyx loom
#

|

ocean quartz
#

That's a | but italic |

onyx loom
#

o

prisma wave
#
extend Boolean {
    let ? = (Any a) => Q(this, a)
}
struct Q {
    Boolean condition
    Any a
 }
extend Q {
    let : = (Any b) => if condition => a else => B
}```
onyx loom
#

borked font

prisma wave
#

A masterpiece

onyx loom
#

i agree 👍

#

🥲

prisma wave
#

true ? a : b

#

Actually I don't think : is a valid identifier in elara either 🥲

fervent frigate
#

hey im trying to get this to work but for some reason

                ShapedRecipe woodRecipe = new ShapedRecipe(new NamespacedKey(this,
                    plankMaterial.name().toLowerCase(Locale.ROOT) + "_grappling_hook_recipe"),
                    HookAPI.createGrapplingHook(woodUses)
                )
                    .shape(" **", " &*", "   ")
                    .setIngredient('*', plankMaterial)
                    .setIngredient('&', Material.FISHING_ROD);
                getServer().addRecipe(woodRecipe);
            }```
plankMaterial.name() prints the following

```[19:17:53 INFO]: grapplinghook:nks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:k_planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:_planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:lanks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:planks_grappling_hook_recipe
[19:17:53 INFO]: grapplinghook:planks_grappling_hook_recipe```
#
[22:20:25 INFO]: _PLANKS
[22:20:25 INFO]: PLANKS
[22:20:25 INFO]: K_PLANKS
[22:20:25 INFO]: PLANKS
[22:20:25 INFO]: PLANKS
[22:20:25 INFO]: LANKS
[22:20:25 INFO]: PLANKS```
errant geyser
#

@hot hull do I still have access to your advancement API?

#

nevermind, I'm blind

#

Which repo did you have a mental breakdown in the commit messages?

ocean quartz
#

On mf-gui kekw

errant geyser
#

I'm trying to find it

#

I see his pr that got denied, but there's only like 3 commits there now

obtuse gale
#

don't try

#

I prohibit you

errant geyser
#

There were like 15 AMAZING commits

#

Fefo, dont stand in the way of me and Frosty's amazing commits!

#

I prohibit you

obtuse gale
#

I can't accept that

#

I will have to continue

errant geyser
#

:(

#

You figured out how to use Google yet?

#

i will not let you live that down

obtuse gale
#

OMFG

#

yes I know how to google

umbral mica
hollow dragon
#

Does DeluxeChat check if a ChatEvent is cancelled before executing its chat modification stuff

steel heart
#

probably

hollow dragon
#

it seems that when i cancel the AsyncPlayerChatEvent, the msg doesnt display in console but does in player chat

ocean quartz
#

Yeah that's normal

hollow dragon
#

Oh

#

Is there a way to completely cancel it

#

Without hooking into api and setting the recipients

steel heart
#

The non async event is fully cancellable, not the async one assume it’s fired async

hollow dragon
#

wouldnt event handing using the sync one make it laggy though?

steel heart
#

Less laggy

hollow dragon
#

Is it a big difference?

ocean quartz
#

Well kinda, it can, async means it's not in the main thread, meaning you can do all sorts of things without affecting the main part of the server, which results in no lag (or less)

hollow dragon
#

If I’m just checking if a list contains a value (and if it does, send a message to the player from config.yml and cancel the event) would it produce lag?

ocean quartz
#

Nah, not even if it was in the main thread, that's just small things

hollow dragon
#

Oh ok

hollow dragon
#

I've tried the PlayerChatEvent (nonasync) but it still displays the message in chat (i dont think globally though)

ocean quartz
#

Pretty sure that event is deprecated

obtuse gale
#

Always has been

hollow dragon
#

is there a nondeprecated nonasync event

obtuse gale
#

no

hollow dragon
#

::/

#

ok

obtuse gale
#

because it shouldn't be used

hollow dragon
#

so i just have to hook into dc?

obtuse gale
#

I have no idea what the issue is

#

So I'll go with yes

#

yes

ocean quartz
#

Why do you want it to be sync? It's just worse

hollow dragon
#

uh, Conclure said that the sync event is fully cancellable

ocean quartz
#

So is the async

obtuse gale
#

Always has been
and that's actually true

#

that's as far back as I could find lmao

hot hull
#

@errant geyser It's OS now

obtuse gale
#
fun StringBuilder.build() = toString()```
hot hull
#

y tho

obtuse gale
#

makes more sense.

#

StringBuilder

#

it should build

hot hull
#

Okay mr fancy pants

obtuse gale
#

IT makes sense!!!

hot hull
#

It does but still

frigid badge
#

the AsyncPlayerChatEvent is not always async though

#

that's literally just a guess

#

there's a method to check if it is though

obtuse gale
#

Will this work or will it throw a concurrent modify exception or whatever thats called

#
things.forEach{ thing->
  // Do stuff with thing
  things.remove(thing)
}```
hot hull
#

Indeed it will

obtuse gale
#

so how should i do this

hot hull
#

As in it'll throw an exception

#

Have another list/set for removal, iterate through that set remove from the first thing, clear the removal

onyx loom
#

isnt that param unnecessary

#

it fingerguns

obtuse gale
#

Well yeah but it's nested to it can just get a bit confusing using it

old wyvern
#

You could use removeAll with a predicate

#

depends on what you actually wanted to perform in the forEach

obtuse gale
#

thing.otherThings.forEach{
channel.retrieveMessageById(it).queue{msg->
msg.delete().queue()
}
}

#

then I want it to be removed from thing.otherThings

obtuse gale
#
        val remove = mutableSetOf<String>()
        request.otherEmbedIds.forEach {
            requestsChannel.retrieveMessageById(it).queue { msg ->
                msg.delete().queue()
            }
            remove.add(it)
        }
        request.otherEmbedIds.removeAll(remove)``` That what ive gotta do?
prisma wave
#

probably

#

or just do removeIf as yugi said

#

Just a heads up elara doesn't have this problem 🙂

empty flint
#

What NMS version does 1.16.4 run on?

#

I can't find it :/

#

this isn't updated yet

strong ridge
#

1_16_R3

empty flint
#

Thanks!

solid badge
#

How is it possible, that my request for the developer role is denied when my profile is linked and I sent screenshots of the the repositories because I can't publish them for legal reasons?

hot hull
#

Screenshots kinda don't mean it's yours

quaint isle
#

Hey folks, my friend needs a simple database. He has structured data, but without many relations (maybe a table with products and the usual fields ID, name, description etc. and another for categories, that's pretty much it)
However he's gonna have plenty of rows in it. (100k+)
Does it make sense to go with a NoSQL database like mongo or couchbase in this case?
I suppose it doesn't make a noticeable difference in his case, but what would be the * proper * way to do it?

ocean quartz
#
fun StringBuilder.build() = toString()```

@obtuse gale
I'm about to blow your mind

val text = buildString {
    append("something")
    append("something else")
}

No build, no toString needed

#

@quaint isle That'd be just preference, with 100k values it wouldn't be that much of a difference between them
There isn't a proper way to do it

frigid badge
#

a sql database is perfectly fine

quaint isle
#

@ocean quartz Thanks for answering. Let's say the table was expected to get much much bigger over time, would I go with a NoSQL database then?

frigid badge
#

depends entirely on what type of queries you are going to make

#

and what is much bigger

#

and in what timespan

#

how frequently will it be used

#

and how often will different queries be used

ocean quartz
#

Still would be preference, SQL would be fine with even much more than that

frigid badge
#

there's a lot to be considered for a database.

quaint isle
#

depends entirely on what type of queries you are going to make
@frigid badge Yeah I know it's hard to answer with the limited information I gave. Pretty much just selecting single products or a handful of products with their category and category description and being able to handle as many queries / second with given ressources.

frigid badge
#

with such a simple database you can easily hold tens of millions of rows

#

and handling as many queries a second also ties a lot into your code and using other extra tools such as redis

quaint isle
#

Sure, but theoretically, would a NoSQL db like couch be able to handle more in an ideal world?

frigid badge
#

I feel like you want to use NoSql but need someone to tell you to

#

if you want to use it go ahead, even if it's just for learning or whatever

#

personally I'd just go for a simple sql database

quaint isle
#

I'm actually a huge fan of MySQL, just tryna find out if there are good reasons to use NoSQL instead. I really feel like I don't really know what to use unless it's crystal clear from the data I want to store.

frigid badge
#

and I'm thinking you are estimating this too big

quaint isle
#

Why would you go with a simple sql db? Just because you know it better?

frigid badge
#

because it's just products and a category

#

with no complex queries

#

if you set that up correctly you can easily hold tens of millions of rows

#

which I doubt you'll hit anyway

ocean quartz
#

It'd be a micro optimization difference with that size

frigid badge
#

what will this database even be used for?

quaint isle
#

But wouldn't eg. MongoDB be easier to set up and come with similar performance? I mean, you could just throw all the data in there and wouldnt really have to think about schema etc.?

frigid badge
#

honestly, I'd never used mongodb for any project lol

quaint isle
#

what will this database even be used for?
@frigid badge Probably just simple querying from a Unity Android App if I got my friend correctly

#

yeah Mongo kinda is a mess 😄

frigid badge
#

I stick with sql databases unless my rows compared to query complexity gets huge I use graph databases

ocean quartz
#

Never use mongo either but I can't see it being much easier to set up than mysql

quaint isle
#

Alright, big thanks to you both 🥰

obtuse gale
steel heart
#

Lol

empty flint
#

Am I stupid or why doesn't annotating an abstract class with EventHandler work when I register the implementing subclass?

#

Like, I have an abstract listener class and it implements the onEvent method, but it doesn't seem to work

prisma wave
#

because it only checks the concrete class

#

annotations aren't inherited

static zealot
#

Because




empty flint
#

Oh

#

Is there any way around that?

static zealot
#

Yes:





obtuse gale
#

឵឵

#

indeed

empty flint
#

helpful as ever I see ^^

onyx loom
#

he gave u the answer?

empty flint
onyx loom
#

o wtf lol

#

u trippin

empty flint
#

guess my discord is bugged

umbral mica
#

Yeah I got that too

#

dafuq

static zealot
onyx loom
#

hm try that

#

updating good

#

hm i see other people on reddit have had this problem too lmao. they fixed it by:

try that

umbral mica
#

Killed discord, uninstalled $thing, still invis

#

A bunch of updates downloaded

obtuse gale
#

lol

empty flint
#

gonna try updating 😄

onyx loom
#

wym?

#

not my fault u cant see the answer 😐

empty flint
#

They fixed it by <blank>

#

xD

onyx loom
#

.

can u see this? i just copy and pasted the tips in a new message.....

empty flint
#

nope

#

lmao

prisma wave
#

weird lol

#

lemme try

static zealot
#

works for me ..

onyx loom
#

yall got some buggy discords

prisma wave
#

?

static zealot
#

Yo I think you guys need to downgrade bcz last version of discord broke this. I'm not on latest

umbral mica
#

Lemme go assualt talk to bug hunters discord lol

obtuse gale
#

lol imagine ឵឵

umbral mica
#

What are you trying to send? Is it a link?

obtuse gale
#

it's literally just ឵឵

#

឵឵

static zealot
#

its a joke _11

#

the message is a joke

#

but some can't see it

obtuse gale
#

you are a joke

#

jk

static zealot
#

but its a funny joke

prisma wave
static zealot
onyx loom
obtuse gale
lavish notch
steel heart
onyx loom
#

killing the train 🙂

static zealot
#

reviving the train

onyx loom
#

o

#

killed

static zealot
#

welp unfortunately this train ain't a cat therefor it doesn't have 9 lives therefor its ded forever.

onyx loom
#

🙂

fast portal
#

How to set up in DeluxeTags so that players can buy tags?

ocean quartz
obtuse gale
static zealot
steel heart
empty flint
#

I can't get the discord thingy to work

#

could somebody take a screenshot and paste it here who can read the messages?

umbral mica
#

?

empty flint
#

Because




@static zealot

empty flint
#

ah well

#

missed that one

static zealot
#

Oh no.

empty flint
#

alright

static zealot
#

I'm sorry for that Blocky. Didn't expect the joke to hold that much.

#

ask your question again bcz it probably got lost.

empty flint
#

it didn't, I literally just spent 3 minutes on this

#

I mean you got me so 11/10 buddy

#

🙂

#

Is it possible to extend an annotation class and add the @Inherited annotation for it?

#

sorry not extend

steel heart
#

You shouldn’t be working with inheritance when it comes to annotations

empty flint
#

what is that thingy called again

steel heart
#

What are you trying to do?

empty flint
#

You shouldn’t be working with inheritance when it comes to annotations
@steel heart I want to

steel heart
#

Why?

empty flint
#

I have an abstract event listener class

#

and I want to annotate the method with @EventHandler

#

the abstract method that is

steel heart
#

Ok do it?

#

But if you’re rather handling them than listening them, consider implementing an EventExecutor or something instead

empty flint
#

Doesn't work. When I register the subclass that implements the abstract listener, it doesn't get registered

#

I'm just listening to them

#

for logging purposes

steel heart
#

Then why the abstract?

#

Makes no sense

empty flint
#

because they have a bunch of common methods

#

don't worry about it making sense

#

I have a listener class that does almost exactly the same thing for each event I am listening to

steel heart
#

So?

empty flint
#

I don't want to define the onEvent method in every subclass

steel heart
#

Use an EventExecutor instead

empty flint
#

I want to define it once, have it call an abstract method that is implemented by each subclass

steel heart
#

The annotations are used for directly notate a method for being able to handle events

empty flint
#

exactly

#

but I can't register it via a subclass

#

which is why I want the method annotation, which is @EventHandler, to be inherited

steel heart
#

It’s not made that way

empty flint
#

and for that I would like to define an extension function type of thingy

#

which is why I asked the question in the first place

steel heart
#

Dude annotations isn’t made for inheritance, polymorphism or anything

#

It’s stupid also

#

Use an EventExecutor

#

Don’t make it an xy problem

empty flint
#
Java annotations are not inherited unless the annotation type has the @Inherited meta-annotation on it: https://docs.oracle.com/javase/7/docs/api/java/lang/annotation/Inherited.html.
#

there's no reason not to use it if it exists

steel heart
#

Anyways EventHandler doesn’t have inheritance

#

So please listen instead of ignoring what I’m saying

empty flint
#

You didn't read my question dude, I know it doesn't work, I know it doesn't have it, that's not the question

#

I don't wanna use an alternative, I wanna know if there is any way to add an annotation to an annotation using a kotlin extension function or some similar construct.

steel heart
#

No annotations doesn’t work with inheritance (extending)

empty flint
#

well it does if it has the @Inherited annotation

#

so that's what I am trying to modify

steel heart
#

You can’t do that, use an EventExecutor if you want to achieve polymorphism or inheritance

#

No you cannot extend an annotation by an annotation

#

Jesus

#

Yes you can use Inherited to add inheritance of it but not extend an annotation

empty flint
#

this is dumb

#

in Java you can extend an annotation

#

don't understand why they did not allow that in Kotlin

umbral mica
#

Why are you extending an annotation?

steel heart
#

👏

empty flint
#

So I can declare it as inherited xD

#

so I don't have to repeat code

#

but Kotlin stoopid

#

I guess i can just write a java annotation for it then

#

whatever

steel heart
#

Use an EventExecutor, it’s literally the same thing but gives you more control so you don’t have to use annotations picardFacepalm picardFacepalm

umbral mica
#

This reeks of xy problem

#

What's your end goal borzan

steel heart
#

Achieve inheritance/ polymorphism with event handling

empty flint
#

Achieve inheritance/ polymorphism with event handling
@steel heart Right, but it's not the same thing. This isn't about the events per se, I wanted to see if it was possible another way, one that can be generalized in case I need this again. I understand you want me to use the EventExecutor but this isn't what the problem is about

#

I wanna learn to solve such a problem, not circumvent it entirely

steel heart
#

The solution isn’t by trying to do stuff that shouldn’t be done and isn’t possible

umbral mica
#

Generally if something isn't possible in a well-defined language such as java, it's probably for a reason

empty flint
#

THat's the thing

#

it is possible in Java

#

but not in Kotlin

#

for some reason

steel heart
#

You can use @Inherited to inherit the annotation for a method and it’s potential overrides

ocean quartz
#

What is not possible in Kotlin? got the conversation mid way and too lazy to read

steel heart
#

Annotations

empty flint
#

Extend an annotation

steel heart
#

You can implement it iirc

#

But not extend it

empty flint
#

You can use @Inherited to inherit the annotation for a method and it’s potential overrides
@steel heart The JavaDocs for @Inherited say the annotation has to apply to the other annotation you want to be inherited. So I'd have to either modify the @EventHandler annotation or extend it

#

extending it is possible in Java

#

but not in Kotlin

#

Or did I miss something in the JavaDocs?

umbral mica
#

I fail to see the issue in using the EventExecuter class or whatever it is though

ocean quartz
#

Huh apparently that was reported to Kotlin but yeah it's not a thing yet

empty flint
#

yyep

steel heart
#

Okay let me go on pc and see if I can extend an annotation by another one

#

This is gonna be interesting

empty flint
#

I fail to see the issue in using the EventExecuter class or whatever it is though
@umbral mica Never used it, dunno how to use it yet and too lazy to look it up because it's a specific solution that exists for this specific problem. I wanted a general solution for extending the annotation. That's all there is to this unnecessarily long discussion, really

steel heart
umbral mica
empty flint
#
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface MyInheritedAnnotation {
}
steel heart
#

Oh nvm

empty flint
#

this is valid java code

steel heart
#

That is not extending

#

That means it will be automatically inherited when added on a method iirc

empty flint
#

No that's just an example of the Inherited annotation

#

yes

#

that's what I want

#

Right?

steel heart
#

If you want to do it use mixins or something

empty flint
#

I want the @EventHandler annotation to be inherited when I add it on a method in an abstract class

steel heart
#

(Injecting @Inherited to @EventHandler)

#

But it’s still stupid

empty flint
#

why is it stupid?

#

If you want to do it use mixins or something
@steel heart How would that work using mixins?

steel heart
#

Because annotations isn’t made for that sort of stuff originally

empty flint
#

idk how to inject the annotation

ocean quartz
steel heart
#

Or not even that perhaps

empty flint
#

Because annotations isn’t made for that sort of stuff originally
@steel heart I don't care if it's made for making strawberry cake. if there is a legit way to use it that way you bet your sweet ass I will use it that way

steel heart
#

It’s not

empty flint
#

So this doesn't work?
@ocean quartz This works perfectly fine, I would just need the "MyAnnotation" class to extend the @EventHandler annotation

steel heart
#

That would never work

empty flint
#

and that doesn't seem to work in pure Kotlin

steel heart
#

Since how annotations are readed

umbral mica
#

@DoggoEqualsGood I don't care if it's made for making strawberry cake. if there is a legit way to use it that way you bet your sweet ass I will use it that way
😐

steel heart
#

Annotations isn’t compiled down to how other stuff is such as objects etc iirc

empty flint
#

Why does it matter if it's intended that way or not?!

ocean quartz
#

Oh okay, yeah i guess gotta wait for it to be implemented

steel heart
#

Well, Blocky if you want to be able to extend annotations by annotations you’re basically inventing multidimensional oop

#

Using Inherited is very rare

#

But I assume it might be beneficial with annotationProcessing maybe?

empty flint
#

Well, Blocky if you want to be able to extend annotations by annotations you’re basically inventing multidimensional oop
@steel heart I am not inventing anything. It's possible in pure Java without any tricks. I don't know why you are accusing me of being the antichrist in terms of annotation abuse.

#

Java allows you to extend annotations

#

with other annotations

steel heart
#

You can’t extend annotations by them, you can apply inheritance. It’s not possible to extend annotation as I’ve mentioned

#

No I legit showed you that I got a compiler error from that

umbral mica
empty flint
#

hold on let me find the so post I had found earlier

steel heart
#

You can inherit them but not extend for the 101th time

empty flint
#

alright fuck it

#

EventExecutor it is

#

stoopid ass Kotlin

#

it's too late to be freaky with experimental shit

ocean quartz
empty flint
#

Yeah I can't find the post again that said it was possible

#

idk

#

maybe it was wrong as well

umbral mica
#

Mart: See my above ss lol

steel heart
#

Also one reason not to use Inherited is because it messes up the inheritance of the Type declaration

ocean quartz
#

Oh yeah mb xD

steel heart
#

Well you can implement them weirdly enough

umbral mica
#

dafuq lol

empty flint
#

uuuuh

#

oh ur right

#

hm

ocean quartz
empty flint
#

I could annotate the annotation?

steel heart
#

Yeah

ocean quartz
#

Oh hmm, would that work?

umbral mica
#

Matt read the error lol

#

you're trying to implement in an interface I think

ocean quartz
#

I mean changing to extends will get back to the other error

steel heart
#

class X implement Annot

empty flint
#

hmmm

ocean quartz
steel heart
#

Yeah it’s used for stuff like configuration with files and I assume guice maybe spring as well

empty flint
#

Fuck it, I'm too tired to figure this out

#

So EventExecutor is just an interface like Listener, right?

steel heart
#

Yeah I have an example if you need

empty flint
#

And I can register it the same way I would a listener? With the registry?

#

Sure I'd love examples

steel heart
#

You either check the event type with classes or by instanceof

empty flint
#

oof that's dirty though

#

I don't like that at all

#

Because my abstract listener class is basically listening to every single event type

#

of which there are ~240

#

so no instanceof

steel heart
#

There is another way

#

With generics

#

So what do you have currently?

#

But basically check the type with using Classes

#

If you use generics right, type erasure shouldn’t affect you

empty flint
#
abstract class ToggleableEventListener<in E : Event>(
  ...
) : Toggleable, Listener, EventExecutor, Nameable
{
  override fun execute(listener: Listener, event: E) {
    // this does not work :/
  }
}
steel heart
#

Is that the class that is going to listen to all events?

empty flint
#

well no, it's the superclass of each individual event's listener

#

what I need to do is basically this:

#
override fun execute(listener: Listener, event: E) {
    doSomethingSpecificWithE(event)
    doSomethingGenericWithEvent(event)
  }
#

where doSomethingSpecificWithE(event : E) is an abstract fun that is implemented by each subclass

#

the rest is all in the abstract class

steel heart
#

Ah okay

#

So kind of like JDA ?

empty flint
#

JDA?

steel heart
#

Ok nvm

#

Well to begin with it will be hacky if you would do it simply by method overriding

empty flint
#

As mitten can tell you, hacky is my middle name

#

He complains all the time that I want to do hacky shit

steel heart
#

Basically what I mean is you might have to make a method for every event with on<Event>(Event e) or smtng

#

then in the execute method make it better

#

Or like

#

Checking

empty flint
#

I mean yeah, that's not a problem

#

that's what I am doing anyhow already

#

I just want to avoid having to declare the annotation in every subclass

#

that is all

steel heart
#

Alternatively make a single method and let each impeachment check what event

#

Or you can reinvent the annotation thing with inherited

#

Or have a functional interface for a single method and take advantage of generics

empty flint
#

Alternatively make a single method and let each impeachment check what event
@steel heart I think that's a bad idea because then the executor gets called to check if the event is the right one, which is really bad with so many events and one executor per event

steel heart
#

Ye

empty flint
#

Or have a functional interface for a single method and take advantage of generics
@steel heart That's what I am trying to do basically

#

The problem with EventExecutor is that I can't use generics in the execute... method

#

I don't think that will work

steel heart
#

Hmm I mean that is one way or maybe have an interface defining all methods for each event, then use reflection to determine which methods are overriden and then only execute those

#

That works fine

#

But you have to include a way to get the Class<Event> as well

empty flint
#

I'd rather use reflection to change the target of EventHandler and implement it for my own inherited annotation tbh

#

easier than to fuck around with generics

steel heart
#

Yeah you’d maybe have to come up with your own annotation

empty flint
#

I mean that's easy enough, right?

steel heart
#

Yeah just a simple class

#

The annoying part is presumably the reflection

empty flint
#

yeah no idea how reflection to change the Target works

steel heart
#

Target?

steel heart
#

That’s the rules of where the annotation should be applicable

#

No we skip the @EventHandler totally

#

Create your own @EventListener or smtng

empty flint
#

I think I need to sleep on this a bit

steel heart
#

Yeah need to sleep as well, but tag me tmrw if you need anything ig

empty flint
#

Will do, thanks!

#

Good Night

steel heart
#

mc_fox_sleeping gn

remote goblet
obtuse gale
#

Errors are your friends :D

#

They tell you what's wrong for you to do it properly

tranquil crane
#

only 507

ocean quartz
#

Delete the project ez fix

tranquil crane
#

can't have errors if you don't have code

#

why is your name Mart thonking

ocean quartz
#

Frosty had a typo kek

tranquil crane
#

poor frosty

ocean quartz
#

Changed it back

obtuse gale
#

how does spring handle something like this

#
data class A(
  @OneToMany
  val things = mutableSetOf<B>()
)

data class B(
  @ManyToOne
  val b:A
 )

// At some point in code add an instance of B to `things`

 //Delete instance of b from db```
hot hull
#

My brain

obtuse gale
#

mine too

empty flint
#

Can somebody help me with gradle/groovy?

#

Can't get IntelliJ to import shit properly

#

For no fucking reason all of a sudden

sharp knoll
#

@empty flint in intellij you can go to file > settings (alt + f, t) then in plugins there's a 'minecraft development' plugin, and that does everything for you hehe - if thats easier

#

thats what i do at least

empty flint
#

I don't like that plugin though

obtuse gale
#

why

empty flint
#

I don't remember what it was exactly but it started making problems

#

the thing is, if I open the module as a project, it works

#

but if I open its parent project it won't build the gradle script

hot hull
onyx loom
#

🤢

frank pewter
#

You cant tell me you didnt use it back in the day lol

hot hull
#

He wasn't alive back in the day

onyx loom
heady birch
#
data class A(
  @OneToMany
  val things = mutableSetOf<B>()
)

data class B(
  @ManyToOne
  val b:A
 )

// At some point in code add an instance of B to `things`

 //Delete instance of b from db```

@obtuse gale No, you don't really add to the "things" instead you would create an instance of "B" and "setA" to the instance and save it.

Not:

B.getCollection().add(new A());

Yes:

A a = new A();
a.setB(b);
aRepository.save(a);
young kettle
#

is there a way one could reduce the speed of which fire charges are launched from dispensers?

hot hull
#

Check if there's an event which get's fired when that happens

foggy pond
#

Is IntelliJ ultimate better than community edition

#

I have the chance to use ultimate because I'm a student at university (for free)

hot hull
#

If you're dealing with DBs yes

foggy pond
#

I am lol

ocean quartz
#

Community is all you really need
But yeah ultimate has a bunch other great features that community doesn't have, like for example the databases, duplication detection, and a few other things that i can't remember from the top of my head

foggy pond
#

I will have a whole module related to DBs in university

hot hull
#

Then it's worth getting it yes

#

And it's free so fingerguns

foggy pond
#

I mean it should be free for me anyway so 😂

lavish notch
#

*kek, I know this is JS and JS is bad... but, might someone know what is going on here:

message = "blah @mack asdasd @mack"

newMSG = message.split("@mack").join("mack")
console.log(newMSG)

For some reason, String#Split isn't removing the separator from the created array.

static zealot
#

wait your output is blah mack @mack mack asdasd mack @mack mack ?

lavish notch
#

yes

#

wait no

#

it's literally what went in

ocean quartz
#

The output of that message in Java at least would be blah mack asdasd mack

static zealot
#

ye that's what it should be in javascript as well

#

are you sure you get @mack back and not mack? bcz what you do is basically remove @s

old wyvern
#

seems to work fine for me

prisma wave
#

Is that repl

old wyvern
#

nope

prisma wave
#

Good

old wyvern
#

xD

static zealot
#

but why .split().join() when you can just do .replace("@mack", "macl")

lavish notch
#

That's only for 1 instance

#

not all

old wyvern
#

replaceAll

static zealot
#

oh ye.

lavish notch
#

NoT a FuNcTiOn

old wyvern
#

eh

half harness
#

oh welp i thought a function and a method was the same

static zealot
#

not even replace() ?

old wyvern
static zealot
#

what enjine Mackenzie? bcz I think with js it matters what enjine you use or something. idk that much js xD

lavish notch
#

NodeJS 12

old wyvern
#

use regex with global flag then

lavish notch
#

sigh

#

I tried regex, but it doesn't like @ for some reason

old wyvern
#

huh works for me

obtuse gale
#

@ is no special char in regex tho

lavish notch
#

I know...

old wyvern
lavish notch
#

How would you substitute a string type variable in that replace function?

old wyvern
#

construct a RegExp with your string variable?

lavish notch
#

That is what I did when I tried

old wyvern
#

and?

lavish notch
#

Didn't work

old wyvern
lavish notch
#

it was whenever I added the @, that it was like nope

#

I'll try that

old wyvern
#

do you just want to remove the preceding @ ?

lavish notch
#

Correct

old wyvern
#
message.replace(/@(?=\S)/g, '')

I assume this would be fine?

lavish notch
#

The code you sent previously (white background) didn't work for me, which is odd

#

The console log is:

Mentioned user's nickname/username
final message

old wyvern
#

can I see the exact snippet from your code?

lavish notch
old wyvern
#

hmm weird

#

try printing out the regex and the original message

ocean quartz
#

Well it's JS it's always a mess xD

old wyvern
#

xD

obtuse gale
#

xD

prisma wave
#

shoulda used clojurescript

steel heart
#

Anyone else that used mixins before?

ocean quartz
#

I kinda did, just changing some default models

steel heart
#

This fucking shit drives me crazy

heady birch
#

.replace("@", "")
implements MyCoolMixin1, MyCoolMixin2, MyCoolMixin3, MixinsRFun

steel heart
#

Fuk u

ocean quartz
#

Map.class.isAssignableFrom(type) == true
type.isAssignableFrom(Map.class) == false
thonking

#

Shows how i am dumb kek

steel heart
#

That method is really confusing and always been

ocean quartz
#

Anyone wants to be my brain? I have been hitting my head for almost a week now

static zealot
#

ugh. no.

ocean quartz
static zealot
#

you'll be hitting your head even more.

onyx loom
#

suffering from success. when u dont know the answer and everyone else is too dumb to know 🙂

ocean quartz
#

Basically this is my problem:
I have to give in a class or an object (still don't know if i can do it just with class)
And with that i have to map the entire class
For example:

#

The issue is, i need to keep the data for when reading because the key sometimes won't be the same as the field name later

#

But if one of the values is null, it'll kinda break .-.

#

Maybe i need to do it with just the class type thonking

static zealot
#

ye sure. go for it. :))))

ocean quartz
#

Definitely know what it is

prisma wave
#

K, V

static zealot
#

or maybe: ||KW|| ?

prisma wave
#

elara will feature NO type erasure

steel heart
#

OMG

#

Yes

#

PLS

ocean quartz
#

Fuck it's not possible i guess cuz of stupid type erasure

prisma wave
#

yeah good luck getting past that

ocean quartz
#

I remember getting the type of a list before though, i just don't remember how

static zealot
#

@hot hull I did it and its optimised. (no more task creation every time you mine the block)

ocean quartz
prisma wave
#

😬

half harness
#

😕

prisma wave
#
if list::typeParameters[0] != String {
  return
}
#

🙂

ocean quartz
#

Kotlin can keep types right?

prisma wave
#

only with reified

#

i think

#

which isn't really generic at all

#

just syntax sugar

ocean quartz
#

Sad

steel heart
#

Type Erasure Sucks (TM)

keen creek
young herald
#

Which channel do I use to post and get help with a command I've written that is not working as I hoped?

obtuse gale
young herald
#

Thank you

remote goblet
#

tfw BlockExplodeEvent doesn't work peepoSad

lost forge
#

Rip

hot hull
#

You're just a 4head

#

What u exploding?

#

Cause you probably want EntityExplodeEvent or whatever it's called

lost forge
#

Yes, it's EntityExplodeEvent lol

remote goblet
hot hull
#

What u trynna do?

remote goblet
#

i dont know honestly

#

just messing with armor stands

hot hull
#

You gotta convert your coords to radians for the EulerAngle

#

life = easier

remote goblet
#

you make the assumption i know what radians are

hot hull
remote goblet
#

supports 1.8

#

cringe

hot hull
#

util package

#

It supports all versions cause no reason it shouldn't, and I'm gonna be using it on 1.8 so suck a phat one fingerguns

remote goblet
#

because we shouldn't encourage 1.8 usage fingerguns

hot hull
#

yeye I know

distant sun
#

Why varargs for Animation constructor?

hot hull
#

Because you can have multiple poses within that animation, ie:

new Animation(
  "RIGHT_ARM", 0, 0, 0,
  "LEFT_ARM", 0, 0, 0
)
distant sun
#

why not var args of whatever these 4 args are?

hot hull
#

wut

remote goblet
#

like

#

new Animation(new Position("RIGHT_ARM", 0, 0, 0), new Position("LEFT_ARM", 0, 0, 0));

distant sun
#

(AnimationFrame frames...)

hot hull
#

Perhaps

#

I mean feel free to PR, will accept anything usefull fingerguns

distant sun
#

All animations will be internal so why not use the AnimationSomething enum instead of a string and integers instead of objects

hot hull
#

:what:

#

Either I'm just dumb today, or y'all explaining this really poorly

distant sun
#

Nah you are dumb as usual

hot hull
#

tnks bb

distant sun
#

Btw dont exclude gradle wrapper, you need it to build the project

remote goblet
hot hull
#

Imagine not preetifying those slot numbers

#

Weak

remote goblet
#

?

hot hull
#

weak

remote goblet
#

shut up

lost forge
#

agreed, slot numbers need more prettiness

steel heart
#

Frosty

#

I can make a fat pr

hot hull
#

do it

steel heart
#

When my isp decides to not having our internet shutdown

hot hull
heady birch
#

Sorry sir but we really cannot have you streaming "Buss Down" by "Aitch" 24/7, you are using all the bandwidth

lavish notch
#

What's the easiest way to get a player object from UUID?

heady birch
#

Bukkit.getPlayer(uuid)

#
fun Player.of(uuid: UUID): Player {
    return Bukkit.getPlayer(uuid);
}```
lavish notch
#

..add um, how can I get the UUID from a string type UUID?

heady birch
#

UUID.fromString

lavish notch
#

What if the player is offline?

heady birch
#

Bukkit.getOfflinePlayer

hot hull
#

use OfflinePlayer instead

lavish notch
#

Gotcha

steel heart
#

When you call it on the main thread emoji_42

prisma wave
#
fun Player.of(uuid: UUID): Player {
    return Bukkit.getPlayer(uuid);
}```

@heady birch that won't work

remote goblet
#

@prisma wave im working on my own coding language that's better than elara

prisma wave
#

impossible

remote goblet
#

It's basically java

#

but

#

everything is backwards

prisma wave
#

😬

hot hull
#

lmao

remote goblet
#

believe me

normal talon
#

can someone make a language where

remote goblet
#

that was cancer to type

normal talon
#

you can really translate something like

#

only

#

player.fly

#

and thats it

#

without if else switch

steel heart
#

Kotlin

heady birch
#

fly!(player)

prisma wave
hot hull
#

kek

heady birch
#

Poor data entry guy "Huh wierd company name... meh... hey my system stopped working... must call IT"

prisma wave
#

🥶

hot hull
#

What's will all those variables tho

#

That's the real question

prisma wave
#

stock images of code

kindred hatch
#

If chat is handled async, is sending messages async?

heady birch
#

Idk. I think packets are "queued"

kindred hatch
#

Hmmm

steel heart
#

Yep

#

You can send messages async afaik

kindred hatch
#

Cause if you send bulk, there can be order changes

#

So I was seeing

lavish notch
#
Player placer = Bukkit.getPlayer(UUID.fromString(hopperOwner));

            if(placer == null) {

                OfflinePlayer placer2 = Bukkit.getOfflinePlayer(UUID.fromString(hopperOwner));
                placer = placer2.getPlayer();

            }

Am I doing something wrong, placer is returning null for some reason.

hot hull
#

Why get the player twice, use offline player and then check if he's online, if he is, cast to online player

lavish notch
#

ok

hot hull
#

Wait no don't cast, use getPlayer

heady birch
#

Is it worth caching a load of Color objects?

steel heart
#

Please don’t do it on the main thread

heady birch
#

Me? 🤨 Only inserting into a hashmap to cache. Then a quick hashmap check. Custom hashCode() implementation

hot hull
#

Probably talking to Mackenzie

#

Niall, I mean gotta get those micro optimizations fingerguns

lavish notch
#
OfflinePlayer placer = Bukkit.getOfflinePlayer(UUID.fromString(hopperOwner));

            if(placer.isOnline()) {

                placer = Bukkit.getPlayer(UUID.fromString(hopperOwner));

            }

like so @hot hull?

hot hull
#

Before I answer that, what's the point of this

lavish notch
#

A crop hopper plugin, needing to get the player from a UUID string type to then check their permissions

hot hull
#

Is the player going to be online or offline

lavish notch
#

Both.

#

Not at the same time obviously

hot hull
#

Use offline player then, and hook into lp to check the perms, since I don't believe you can check perms for an offline player

lavish notch
#

D:

forest pecan
#

You can also use the VaultAPI

#

as well

hot hull
#

probably a better idea yea

lavish notch
#

Huh?

#

How so

hot hull
#

With vault it'll work with all perm plugins

forest pecan
#

Permissions#playerHas(Bukkit.getWorld("world").getName(), player, permission);

lavish notch
#

Oh, I thought yous were talking about the offline player part

steel heart
#

CompletableFuture.supplyAsync(() -> {
return Bukkit.getOfflinePlayer("Notch");
}).thenAccept(player -> {
Bukkit.getScheduler().runTask(plugin, () -> {
player.doSomething();
{
} or smtng like that

hot hull
#

ew

steel heart
#

I mean completable futures is eww

hot hull
#

Just execute on main thread, ez claps

steel heart
#

...

#

Omg @forest pecan joined PepeJedi PepeJedi PepeJedi

forest pecan
#

Hey nerds

#

How yall doing

#

DoggoEqualsGood?

#

Lol

steel heart
#

..

#

On monday they’re gonna fix it now

forest pecan
#

DoggoEqualsGood 😎

#

xD

#

Where you get that name from

#

Fefo brought me here

steel heart
#

Uh well I mean Doggo is equal to good right?

forest pecan
#

Doggo equal to good only if it's Conclure's doggo

steel heart
#

Yup

#

Ngl but facts

forest pecan
#

Facts

obtuse gale
#

fax

forest pecan
#

Fefo pog

obtuse gale
#

I'm still stuck in the 90s

#

fax

hot hull
#

This the pog gang or what

obtuse gale
#

Is it now?

#

That's pog

forest pecan
#

Running in the 90s

obtuse gale
#

fun

#

I am fun

heady birch
#

So for some reason I have /** created by <user> at <date>**/ annotations on like 15% of my classes do I just remove them

frail glade
#

I use those sometimes

onyx loom
#

if ur not doing it consistently i dont see the point

heady birch
#

yeah majority of classes were made before i enabled it

hot hull
#

It's a good identifier so you know which date you made stupid decisions on

heady birch
#

Kite board isnt so enterprise to be honest. Unless your definition of enterprise is "RAM eating" 🙂

hot hull
#

OS it.

heady birch
#

I am working on it

#

LOGISTICS of it

steel heart
#

GIVE ME kiteBoArD

distant sun
#

What do you use for these annotations @heady birch

runic flume
#

Guys

#

RIP TechsCode

#

He died in a car crash

steel heart
#

Bruh I can’t edit my message my phone legit autocorrected fkn shit

forest pecan
#

Bro let me comment on there

steel heart
#

Ye

runic flume
#

Honestly

#

Dont know what to say

forest pecan
#

Give me profile link

runic flume
#

I was in a call with him 2 weeks a ago

forest pecan
#

Imma write a speech

#

Oh

steel heart
#

Oof

forest pecan
#

Idk what to say tbh

#

It really does suck to have someone who was very active in the community to pass away

steel heart
#

::

#

/

#

Yeah

runic flume
#

I dont think this ever happened before

#

Not like this

forest pecan
#

It’s cause it’s rare

#

The spigot community is still tiny

#

But has grown a ton

steel heart
#

Tru

frigid badge
#

it has happened before

#

shortninja for example

#

was in 2017 iirc

onyx loom
#

yea

frigid badge
#

It’s all really sad but that’s for every person who dies.

runic flume
#

Mhmm

signal tinsel
#

Fkn rip tech

#

Incredible dev

obtuse gale
empty flint
#

What would be the best way to have an Event map to a Function that does not cost too many resources to resolve? Is there a way to have like an inline when or something?

#

Basically, I want a method that parses the type of event and depending on the event class, different things are supposed to happen, but I don't want the parsing to take too long and I want to avoid a when() with 240 is ... -> statements

light venture
#

returns - returns

prisma wave
#

@empty flint hash table?

lavish notch
#

Is there a difference between if(whatever.equals(null) {....} and if(whatever == null) {...}?

hot hull
#

equals would be an object check iirc, which would always be false right? It'd also throw an NPE if you tried to invoke .equals on a null object

#

Someone correct me if I'm wrong ^

distant sun
#

I always use ==

lavish notch
#

Aight

hot hull
#

Same

steel heart
#

@lavish notch if a class doesn’t override the #equals it’s by default going to be a == comparison which means you could just use == directly. .equals is often used for stuff like locations, vectors where the values of 2 different instances may be the same

lavish notch
#

k

hot hull
#

Conclure, wouldn't it throw an NPE since you try to invoke a method on a null object tho?

#

Or am I getting this wrong

distant sun
#

¯_(ツ)_/¯

steel heart
#

Ye that’s correct

lavish notch
#

So.... I'm making a commit where I changed a .equals(null) to == null. What should I put for the commit message/note?

hot hull
#

Meaning it'd be unsafe to use that

steel heart
#

It’s literally
public boolean equals(Object obj) {
return obj == this;
}

hot hull
#

Yes, but still invoking a method 🤷‍♂️

steel heart
#

exactly

prisma wave
#

yeah you can't* do equals null

#

So.... I'm making a commit where I changed a .equals(null) to == null. What should I put for the commit message/note?
@lavish notch "Changed null check to prevent potential NPE"

steel heart
lavish notch
#

Cheers

forest pecan
#

why do people spend the time

#

to write commit messages

#

lol

#

I just feel the need that im too lazy to say what i coded because I don't want to overexplain it xD

prisma wave
#

just summarize

#

it's very important if you need to go back and see what change caused a bug or something

#

or with any public project

forest pecan
#

Commit messages too good

hot hull
#

bugs

#

pfft what is that

#

Can't relate

forest pecan
#

Lol

heady birch
#

Want to format RGB integer... into §x§F§F§F§F§F§F

steel heart
#

Yeah just make it base thing and then convert

#

Or there is probably a method for it otherwise

obtuse gale
#

ChatColor.of("#rrggbb")?

heady birch
#

String.format("something", 16777215) -> "§x§F§F§F§F§F§F"

obtuse gale
#

oic

prisma wave
#

to char array -> format?

heady birch
#
&#(.)(.)(.)(.)(.)(.)
&#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])

How much slower would the bottom pattern be?

prisma wave
#

probably faster

#

afaik more specific regexes are more performant

heady birch
#

Ah cool, any way to shorten that? Whislt keeping the capture groups?

obtuse gale
#

I mean for that second Regex you could just \\w wouldn't you?

static zealot
#

&#{([0-9a-fA-F])}*5. I know regex

#

also math

steel heart
#

Regex be like:
{<}%}€}||0939—9384018-82847:kr>#7)>]&0€7<^}}}}}}}}}}}}}}}$+{*{$}}

heady birch
#

Are tests meant to go in a package lol? At the moment mine are at the root

/test/java/<here>

steel heart
#

That’s fine

obtuse gale
#

Regex be like german bruh

steel heart
#

Lol true

static zealot
#

hehe

prisma wave
#

I think the tests should usually match the package of the class they're testing

obtuse gale
heady birch
#

Don't suppose theres a faster/shorter way of doing this:

final String text = String text = Integer.toHexString(awtColor.getRGB());
        return "§x" +
                "§" + text.charAt(0) +
                "§" + text.charAt(1) +
                "§" + text.charAt(2) +
                "§" + text.charAt(3) +
                "§" + text.charAt(4) +
                "§" + text.charAt(5);```
steel heart
#

You could cache the char array but and also StringBuilder is much cleaner in my opinion

heady birch
#

Might even cache the string altogether

prisma wave
#

isn't presizing a stringbuilder faster?

#

also idk if this is applicable to java, but when I was working on elara it was a lot faster to use char arrays (rune slices in go terms) rather than strings wherever possible and then convert on-demand

#

im sure rust has a zero cost abstraction for strings 🙂

heady birch
#

Using this "§x" internally instead of my old format will use like twice the ram

#

§x§F§F§F§F§F§F
vs
&#FFFFFF

prisma wave
#

neglible?

heady birch
#

Most likely

#

Not sure if you got lists/gradients of a 100 frames animated or whatever

hot hull
#

Enterprised software, not neglible!!

heady birch
#

Only doing it because using my format it didn't parse the colours coming from papi placeholders e.g

#
  • This might be marginally faster
prisma wave
#
if text[0] == '§' {
  use long format
}
else {
  use short format
}
``` 🙂
hot hull
#

ew is that an else

prisma wave
#
(if (=  (first text))
  (use-long-format)
  (use-short-format))
#

🌚

onyx loom
#

absolutely not

prisma wave
#

no elses in clojure

#

absolutely yes

hot hull
#

bring back the else thanks

prisma wave
#

how dare you

hot hull
#

😎

prisma wave
heady birch
#
final float a = (100f / b) * c;
return (a / 100f);

Is that 100f redundent somehow if I rearrage it or whatever

prisma wave
#

yes

#

because a = 100fc / b and you divide by 100f

#

although the compiler is probably smart enough to optimize that

heady birch
#

FINE we will see, we will let the unit TESTS determine the RESULTS.

prisma wave
#

gooD

#

🥰

#

java 9 😦

#

Optional#or

onyx loom
#

kotlin 1.0

prisma wave
#

cant

#

😦

heady birch
#

I am pleased to share that the function passed all the Junit tests.

prisma wave
#

i am definitely talking about it !

heady birch
#

You know, ask people at JUnit.. they know, they are all talking about it. I have a very good friend at JUnit, an experienced professional, he will tell you, you know

prisma wave
#

so proud 😊

hot hull
#

Very

empty flint
#

Hm aparently you can't listen to all events, you have to specify which events you want to listen to specifically

#

which is dumb

steel heart
#

You can

#

With EventExecutor?

forest pecan
#

why would you listen to all events the first place though

empty flint
#

Hm, I haven't tried with Executor yet

#

Lemme try and get back to you

steel heart
#

No cuz HandlerList makes it only possible through events that has one with Listener and the @EventHandler

#

I’ve told you several times to use EventExecutor if you want to do something which isn’t only listening such as handling etc

#

I heard java 16/17 will have a memory api or smtng

#

Discount pointers, will be very interesting