#dev-general

1 messages ยท Page 308 of 1

regal gale
#

Wondering why no one ever mention this:
MainPlugin plugin = MainPlugin.getPlugin(MainPlugin.class)๐Ÿ‘€

hot hull
#

Be gone.

quiet depot
#

thien I mentioned that before

#

getPlugin returns JavaPlugin iirc, not MainPlugin

#

d;spigot javaplugin#getplugin

ruby craterBOT
#
@NotNull
public static T getPlugin(@NotNull Class clazz)
throws IllegalStateException, IllegalStateException, ClassCastException, IllegalArgumentException, IllegalArgumentException```
Description:

This method provides fast access to the plugin that has provided the given plugin class, which is usually the plugin that implemented it.

An exception to this would be if plugin's jar that contained the class does not extend the class, where the intended plugin would have resided in a different jar / classloader.

Parameters:

clazz - the class desired

Throws:

IllegalStateException - if clazz was not provided by a plugin, for example, if called with JavaPlugin.getPlugin(JavaPlugin.class)
IllegalStateException - if called from the static initializer for given JavaPlugin
ClassCastException - if plugin that provided the class does not extend the class
IllegalArgumentException - if clazz does not extend JavaPlugin
IllegalArgumentException - if clazz is null

Returns:

the plugin that provides and implements said class

quiet depot
#

nope

#

nvm

regal gale
#

I was just being a sacarsm lol

#

There are still influencers who still recommend this approach

#

Which happened to one of my friend

quiet depot
#

thien read the message I linked

regal gale
#

I saw it thonking

quiet depot
#

there's nothing wrong with using that

#

apart from potentially what bm said

#
Brister MittenToday at 5:25 PM
The only problem with bukkit.get is the implicit tight coupling it creates, but I doubt that's a real issue```
prisma wave
#

Yeah I still think you should use DI

quiet depot
#

just replace bukkit.get with javaplugin.getblah

#

I mean in the end it's up to personal preference

#

just don't avoid javaplugin.getblah because you think it'll make ur code bad

#

avoid it because you prefer di (perhaps to make your codebase consistent)

prisma wave
#

I actually try and unit test stuff so imo DI is much better

old wyvern
#

Avoid it, to move to elara ๐Ÿ™‚

prisma wave
#

All these "abstractions" bro just use functions

old wyvern
prisma wave
#

o

old wyvern
#

Now its inferring types from hell knows where

prisma wave
#

lmao

quiet depot
#

what lang

old wyvern
#

Haskell ofc

#

xD

regal gale
prisma wave
#

๐Ÿฅถ

jovial warren
#

Singletons good

#

In Kotlin

#

In Java they bad

old wyvern
#

Umm

#

No

prisma wave
#

๐Ÿคฃ

jovial warren
#

Imagine having to call getinstance just to get the singleton instance ew

prisma wave
#

The so called "singleton pattern" that isn't even double-locked

jovial warren
#

Double-locked?

prisma wave
#

Double checked locking*

jovial warren
#

Please provide me with the meaning.exe file associated with this xD

#

I'm a fan of the early init singleton

old wyvern
#

Even that could be subject to a race condition

#

referencing the class from multiple threads for the first time for example

prisma wave
#

Yeah I'm not actually sure what the JVM would do there

old wyvern
#

mhm

jovial warren
#

Also, how tf can you have an enum singleton

#
  1. That's not what enums are for
  2. I swear enums are singletons anyway
prisma wave
#

Enum constants are singletons

obtuse gale
#

im tryna change my sdk for my module but gradle keeps resetting it and fucking me over

#

how do i fix that

old wyvern
#

For the point 2, I mean if there are 3 enum values, its not exactly a singleton

trim niche
#

Is it possible to set a block to be blast-resistant?

prisma wave
#

Therefore, it is 100% guaranteed that only one instance of the singleton is present within a JVM. Thus, this method is recommended as the best method of making singletons in Java.

old wyvern
#

mhm

quiet depot
#

you can add enum constants via reflection right?

#

i swear you could

prisma wave
#

afaik reflection can't define new variables

obtuse gale
#

Basically because of this my SDK is changing when i reimport grodle

#

How make it not do that

quiet depot
#

what ver r u changing the project sdk to?

obtuse gale
#

my what

quiet depot
#

show ur build.gradle

obtuse gale
#

=paste

compact perchBOT
#
HelpChat Paste

Please use a paste service to share configs, errors, code and long logs.
โ€ข HelpChat Paste

obtuse gale
quiet depot
#

add a sourceCompatibility line and set it to verion 15

#

see if that fixes it

obtuse gale
#

sourceCompatibility '15' like that?

#

apparently not

quiet depot
#

sourceCompatibility = JavaVersion.VERSION_15

obtuse gale
#

still reverts wheni reimport gradle

unkempt tangle
#

@prisma wave

#

I figured out that verloren is written in Rust

#

U may wanna help dem

prisma wave
#

WOW

#

that sounds like a good game

#

they clearly appreciate memory safety ๐Ÿฅฐ

unkempt tangle
#

Be a good senpei

jovial warren
#

right, Komponent time

#

morning all

#

oh btw, just out of curiosity, would anyone actually be interested in using Komponent when it's done?

hot hull
#

No clue what that is

obtuse gale
#

what is it

prisma wave
#

why is worldguardwrapper adding like 1MB to my jar

obtuse gale
#

just use pdm lol

prisma wave
#

๐Ÿ™„

#

i could do that actually

#

practice what i preach

jovial warren
#

Komponent is my chat component library from scratch

#

written in Kotlin with native kotlinx.serialization serialisation built-in

prisma wave
#

but why

old wyvern
#

chat component for what?

obtuse gale
#

hello how make project work

jovial warren
old wyvern
#

ah

old wyvern
obtuse gale
#

no

old wyvern
#

yes

obtuse gale
#

how change sdk gradle uses

old wyvern
#

ditch gradle

frigid badge
#

use stack

old wyvern
#

EBT is all you need

jovial warren
old wyvern
jovial warren
old wyvern
#

stack install stack

obtuse gale
# jovial warren wdym?

Basically to make an IJ plugin you have to have a special SDK set apparently but when i change it in project structure gradle just reverts it

old wyvern
#

Inception

prisma wave
#

docker run docker

jovial warren
#

docker pull dind

old wyvern
#

stack new >> gradle init

#

๐Ÿ™‚

prisma wave
#

cargo init

jovial warren
#

me make EPM

frigid badge
#

jq new

jovial warren
#

EPM is probably gonna work something like either YUM/DNF or APT

#

just pulls a package, verifies it with a GPG key, and installs it

unkempt tangle
#

What do you guys are talking about

jovial warren
#

wdym?

#

we're talking about Elara

old wyvern
#

The Glorious Glasgow Haskell Compilation System

prisma wave
#

so modern ๐Ÿ˜ฉ

old wyvern
prisma wave
#

ok hi smart people i have a bit of a code structure question
I'm making a minigame framework and that's all centered around this Game class.
I've got this setup so individual games extend Game and use @GameInfo for things like the name of the game.

Now, Games have certain dependencies (such as a GameMap, GameConfig, etc, it depends on the implementation). I'm using Guice to inject any dependencies

However I'm not sure if I should make Game classes singletons, or create a new Game every time.
The benefit to singletons would be that I only need to get 1 instance with Guice, but that also means certain things have to be mutable (for example, we might want to use a different GameMap)
I'm not a huge fan of this so I'm currently thinking of making a new instance each time. The problem there is that to inject a new instance every time (based on a Class<? extends Game> ), i'd need to keep a reference to the guice Injector which is a bad practice apparently. I'd also need to configure a different module to bind a different instance of GameMap etc

#

Which of these 2 approaches should I favour?

old wyvern
prisma wave
#

๐Ÿฅฒ

quiet depot
#

bm typically I don't inject into these kinds of classes

#

I usually have a manager with the logic methods, that stores a Map<String, Game> or whatever

#

and the actual game object is just a data object

#

perhaps storing things such as a player list, the map name, etc

obtuse pulsar
#

Cannot find main class `main.java.Main

quiet depot
#

@prisma wave iirc injector usage is considered as bad practice because it doesn't allow you to easily switch di frameworks

#

if you stick to purely the functions that are in javax.inject, you can switch, as any decent di frameworks will implement javax.inject

#

but when you start using injector, that's guice specific

prisma wave
#

yeah it also makes the coupling much less explicit

#

im not sure that actually solves my problem though

distant sun
#

@jovial warren any idea why it can't find IntEntity?
Edit: nvm I have added exposed-core instead of exposed-dao

quiet depot
#

also bardy why ur text component thing over adventure?

prisma wave
#

even if I move things into a Manager, I still need to get and inject an instance of GlassrunMap from somewhere, with a potentially different map each time

#

among other things

quiet depot
#

no

#

you'd have another manager for maps

#

these objects really shouldn't be handled by guice

#

mind you you can literally store the map in guice if you wish to do that instead of a manager

#

although for encapsulation purposes you should really use a manager (unless the map is immutable, although you'll still need logic functions, so yeah, manager)

prisma wave
#

okay

#

and then what about the different implementations of GameMap*? Should i just cast?

#

im not sure i actually need customisable maps but i'm trying to plan ahead here

quiet depot
#

you could use an enum, and then safely cast

#

EnumMap<GameName, GameMap>

#

hang on

#

no

prisma wave
#

an enum isn't possible, the entire set of games won't be known to the framework

quiet depot
#

maybe a table

prisma wave
#

other plugins will hook in and add extra Games

quiet depot
#

Table<GameName, String, GameMap>

#

then string for row aswell

prisma wave
#

alright makes sense

quiet depot
#

game : map name : impl
String : String : GameMap

prisma wave
#

so then I can just pass the map name to the Game class with manual DI right?

#

then the GameManager impl gets the actual GameMap and does stuff with it

quiet depot
#

yes

prisma wave
#

okay makes sense ty

#

lemme see what i can do here

#

wait couldn't i use the Game class as the row in the Table?

#

Table<Class<? extends Game>, String, GameMap>

quiet depot
#

yes

prisma wave
#

even better

quiet depot
#

then if some idiot using ur api puts a gamemap on the wrong game type

#

and someone tries to get it

#

throw an assertionerror or something

prisma wave
#

im not sure I can make that dynamic can I?

#

if you mean like AssertionError{GameMap should be instanceof GlassrunMap, was [blah]}

#

unless I force an annotation onto Game that specifies what type of GameMap should be accepted

quiet depot
#

AssertionError{GameMap should be instanceof GlassrunMap, was [blah]} that's exactly what I mean

#

and yeah I assumed that you already had some sort of system to determine what belongs to what

prisma wave
#

Nah nothing that fancy yet

#

I'm trying to decide if I want 300 annotations everywhere or not

quiet depot
#

just keep type parameters in mind

#

they can be a replacement for annotations like that in specific circumstances

prisma wave
#

ah good point

quiet depot
#

I wouldn't necessarily say this is one of those circumstances

#

generally it's safe to assume it's not one of those circumstances

prisma wave
#

although type erasure

quiet depot
#

I need to see the class to be sure

prisma wave
#

yeah

#

which one?

quiet depot
#

map

prisma wave
#

GameMap is actually just a simple interface

#
public interface GameMap {
    @NotNull Region spawnArea();
    @NotNull Region totalRegion();

    @Unmodifiable @NotNull
    default Set<Region> allRegions() {
        return Collections.emptySet();
    }

    @Unmodifiable @NotNull
    default Set<Region> outOfBoundsAreas() {
        return Collections.emptySet();
    }
}
#

the specific parts of each map are up to the implementation

#

trying to keep the interface as general as possible

quiet depot
#

yeah so this isn't one of those cases

#

stick with the annotation

prisma wave
#

alrighty

frigid badge
#

docker

prisma wave
#

lol

#

would it be safe to say some sort of GameMeta class is a good idea for caching stuff like name, map type , etc?

quiet depot
#

now you may be asking "well how do I recognise when one of these cases", and the answer to that is you don't really need to. Such a case can only really occur on accident, or due to an oversight, so if you pay sufficient attention to your code, you don't need to specifically watch out for it. basically make ur code clean and it'll be fine

#

annotation bm

#

I think

#

let me check papi 3 real quick

#

yeah bm that's fine, but i'd make it an annotation not a class

prisma wave
#

no i mean i've got annotations already

#

this would be for caching the values of the annotations

#

it's generated based on the values in them

#

to avoid isAnnotationPresent + getAnnotation everywhere

quiet depot
#
public interface Game {
    default GameMeta getMeta() {
        return Optional.ofNullable(getClass().getAnnotation(GameMeta.class))
                .orElseThrow(() -> new IllegalStateException("pingu season 7 when"));
    }
}```
#

would that work?

prisma wave
#

uh yeah ig

#

but i mean for something like MapManager#getMap it would be nicer to be able to do ```java
throw assertionError(meta.getGameName() "expects " meta.getMapType() " instead of blah")

#

i basically mean a pojo collecting the values from ```java
@GameName("glassrun")
@GameMapType(GlassrunMap.class)

quiet depot
#

then put it into one thing?

prisma wave
#

but i guess i could just use 1 annotation

#

yea

quiet depot
#
@GameMeta(
    name = "glassrun",
    mapType = GlassrunMap.class
)```
#

sorry I thought we were on the same page there

#

that's the annotation I was thinking of from the start

prisma wave
#

ah right

#

i see

#

yeah i probably shouldve mentioned that there's 2

#

probably more

#

ok

#

1 is better

quiet depot
#

wow just looking back at papi 3, for 6 month old code this actually isn't bad

heady birch
quiet depot
#

like usually when you look at old code it's shit

#

papi 3 aint like that, at least imo

prisma wave
#

oh i see what you mean

#

smh

#

no

unkempt tangle
#

Senpai

#

I would like to release my plugins to spigot

#

Would ya make me a template

#

@prisma wave

distant sun
#

Any Idea why I can't use eq on exposed? a.eq(b) works but a eq b doesn't

unkempt tangle
#

eq?

#

equalizer

#

or equal

prisma wave
prisma wave
unkempt tangle
#

yeah a posting style

distant sun
#

they use it as an infix in all their example

quiet depot
#

what's expose gaby?

distant sun
quiet depot
#

o

#

when did u start using kotlin

unkempt tangle
#

Did they expose someone?

distant sun
#

a while ago

distant sun
#

welp guess it was not imported

jovial warren
#

you should try it out if you haven't already

quiet depot
#

no time

#

and don't care enough

#

tried it out once

jovial warren
#

wow

quiet depot
#

wasn't amazed

#

answer my question from before

#

and gaby's

#

pls

jovial warren
#

ask @prisma wave

quiet depot
#

oh is it his?

jovial warren
#

he wanted something custom on the internals, and I kinda misinterpreted that

distant sun
#

bbg how can I do currentValue += something

jovial warren
#

he was against us using adventure on the internals of MineKraft

#

no it's mine pig

hot hull
quiet depot
#

u guys r gonna get a law suit from kraft

jovial warren
jovial warren
#

just gotta get some ideas

quiet depot
#

minceraft

distant sun
#
            PlayersTable.update({ PlayersTable.id eq uuid }) {
                it.update(kills, it[kills] + 1)
            }```
hot hull
#

Minekampf

quiet depot
#

that's why I don't want to use kotlin btw

#

ugly

hot hull
#

Gaby, AtomicInteger fingerguns

jovial warren
distant sun
#

column, expression / sqlexpressionbuilder

hot hull
#

Yugi has shit internet right?

jovial warren
jovial warren
old wyvern
quiet depot
#

I think I might go backwards in languages before I go forwards (backwards being c-esque, forwards being kotlin, go, etc)

distant sun
#

increase the value of a column by one

old wyvern
#

forwards being Haskell

#

๐Ÿ™‚

jovial warren
#

I like Kotlin because it's much more concise and cuts out boilerplate

quiet depot
#

the problem with learning all these other languages is that they don't have a spigot for me to learn with

old wyvern
#

Rebuild some other project into that language

jovial warren
#

you can even inline that variable if you want to make it shorter

#

and I'm not 100% sure if commit() is needed or if it's automatic when a transaction is finished, but I use it anyway just to make sure

old wyvern
#

Does kotlin have overloaded strings? No? I thought so fingerguns

hot hull
old wyvern
#

Oh ok frost ๐Ÿ‘

static zealot
prisma wave
distant sun
#

shut up

#
    fun addKill(uuid: UUID) {
        transaction(database) {
            val player = PlayerEntity.find { PlayersTable.id eq uuid }.firstOrNull()

            if (player == null) {
                PlayersTable.insert {
                    it[id] = uuid
                    it[kills] = 1
                    it[wins] = 0
                }

                return@transaction
            }

            player.kills++
            commit()
        }
    }```
@jovial warren is dis good?
prisma wave
#

That's so ugly

hot hull
#

very ugly

#

Not really that impressive since it's in a time period of 5 years, but still

stuck harbor
#

lol

distant sun
#
+------------------+-------+------+
| uuid             | kills | wins |
+------------------+-------+------+
| 0โ”Œโˆ™~ฮฃรดBรŸร‰ฮตq_ร‡H         |     2 |    0 |
+------------------+-------+------+```
Close
#

except that it saves the uuid as god knows what

#

binary(16)

old wyvern
#

I thought this game was new

#

The intro cinematic was amazing

hot hull
#

No it's really old lol

old wyvern
#

Wow

jovial warren
#

storing the UUID as a 128-bit binary value is better than as a string

#

actually they might be about the same, but obviously string format is readable

hot hull
#

CHAR(36)

#

good enough

jovial warren
#

yeah but that's inefficient

heady birch
#

Also please add a seperate int column for the identity

distant sun
#

uuid is my key, niall

jovial warren
#

that's 4 extra bytes you don't need

jovial warren
#

since it'll make relationships easier

distant sun
#

ok

jovial warren
#

as you'll only be storing an integer to reference an object in another table, rather than an entire UUID

#

and anyone who doesn't use relational databases is dum dum xD

#

except for if you don't need it I suppose, like in some sites I think

heady birch
#

Just use hibernate ๐Ÿ™‚

jovial warren
#

Hibernate is phat and made in Java

#

Exposed is lightweight and made in Kotlin

#

for Spring, you should probably use JPA with Hibernate, since it's faster and a little easier, and size doesn't matter

prisma wave
#

use their username as primary key

jovial warren
#

for this though, Exposed is the better option

distant sun
#
object PlayersTable : IntIdTable("players") {

    val uuid = varchar("uuid", 36)
    val kills = integer("kills").default(0)
    val wins = integer("wins").default(0)

}

class PlayerEntity(id: EntityID<Int>) : IntEntity(id) {

    companion object : IntEntityClass<PlayerEntity>(PlayersTable)

    val uuid by PlayersTable.uuid
    var kills by PlayersTable.kills
    var wins by PlayersTable.wins

}```
So, like this?
onyx loom
jovial warren
prisma wave
jovial warren
#

saving data

distant sun
#

wont that save it as binary(16)?

prisma wave
#

Actually

jovial warren
#

yeah

#

that's the point

prisma wave
#

CraftPlayer#toString for primary key

distant sun
#

I know

jovial warren
#

you're saving data by doing it like that

#

and it's better

#

and you can serialise and deserialise binary UUIDs faster than strings iirc

distant sun
#

ok

prisma wave
#

The so called "noticable difference in Speed"

heady birch
#

Why not just Player.hashCode what does that even return

jovial warren
#

@prisma wave hey, you might know the answer to this: any idea how I can serialise elements of a List<T> by converting each element to some subtype of T and serialising that?

jovial warren
#

I mean, might work, but I wouldn't rely on it

heady birch
#

A couple hash code collisions wouldn't hurt anyone

prisma wave
#

Just double the bits bro

#

Use longs

#

0% chance of collisions

heady birch
#

Random#nextInt

jovial warren
#

I have a List<Component>, and Component stores all the data shared between components (excluding the actual value), and I want to serialise that list by converting each element in the list to it's respective implementation and serialising that

#

or at least, that's the only way I can think of doing it

prisma wave
#

what do you mean "respective implementation"

heady birch
#

I'm not sure you can

jovial warren
#

Component is implemented by TextComponent, TranslationComponent, KeybindComponent and ScoreComponent

frigid badge
#

that's so counterintuitive

jovial warren
#

wdym?

frigid badge
#

if they all are implementations of Component then why does Component not have a serialize method which gets implemented as well

prisma wave
#

If it's an implementation shouldn't it use that implementation's Serializer

jovial warren
#

yeah but serializer<List<Component>>() doesn't seem to get that

#

that's what I want, I want it to call the implementation's serialiser, but it doesn't, and instead says it can't find a serialiser for Component

#

this is like my 4th or 5th time trying to get this to work, and it's starting to actually piss me off

heady birch
#

He mean's Component interface have a serialize() method

jovial warren
#

ah that could work

heady birch
#

But then I guess that violates the SRP, can't win these days ๐Ÿ˜ฆ

prisma wave
#

๐Ÿคฃ

jovial warren
#

nah, it can be in the companion object

prisma wave
#

๐Ÿคจ

frigid badge
#

wut

jovial warren
#

actually that won't work how I think

#

but the kotlinx.serialization plugin auto-generates a serializer() function for every class annotated with @Serializable anyway, so not that big of a difference

prisma wave
#

ridiculous

jovial warren
#

and that returns the auto-generated serialiser for the class

frigid badge
#

so then what is the problem

#

just have a serializer method in your Component interface

jovial warren
#

abstract class*

frigid badge
#

and just have the subtypes be annotated?

jovial warren
#

trying to think what I would do in the serialise function though

frigid badge
#

nothing

jovial warren
#

wdym nothing?

frigid badge
#

those get implemented

jovial warren
#

ah yeah, that'll work

#

trying to think how it'll be called by the serialisers

frigid badge
#

just like normal

#

it literally just calls Component#serializer

#

and since it's implemented in it's subtype

#

e.g. TextComponent

#

it calls TextComponent#serializer

jovial warren
#

yeah but then how can I serialise a list?

#

actually I think ik how to do that

distant sun
#

bbg do I have to relocate all of these?

    implementation 'org.jetbrains.exposed:exposed-jdbc:0.29.1'
    implementation 'org.jetbrains.exposed:exposed-dao:0.29.1'
    implementation 'com.zaxxer:HikariCP:4.0.2'
    implementation 'mysql:mysql-connector-java:8.0.23'```
jovial warren
#

last one should be runtimeOnly but probably yeah

prisma wave
#

runtimeOnly ๐Ÿ˜

jovial warren
#

it's a driver impl

#

driver impls should always be runtime only

#

you shouldn't ever have to access those in compilation

heady birch
#

SerializerResolver.resolve(T type)

jovial warren
frigid badge
#

whatever the normal generated serializer returns

jovial warren
#

it can't return KSerializer<Component> since that just moves the problem

#

it would be KSerializer<Type>

#

also, I seem to get conflicting overloads wtf

frigid badge
#

I bet there's information about this in the documentation

jovial warren
#

I'd be surprised

distant sun
#

bbg help lol

jovial warren
jovial warren
distant sun
#

why is my jar 12mb

#
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib"

    implementation 'org.jetbrains.exposed:exposed-jdbc:0.29.1'
    implementation 'org.jetbrains.exposed:exposed-dao:0.29.1'
    implementation 'com.zaxxer:HikariCP:4.0.2'
    runtimeOnly  'mysql:mysql-connector-java:8.0.23'

    compileOnly 'com.github.Mezy.UhcCore:UhcCore:v1.19.1'
    compileOnly spigotApi('1.12.2')
}```
prisma wave
#

let words = replicateM (n - 1) $ \x -> input!!x why this not work

#

STUPID language

#

wait im not doing IO

#

i can just do map

#

i think

#

HA HA HA

#

YES

#

no

#

didnt work

lunar cypress
#

lol

#

what are you trying to do

prisma wave
#

find how many duplicate words are in a string

#
let words = map (input!!) [0..(n - 1)] 
let diff = (length $ words) - (length $ nub words)    
putStrLn $ show diff
``` i have this
#

works fine

#

up until the last test case

#

also that's sick you can curry !!

#

i love it

lunar cypress
#

input already is a list of words?

prisma wave
#

uh

#

yes

#

lmao

jovial warren
#

those are the 3 biggest dependencies in there

prisma wave
#

welp 10 seconds left

distant sun
#

fuck man

jovial warren
#

didn't know Exposed core used coroutines or reflect ngl

lunar cypress
#

dunno what's wrong there then

#

probably some edge case

prisma wave
#

yeah it was an edge case

#

the last test was like word word word and my solution was giving 1 where it should've been 2

distant sun
#

fucking libs bbg

unkempt tangle
#

Senpai

#

2. Write down the bullet points of a relational database model and explain them in your own words!

prisma wave
#

lol

#

what

unkempt tangle
#

db

frigid badge
#

nobody is going to do your homework

unkempt tangle
#

Its not homework ;c

prisma wave
#

that question doesnt even make sense lmao

unkempt tangle
#

its preparation for exams

distant sun
#

minimize() lower it to 6mb, not bad

prisma wave
#

The terrible price of kotlin

#

Meanwhile elara stdlib (better) actually REDUCES jar size

frigid badge
#

do you have a job

prisma wave
#

Elara bytecode is up to 30% more efficient than "kotlin"

frigid badge
#

or school

unkempt tangle
#

๐Ÿ˜ฆ

jovial warren
#

any idea why that might cause overload issues?

#

the second one is complaining about that function both overloading itself and its super

unkempt tangle
#
2. Write down the bullet points of a relational database model and explain them in your own words!
-Data has always be convertable to tables
-A relational database model requires at least three operators RESTRICT, PROJECT and JOIN
-A user must be able to manipulate data, which are in form of a table.
-The integrity condition must be fullfilled.
prisma wave
#

0 advantages

#

json file is more modern

#

or graphql

unkempt tangle
#

๐Ÿ˜ญ

prisma wave
#

many nosql databases are using graphql nowadays because it is much more useful!

unkempt tangle
#

3. What is a primary key and which important property should it have?

#

Uniqueness

prisma wave
#

yes

unkempt tangle
#

The primary key allow to "find" the table?

#

Or

jovial warren
#

@frigid badge yeah this ain't gonna work

#

the way kotlinx.serialization is designed is the flaw

unkempt tangle
#

The uniqueness allows to seperate different datasets with each other.

prisma wave
#

typically bad designed kotlin libraries

#

only work for 1 possible use case and then ALL falls apart

jovial warren
#

I need to provide a serial descriptor, which tells the compiler what methods I'll be calling

#

without an instance of Component

#

I think the fact I have to accept is that what I'm trying to do is literally impossible

#

which is a fucking pain in the ass, because it leaves me with two options:

  1. serialise and deserialise JSON using plain text strings
  2. use a different serialisation library
unkempt tangle
#

4. Explain in your own words what is meant with โ€žIrreducibility or minimalism in relation to the uniquenessโ€ and make me an example.

#

What is meant with irreducibility and minimalism ;c

jovial warren
#

I know someone who can answer that

#

his name's Google

unkempt tangle
#

Google

#

I know it

#

But I have Senpai

jovial warren
#

yeah, no

#

nobody's gonna do your homework for you

frigid badge
#

there must be a way of making it work

#

and this must've been an issue for more people

jovial warren
frigid badge
#

I'm working rn so I can't

jovial warren
#

big oof

frigid badge
#

writing some quality php

#

๐Ÿ˜ข

jovial warren
unkempt tangle
#

quality and php in the same sentence

jovial warren
#

anyone else wanna take a look at this and see if they can figure it out?

unkempt tangle
#

Best buddies

jovial warren
#

someone pls help

#

also, kotlinx.serialization has polymorphic serialisation, but it adds a fucking "type" key that you cannot remove

#

actually not true

#

OMFG NO WAY

#

jesus fucking christ it works

half harness
ocean quartz
#

What?

half harness
#

basically

#

if I start a task

#

configuration*

#

and the same configuration is already running

#

i want to terminate the old one

prisma wave
half harness
#

enable it?

#

bc its disabled

prisma wave
#

disable it

#

then how are you running 2 at the same time

half harness
#

I don't know

#

it terminated fine yesterday

#

but today it makes multiple

surreal quarry
#

im pretty sure mines always made multiple things if i do it twice

#

just terminate it yourself its like 2 clicks lol

half harness
#

but it gets annoying when I run it every 2 seconds

#

or 3 seconds

surreal quarry
#

oh you're actually running the program

half harness
#

yes

surreal quarry
#

not like building a jar?

#

damn

half harness
#

nope

surreal quarry
#

it shouldn't run 2 at the same time lol

half harness
#

๐Ÿ˜ซ

surreal quarry
#

delete the configuration and make it again?

half harness
#

okay

surreal quarry
#

or enable parallel run and then disable it

half harness
#

nope none works

#

actually

#

lol

surreal quarry
#

just do that then

half harness
#

k

unkempt tangle
#

He says "{Firstname, Lastname} is also unique:"

#

But they aren't unique.

#

Their datasets can have duplicates.

#

As he have shown in his example

distant sun
#

any idea if it is possible to send notifications to discord from a github repository you don't own when a release is being posted?

unkempt tangle
#

pretty sure with bots

#

There are plenty of servers where they post each commits for example.

half harness
#

those use webhooks

#

and the github repo owner has perms to create webhooks

#

but if you don't own it, you can't create the webhooks

#

unless ur talking about some discord bot

#

that idk about

distant sun
#

guess I will use the api

half harness
#

fixed ๐Ÿ˜ค

unkempt tangle
#

If you speak of cardinality?

#

What is it

#

DB

static zealot
surreal quarry
#

lmfao

prisma wave
#

lmao

#

added

surreal quarry
#

where is this collection

distant sun
#

45 lol

static zealot
#

xD

surreal quarry
#

damn lol

distant sun
static zealot
#

I bet that dude is going to leave a bad review on spigot now

#

and is going to switch to ChestCommands or other shitty plugin

#

xD

surreal quarry
#

over/under on how long it takes him?

#

to leave a review

distant sun
#

What did you do to get bannes from that server bm lol

prisma wave
#

talked about kotlin ๐Ÿคฃ

#

i think

#

something like that

static zealot
#

wait what discord server?

distant sun
#

Nbt api and other stuff

stuck harbor
#

lol

static zealot
#

oh that was a showcase xD

#

I've missed it

surreal quarry
#

Lmao Niall's smart casting

static zealot
surreal quarry
#

lol the investor request-paid

prisma wave
#

niall's showcase posts are the best

static zealot
#

I have to unfortunately agree

surreal quarry
prisma wave
#

lmao

jovial warren
#

anyone wanna see some hacks.exe?

surreal quarry
jovial warren
#

what I did there was probably the easiest way of doing that lol

half harness
#

uhh is it normal that intellij stops responding when pasting 311.1k lines of text?

#

xD

surreal quarry
#

probably

half harness
#

ok

surreal quarry
#

why do you have 311k lines

half harness
#

lol

ocean quartz
half harness
#

๐Ÿ‘€

#

ok

stuck harbor
#

Material.URMUM

half harness
#

material enum is only 8k lines

hot hull
#

iwanio, be gone

stuck harbor
#

ah

old wyvern
#

Why do you have 311.1k lines of text

stuck harbor
#

I wanna learn clojure so I get a headache

prisma wave
#

clojure is easy

#

mostly

#

bit of a pain to debug

stuck harbor
#

what ide tho

prisma wave
#

any is fine

stuck harbor
#

any?

prisma wave
#

i've used IJ, vsc or vim before

#

you barely need an IDE

stuck harbor
#

uhhmmmmmm

#

powershell ise

#

sublime text 2

jovial warren
#

is the Material enum actually 8k lines?

#

is there really that many materials?

#

I suppose with the legacy materials there is

prisma wave
#

vim for clojure is actually pretty nice

old wyvern
#

Ah yes

stuck harbor
#

yeet

old wyvern
#

found my issue

#

import Control.Monad.IO.Class
needed this import

prisma wave
#

๐Ÿฅฒ

old wyvern
#

๐Ÿฅฒ

prisma wave
#

it's always an import

#

i had the same problem in f# a while ago

old wyvern
#

IJ saved me

prisma wave
#

so many errors just because of a missing import

old wyvern
#

The auto generated type signature had it

#

xD

prisma wave
#

Lmao nice

half harness
#

time to paste 1.5million lines - don't ask why - but brister mitten knows though

#

lol

half harness
#

or look on the github

#

i pushed it

surreal quarry
#

link it

half harness
#

And yes, I googled

#

but i dont understand what to do

surreal quarry
#

wouldn't it be more effective to maybe use some sort of dictionary api

half harness
#

๐Ÿคท

#

maybe

surreal quarry
#

instead of searching through millions of lines of text

half harness
#

maybe later - but I really need this error to be fixed ๐Ÿ˜ฆ

whole mica
#

anyone know where I can find an example gui menu to learn from?

surreal quarry
#

wdym

#

like for a specific gui library, just guis in general?

round relic
#

heyo

whole mica
#

just a gui that opens up multiple guis from clicking on an item within the initial gui.

round relic
#

i got a question

surreal quarry
whole mica
#

ah okay, appreciate it thanks James

round relic
#

I use supervanish on my server, and I was wondering what the placeholder was for players that are online excluding vanished players

surreal quarry
#

otherwise you will need to make guis manually, use the raw inventory click event, etc

round relic
#

OK

surreal quarry
#

@round relic

round relic
#

yeah

#

oh

surreal quarry
#

sorry lol

round relic
#

thanks

#

that link is redirecting me to like 15 different sites

jovial warren
#

it's meant to

#

BM uses it when people ask for help in the wrong channel

round relic
#

bruh

ocean quartz
#

People already told them lol

round relic
#

i legit thought he was tryina help

jovial warren
#

this is dev general

#

this channel is full of developers that like messing with each other and circlejerking

#

you won't get help here

#

I'm putting Komponent on central ๐Ÿ™‚

#

first thing I've ever put on central

lunar cypress
#

F for bintray

jovial warren
#

imagine using bintray over central

#

imagine

lunar cypress
#

it used to be superior

jovial warren
#

not any more lol

#

how long does it usually take to get deployer btw?

whole mica
#

trying to learn to build gui's woth no fore knowledge of programming is so complicated

jovial warren
#

this is why you learn how to program before start trying to program

#

as they say, "you gotta learn to walk before you can run"

whole mica
#

I dont need to learn aside from using it for mc lol

jovial warren
#

you should still learn fundamentals

#

?learn-java

compact perchBOT
#
FAQ Answer:

Oracle Docs:
You should start with this, breeze through this(skipping stuff that doesn't seem relevant like bitwise operators), then hit this.
They're the first three from this larger thing which you should definitely go through overall. But those three should be enough for slightly better understanding of what is happening here without feeling like a huge time sink.
That one is a small part of this larger site wherein "Essential Java Classes" and "Collections" also have good useful stuff

Online Courses:
If you want some free online courses, you can find them on Coursera. Yes they are paid but you can chose to take them for free with the only disadvantage being the fact that you don't get a certificate at the end. Some of the best courses can be found Here.
You can also take a look at Udemy but from what I've seen most of those courses are paid.

Other services:
Some other cool services that will help you learn java are SoloLearn and JetBrains Academy.

As you can see there are plenty of good ways to learn as long as you're willing to invest the time. Have fun learning!

whole mica
#

or even, ive no use for it

jovial warren
#

you should learn the fundamentals before trying to use something like the Spigot API

whole mica
#

aight

jovial warren
lunar cypress
jovial warren
#

it's where I learnt

#

the course is only about ยฃ15 now (I think), and it teaches you literally everything you need to know about Java

whole mica
#

I need it for my server, in need of an instructions gui menu

jovial warren
#

if you don't have the money to go for a paid course, that FAQ message has lots of other options

whole mica
#

thanks. appreciate it

jovial warren
#

yw

prisma wave
jovial warren
#

oh stop trying to pull the wool over the guy's eyes

#

he's gone now

#

it's done

prisma wave
#

ok it is a bit true

#

But I think it's perfectly reasonable

ripe sandal
#

yes.. i did all steps.. and also have the pre-requierements.. but still not working.. '-

jovial warren
#

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

#

just kinda worked for me (Windows CLI is a pain in the fucking ass)

prisma wave
#

can you elaborate a bit

#

what's the issue

jovial warren
#

scroll up BM

#

you should know that lol

#

or at least, have a good idea of it

prisma wave
#

@ripe sandal send a screenshot of your PATH

#

and where you've installed it

onyx loom
#

i feel like efe's gf is actually this discord server instead

#

wait no that dont make sense

#

i meant hes asking us everything for his gf ๐Ÿฅฒ

jovial warren
#

maybe efe is a bad bf

#

I don't like to comment on others' relationships, since that's their business, not mine, but ya know

prisma wave
#

i would pay a lot of money for a gf who is the benevolent dictator for life of clojure

#

and by that i mean a gf who is rich hickey

#

and by that i mean rich hickey

jovial warren
#

sighs

#

when are you ever gonna be serious BM

#

lol

prisma wave
#

im being perfectly serious

jovial warren
#

my ass

prisma wave
#

thats not very serious

jovial warren
#

it isn't

lunar cypress
#

based and hickeypilled

jovial warren
#

what?

prisma wave
#

WOAH MAMA ๐Ÿ˜

jovial warren
#

who is that

#

ah, Rich Hickey

prisma wave
#

damn girl u wanna criticise the pitfalls of object oriented programming with me???

ripe sandal
onyx loom
jovial warren
prisma wave
#

sadly this woman exists only in our imagination

#

but i have hope

onyx loom
#

im sure she exists

#

dw

#

one dayโ„ข๏ธ

jovial warren
#

behave yourself BM

#

god damn it

prisma wave
#

well hello there my darling

lunar cypress
#

jesus

onyx loom
#

๐Ÿ˜‚

prisma wave
#

ur looking pretty pure

jovial warren
#

what is that

prisma wave
#

if u know what i mean

onyx loom
#

haskell founder hahahahaha

jovial warren
#

BM behave yourself

prisma wave
#

i am

old wyvern
#

Oh God

#

Im gonna have nightmares of that thing

prisma wave
#

simone peyton-jones ๐Ÿ˜

old wyvern
#

Meanwhile, his language still torments me

jovial warren
lunar cypress
#

PainsChamp

ripe sandal
prisma wave
#

what a great song

prisma wave
#

considering we are currently turning founders of functional programming languages into women

lunar cypress
#

"we"

jovial warren
prisma wave
#

"""we"""

#

ur all part of this

jovial warren
#

no mutation

#

no classes

prisma wave
#

whether you like it or not

old wyvern
#

Female bm coming up?

jovial warren
#

no objects

old wyvern
#

๐Ÿ’€

jovial warren
#

how can you have a language without mutation?

prisma wave
old wyvern
prisma wave
#

mutation awful

jovial warren
#

mutation is useful in some cases

#

not useful in others

hot hull
old wyvern
#

Im sorry to break your bubble but mutation bad

prisma wave
#

imperative fan gets redpilled

jovial warren
#

like if you want a counter, what you gonna do? make a copy of it every time you increment it?

prisma wave
#

hahahahahaahahahaah

#

just use recursion bro

old wyvern
#

^

lunar cypress
#

how have you missed the past year (?) in this channel

prisma wave
#

lmao

old wyvern
#

xD

ripe sandal
jovial warren
#

literally

#

I've seen that before

ripe sandal
jovial warren
#

I love the guy's reaction though

#

"what in the name of fuck"

old wyvern
hot hull
#

It's the only appropriate reaction

prisma wave
jovial warren
#

you can imagine him just sitting there at his computer, just browsing pull requests, and he stumbles across that

prisma wave
#

it won't update on the same terminal

old wyvern
#

refreshenv

prisma wave
#

or that

#

also make sure C:\Program Files\Maven\bin\mvn.exe actually exists

#

you might have downloaded the wrong thing or something

unkempt tangle
#

How would I use random selection in db?

prisma wave
#

import random
random.choice

unkempt tangle
#

its not python

prisma wave
#

idk

#

bit of a vague question

heady birch
#

RANDOM keyword in sql

unkempt tangle
#
UPDATE person
HALF
SET company_name = CONCAT(nnam, ' GmbH')
OTHER HALF
SET company_name = CONCAT(nnam, ' AG')
#

how ;c

jovial warren
#

there's more

hot hull
#

Dedicate a random amount of ram, then clog the memory, when it crashes, the object number is your random number

unkempt tangle
#

That escalated far too quickly

hot hull
#

Same person Bardy kek

old wyvern
#

Could a magnet of enough strength manipulate data on a computer?

#

If so..... Magnetic Programming When?

ripe sandal
prisma wave
#

๐Ÿ˜ฎ

old wyvern
#

Try deleting system32

#

๐Ÿฅฒ

heady birch
#

bruno Mars

prisma wave
#

consider using a more modern build tool such as cabal or cargo

static zealot
ripe sandal
# prisma wave ^

hmm.. ๐Ÿค”
all the files into \bin have no extension.. should be this the problems? 0-o'

heady birch
prisma wave
#

you might have installed the linux version accidentally

#

idk

prisma wave
old wyvern
heady birch
old wyvern
prisma wave
#

0 errors in console

#

nice

#

f# makes runtime exceptions impossible!!

#

although on the other hand it's not logging any requests

ripe sandal
static zealot
prisma wave
#

yeah i just checked too, that's fine

static zealot
#

love it

heady birch
prisma wave
#

nice

static zealot
old wyvern
prisma wave
#

good question

static zealot
#

this wiki is broken

#

please fix developer

#

why do I pay you for?

prisma wave
#

oh because it's not a valid url

#

the nginx proxy doesnt let it through

ocean quartz
#

Can't even click on it

prisma wave
#

yeah

static zealot
#

lmao

#

putting % in it just breaks it

#

lmao

prisma wave
#

yeah cuz it's an invalid url

static zealot
#

why is it an invalid url? can't urls contain % ?

prisma wave
#

% is for an url escape, yeah

#

it's like \ in a java string

static zealot
#

ahh

#

lmaoo

#

it was an helpchat link ...

prisma wave
#

what was that lol

static zealot
#

smh

prisma wave
#

๐Ÿฅฒ

static zealot
prisma wave
#

mine is better

static zealot
#

๐Ÿ˜ฆ

#

wait

#

it didn't remove the link tho

#

or is discord broken again?

#

sometimes it deletes the message but I can still see, click, copy etc.

jovial warren
#

anyone here got experience publishing to OSSRH? I can't seem to get it to work

#

lemme give you my build

#

don't get what I've done wrong there

#

actually maybe distributing my public key might be a good idea

hot hull
#

What's that? Some alternative to ussr?

surreal quarry
#

Yes

#

exactly

jovial warren
#

nope, didn't seem to work

#

OSSRH is how you get your stuff on central

surreal quarry
#

bardy theres like a lot of requirements you need to meet to actually post it, check your build output or i think theres even something in your panel if you log in showing you what you are missing

static zealot
surreal quarry
static zealot
#

haha

#

haha

#

you got me ||not||

#

xD

jovial warren
#

where's my "panel" James?

surreal quarry
jovial warren
#

yeah I'm logged in

#

idk where the panel is though

surreal quarry
#

its been a while since i did it

lunar cypress
#

remember just a few hours ago when you praised central PepeLaugh

surreal quarry
#

lol

jovial warren
#

it's a pain in the ass

lunar cypress
#

yes it is

jovial warren
#

how can I include javadocs? lol

surreal quarry
distant sun
#

how does one create a logging system where for each session the file name has a different id? Like 16/02/2021-5.log

surreal quarry
ocean quartz
#

Central gave me so much headache i stopped using it

surreal quarry
#

yea central is a pain

onyx loom
#

im sorry to hear that

surreal quarry
lunar cypress
#

shame that java doesn't have something like clojars or crates.io

#

or maybe it does but it's probably not very popular

ocean quartz
#

I just host my own jfrog artifactory, pretty simple to setup

jovial warren
#

I just keep getting 401's

#

wtf

onyx loom
#

u ask bm very nicely to host ur project on the repo for u