#dev-general

1 messages · Page 293 of 1

hot hull
#

never used gson properly before

quiet depot
#

time to learn

static zealot
#

o

quiet depot
#

give me an example chunk populator in json

hot hull
#

Pretty bare bones rn

{
  "plains": {
    "tree-variations": [
      "t001.schematic",
      "t002.schematic",
      "t003.schematic",
      "t004.schematic"
    ]
  }
}
quiet depot
#

"plains" is this a dynamic name, or does it refer to something like an enum?

hot hull
#

It refers to the biome name

quiet depot
#

doesn't answer my question

#

is it dynamic or does it refer to a fixed value

hot hull
#

So yes an enum

quiet depot
#

ok

#

are you using worldedit for schematics?

hot hull
#

Not using anything yet, just have it as a base

quiet depot
#

ok well

hot hull
#

Not sure what's better kek

quiet depot
#

first step would be to create an object

#

like

hot hull
#

Need to fix my damn wildcards smh

quiet depot
#

ok

#

make this class

#
public final class BiomePopulator {
    private Set<File> treeVariations;

    public Set<File> getTreeVariations() {
        return treeVariations;
    }
}```
#

then have a Map<Biome, BiomePopulator>

#

instead of your map<biome, list>

#

have you added gson to the project yet?

hot hull
#

I have not no

quiet depot
#

'com.google.code.gson:gson:4.2.3'

#

wait no 4.2.3 is the latest guice version

#

just figure out what the latest ver is via +

#

gson might be 4.2.7

hot hull
#

Yea was gonna say

quiet depot
#

just guessing

#

nope

#

2.8.6

#

i couldn't be more off

hot hull
#

Yeye I checked myself

quiet depot
#

ok, once it's added

#

add this annotation to the treeVariations field in the BiomePopulator

#
@JsonAdapter(TreeVariationsDeserializer.class)```
hot hull
#

Gimme a tad, need to figure out the proper structure so it doesn't become a mess instantly

quiet depot
#

then create a new class called that

#

I'm doing the structure for you

hot hull
#

well yesn't

quiet depot
#

oh you meant packages?

hot hull
#

yea

quiet depot
#

okie

#

do you ever save a json file?

#

or just load it

hot hull
#

I save it yea

#

Well save as in copy it

#

It's not modifiable when the plugin is running if that's what you're asking

quiet depot
#

here's what I use:
saving: serializers
loading: deserializers
saving & loading: adapters

#

you'll want to go with adapters

#

that's where you create your TreeVariationsAdapter.class (which is renamed from TreeVariationsDeserializer.class)

hot hull
#

Okay yea I'll restructure this later properly

quiet depot
#

right so have you created the 2 classes?

#

the adapter and biome populator?

hot hull
#

yup

quiet depot
#

in the adapter, implement

#
JsonSerializer<Set<File>>, JsonDeserializer<Set<File>>```
hot hull
#

Okay

quiet depot
#

yeah implement the methods

hot hull
#

Oh bruh I'm dumb

#

I missread that completely lol

quiet depot
#

have a constant

#
private static final Type TYPE = new TypeToken<Set<String>>>() {}.getType();```
#

might be too many >

hot hull
#

Indeed

quiet depot
#

if you had guice you could just Types.setOf(String.class);

hot hull
#

One day you'll convince me

quiet depot
#

in your deserialize method, we want to convert your json element into a set file

#

to do that, we first need to convert it to a set string

#

and we do that via the json deserialization context

#

context.deserialize(jsonelement, TYPE)

#

that'll return a Set<String>

hot hull
#

mhm

quiet depot
#

if you can't convert that set string into a set file yourself you need help

#

so do that

#

and tell me when you're done

hot hull
#

Already did it

quiet depot
#

good

hot hull
#

lol

quiet depot
#

now onto the serialization

#

convert your set file into a set string

#

then pass it into the context.serialize

#

you don't need to provide the type this time

#

to do so is redundant

#

although you can if you want

hot hull
#

I'll just provide the type

quiet depot
#

k

#

aight so that class should be finished now

#

in your tree populator class, we need a gson instance

hot hull
#

Any specific settings?

quiet depot
#
private static final Gson GSON = new GsonBuilder()
        .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_DASHES)
        .create();```
hot hull
#

mhm

quiet depot
#

getParsedChunkPopulatorFile() show me this method

hot hull
#
    @Nullable
    public JSONObject getParsedChunkPopulatorFile() {
        final JSONParser parser = new JSONParser();

        try {
            return (JSONObject) parser.parse(new FileReader(getChunkPopulatorFile().getPath()));
        } catch (final ParseException | IOException ignored) {
            return null;
        }
    }
quiet depot
#

that file reader is auto closeable btw and should be in a try with resources

#

actually parse might close it

#

¯_(ツ)_/¯

#

anyway

#

maybe move the gson instance to the class with that method

#

then just go

obtuse gale
#

thow does one make an image fit in a div

#

and make it centred

quiet depot
obtuse gale
#

o yeah

quiet depot
#

GSON.fromJson(reader, new TypeToken<Map<Biome, BiomePopulator>>() {}.getType())

hot hull
#

position: center iirc

quiet depot
#

that'll return a map

#

so ur returning a map instead of a JSONObject

#

d;gson gson#fromjson(reader, type)

ruby craterBOT
#
public <T> T fromJson(java.io.Reader json, java.lang.reflect.Type typeOfT)
throws JsonSyntaxException, JsonIOException```
Description:

This method deserializes the Json read from the specified reader into an object of the specified type. This method is useful if the specified object is a generic type. For non-generic objects, use fromJson(Reader, Class) instead. If you have the Json in a String form instead of a Reader, use fromJson(String, Type) instead.

Parameters:

typeOfT - The specific genericized type of src. You can obtain this type by using the TypeToken class. For example, to get the type for Collection<Foo>, you should use: Type typeOfT = new TypeToken<Collection<Foo>>(){}.getType();
json - the reader producing Json from which the object is to be deserialized

Throws:

JsonSyntaxException - if json is not a valid representation for an object of type
JsonIOException - if there was a problem reading from the Reader

Returns:

an object of type T from the json. Returns null if json is at EOF.

quiet depot
#

okie cool so you can provide a reader there

#

wasn't 100% sure

#

and it doesn't say if it closes or not so you should definitely put the reader in a try with resources

hot hull
#

Okay did that

quiet depot
#

try it out

#

actually

#

still won't quite work

#

the issue is now that gson doesn't convert your string to upper case for enum serialization

#

and since you're using a map instead of a proper object, we have to create an adapter for the whole map, not just the enum (afaik, although you could try just the enum if you want)

#

so

#

d;gson gsonbuilder#registertypeadapter(adapter, type)

ruby craterBOT
#
public GsonBuilder registerTypeAdapter(java.lang.reflect.Type type, java.lang.Object typeAdapter)```
Description:

Configures Gson for custom serialization or deserialization. This method combines the registration of an TypeAdapter, InstanceCreator, JsonSerializer, and a JsonDeserializer. It is best used when a single object typeAdapter implements all the required interfaces for custom serialization with Gson. If a type adapter was previously registered for the specified type, it is overwritten.

This registers the type specified and no other types: you must manually register related types! For example, applications registering boolean.class should also register Boolean.class.

Parameters:

typeAdapter - This object must implement at least one of the TypeAdapter, InstanceCreator, JsonSerializer, and a JsonDeserializer interfaces.
type - the type definition for the type adapter being registered

Returns:

a reference to this GsonBuilder object to fulfill the "Builder" pattern

quiet depot
#

use that method in the builder

#

type is the same type you're providing in GSON.fromJson

#

for the type adapter

#

make a new class called

#

MapThingyAdapter

#

idk think of a better name for it

#

PopulatorsAdapter perhaps

#

implement json serializer & deserializer again, with Map<Biome, BiomePopulator>

#

have a constant type for

#

Map<String, BiomePopulator>

#

go through map and convert the key string to Biome

hot hull
#

k

quiet depot
#

idk if you're still learning streams but here's a little stream for it

hot hull
#

I mean I'm pretty familiar with streams If i do say so myself

quiet depot
#
map.entrySet().stream()
        .collect(Collectors.toMap(entry -> Biome.valueOf(entry.getKey().toUpperCase()), Map.Entry::getValue));```
hot hull
#

Yikes Piggy, why u use this

Biome.valueOf

quiet depot
#

?

#

what's wrong with that

hot hull
#

exception if it's not a valid one

quiet depot
#

then use something else

#

usually I have an immutable map in my enums

#

Map<String, Enum> NAMES

#

and I just use that

#

d;info

ruby craterBOT
#
DocDex | Info

Website | Github | Invite

DocDex (Documentation Index) is a bot developed using JDA and Java 11, which can display information on javadoc objects, from a fuzzy query.

Servers

20 (34,773 Users)

Javadocs

93 (Default: jdk)

#
@CheckReturnValue @Nonnull
AuditableRestAction<Emote> createEmote(@Nonnull String name, @Nonnull Icon icon, @Nonnull Role... roles)
throws InsufficientPermissionException```
Description:

Creates a new Emote in this Guild.
If one or more Roles are specified the new Emote will only be available to Members with any of the specified Roles (see Member.canInteract(Emote))
For this to be successful, the logged in account has to have the MANAGE_EMOTES Permission.

++Unicode emojis are not included as Emote!++

Note that a guild is limited to 50 normal and 50 animated emotes by default. Some guilds are able to add additional emotes beyond this limitation due to the MORE_EMOJI feature (see Guild.getFeatures()).
Due to simplicity we do not check for these limits.

Possible ErrorResponses caused by the...

This description has been shortened as it was too long.

Parameters:

roles - The Roles the new Emote should be restricted to If no roles are provided the Emote will be available to all Members of this Guild
name - The name for the new Emote
icon - The Icon for the new Emote

Throws:

InsufficientPermissionException - If the logged in account does not have the MANAGE_EMOTES Permission

Returns:

AuditableRestAction - Type: Emote

quiet depot
#

do you mean add new emotes to the server, or add an emote to a message?

#

do you have a file for the pic

#

what do u have

#

oh well

#

get the link of the emote

#

do u know how to do that

#

cool

#

open an input stream to the url

#

URL#openStream

#

new URL(string)

#

then with the input stream

#

Icon.from(stream)

#

and pass that icon to the add emote method

#

if something doesn't work

#

feels bad

#

¯_(ツ)_/¯

#

ask in the jda discord efe

blazing walrus
#

Smh

hot hull
#

Noice java.lang.StackOverflowError: null

jovial warren
#

someone name me everything bad about the bukkit scheduler please

#

xD

distant sun
#

bukkit scheduler

steel heart
#

Not that optimized

#

Does not implement Executor

#

So can’t be used for CompletableFuture

#

Unless you wrap it

#

Which is horrific

glad schooner
#

do you guys think you can help me generate a new dimension like the aether, https://www.spigotmc.org/resources/aether-generator.65845/ (or help me with this one's configuration) so I can have custom biomes and structures in it? -this plugin already support replaceable schematics but i can't figure them out for some reason.

prisma wave
jovial warren
#

yeah it's not that bad

quiet depot
#

anyone know why I have so much unused memory? Let me know if you need more details, not sure what I need to provide for this problem, out of my league here

#

calling gc manually doesn't help

#

could calling gc manually be the cause of this?

#

just realised that popup covers some numbers

#

better pic

prisma wave
#

what's wrong with unused memory?

quiet depot
#

it'll never be used in this app

#

once everything is loaded, that's it

#

nothing new will ever be loaded

#

actually that's not true sorry

#

but it'll definitely never need 6.4gb

#

-XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30 adding these flags helped

#

usage is down to 2.5gb, which is far more acceptable

prisma wave
#

ok lol

#

not sure I could've helped much there

oak coyote
#

@quiet depot what’s your entire start script?

quiet depot
#

this is it atm
-agentpath:/opt/yourkit/YourKit-JavaProfiler-2020.9/bin/linux-x86-64/libyjpagent.so=disablestacktelemetry,exceptions=disable,delay=10000 -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=15 -Xms128M -Xmx8G

#

well those are the args

oak coyote
#

Lower a Xmx

old wyvern
#

Any idea how to efficiently group pairs?

quiet depot
#

nah

#

the program needs a high amount of ram during iniitalization

#

after that though, it goes down

old wyvern
#

like

1 2
2 3
1 3

Those would be 1 group
1 2 3

oak coyote
#

Ahh okay

quiet depot
#

I'm getting good results with these args anyway

#

not noticing any speed differences, but I'm only using 2gb now

#

so that's a pro and a pro

oak coyote
#

Yeah you can’t prevent it’s allocation if you need it initially

quiet depot
#

because I read these flags would slow it down

empty flint
#

Before I go implementing it, I have a quick question:

#

I have a class that has 6 independent boolean flags

#

would it be more performant to use a single number and binary representation for the flags or should I go with 6 booleans?

old wyvern
#

uh there would be many groups tho

#

for eg:

1 3
2 3
1 2
6 9
5 4
5 7
8 9

would reduce to

1 2 3
4 5 7
6 8 9
prisma wave
quiet depot
#

so yugi do you also need to order them?

oak coyote
#

Yeah that’s insignificant performance you are talking about @empty flint

old wyvern
#

Order doesnt matter, just the grouping

oak coyote
#

Booleans make it easier for you to understand so that is the better choice

#

Especially due to them being loaded into memory

empty flint
#

right, what kind of performance difference are we talking?

quiet depot
#

distinct would be fine yugi

old wyvern
#

but distinct wont result in the different groups tho

quiet depot
#

Lists.partition

empty flint
#

The thing is that I don't expect to ever touch the code again once it's done, the class is getting an abstraction layer on top towards the user anyhow so it doesn't matter in terms of "understandability"

old wyvern
#

cant do that piggy
the groups are defined by each pair, so like if a and b is a pair, a and b must be in the same group

quiet depot
#

ohh

#

ok

#

i didn't understand before

old wyvern
#

ah

quiet depot
#
final Map<Integer, Set<Integer>> ints = new HashMap<>();

for (Pair<Integer, Integer> pair : pairs) {
    final int i1 = pair.one();
    final int i2 = pair.two();

    final Set<Integer> group1 = ints.get(i1);

    if (group1 != null) {
        group1.put(i2);
        continue;
    }

    final Set<Integer> group2 = ints.get(i2);

    if (group2 != null) {
        group2.put(i1);
        continue;
    }

    final Set<Integer> addendum = new HashSet<>();
    addendum.add(i1);
    addendum.add(i2);
    ints.put(i1, addendum);
    ints.put(i2, addendum);
}```
#

untested

#

might work

#

might not

oak coyote
#

Basically 0 @empty flint

quiet depot
#

try it out

#

@old wyvern

old wyvern
#

o.o
Alrighty

quiet depot
#

to get the groups, ints.values()

#

the map keys are useless for the end result

#

you only want the values

old wyvern
#

mhm

quiet depot
#

if performance is necessary for this application, use a primitive map & set impl

old wyvern
#

Alrighty

#

testing 1 min

hot hull
old wyvern
#

IntelliJ at it once again with its pipe broken exception 🥲

quiet depot
#

lol

#

show me

old wyvern
#

Yup works

#

Seems to have some duplication but that shouldnt matter for the final result

obtuse gale
old wyvern
#

Thanks a lot piggy 🙂

hot hull
#

No we rn Fefo

quiet depot
#

oh yeah duplication will happen

#

sorry

obtuse gale
#

The dirt patches do be looking good (if the stone was sand or something lol)

hot hull
#

I need to take a different approach for this

old wyvern
quiet depot
#

technically those sets are the exact same

#

like same actual object in memory

old wyvern
#

Ahh

quiet depot
#

just wrap .values() into a hashset

old wyvern
#

Alrighty

#

Now to find a primitive hashmap implementation

quiet depot
#

there's so many

#

not just hashmap

#

hashset too

old wyvern
#

o.o

prisma wave
#

the only time it might make a difference is if you had a lot of objects

#

in which case the bitmask would be more memory efficient

remote goblet
obtuse gale
#

Pog

hot hull
quiet depot
#

oof finally

#

found the comparisons

obtuse gale
quiet depot
#

fastutil and trove have primitive impls

#

not sure about the rest

#

do your research

#

and tell me which ever one you end up on

#

and then also tell me if the one you end up on has support for custom hashing techniques on their hashsets/hashmaps, because I'm using trove

#

and trove obviously aint it according to those graphs

hot hull
#

I need to handle biome type setting myself, then it's gonna look neat

forest pecan
#

☠️

hot hull
#

Yes

empty flint
#

How would one implement a system of settings where there is a basic set of global settings, a set of user group settings and a set of user settings that are getting progressively more important. So user settings override user group settings which override global settings. Should each of those be implemented as their own objects and kept track of separately? How would one change the user settings if global settings change and the user hasn't made specific changes themselves?

quiet depot
#

simply initialize the user object with the default values

#

and override them with the user values

empty flint
#

so say you have settings A, B and C, the user overrides setting A, but then the global setting B changes its value. That change should propagate

empty flint
# quiet depot and override them with the user values

sure but what if the defaults change? How would I propagate that change? I'd have to keep track of every single instance of settings and I potentially have thousands of them, depending on the number of user groups and users.

quiet depot
#

have a global default object

#

e.g.

frigid badge
#

the user wouldn't like it if you suddenly change his settings though

empty flint
frigid badge
#

then why do you have user settings

#

if the user has no say of his settings then why would it matter to have defaults

#

since they can't be changed

#

I don't think I'm totally understanding you

empty flint
#

So there's kind of a blueprint to follow but if the user wants a specific thing to be different, that overrides the blueprint

frigid badge
#

but what if he follows the default blueprint because he likes the default one

#

and you change it

quiet depot
#
public final class Settings {
    public static final Settings DEFAULT_SETTINGS = new Settings(true);

    private Boolean likesCake;    

    public Settings(@Nullable Boolean likesCake) {
        this.likesCake = likesCake;
    }

    public boolean likesCake() {
        return likesCakes == null ? SETTINGS.likesCake() : likesCake;
    }

    public void setLikesCake(boolean value) {
        likesCake = value;
    }
}```
#

idk just an example

#

probs not perfect

empty flint
frigid badge
#

fair enough

empty flint
#

The thing is there's more than 2 layers

#

it's not just global/user

#

it's more like global -> user group -> user subgroup -> user

quiet depot
#

well

#

have fun with that

empty flint
#

so there'd have to be 4 different null comparisons to find the first one which isn't null

frigid badge
#

you should probably look at this from a database standpoint and not code wise

empty flint
#

That's why I asked here

#

I'd prefer a way to have the value in O(1) time

frigid badge
#

start with a prototype instead of already trying to figure out the best thing

#

start with a simple database diagram

empty flint
#

I have a complex one already xD

quiet depot
#

my head hurts too

empty flint
#

the database thing works, it's just the implementation that I'm worried about because it can't take too long

quiet depot
#

i've written 4.7K words of documentation today

#

and i'm only half done

#

scrap that probably like a 10th

#

this is just a wiki

#

still gotta write actual javadocs

frigid badge
#

start with a basic implementation and only improve if it's necessary

empty flint
#

what the fuck for? 4.7k is like 4.6k more than I'd read on any given occasion xD

quiet depot
#

looks good

#

means people know I can write documentation

#

something to show off to employers

empty flint
#

I think I have an idea, please tell me if I'm stupid or not, @frigid badge

One table that holds the global settings.
Another table holds a reference to the global settings with the same settings columns, plus an additional column defining if the specific settings are for user group or user settings etc.
If the default settings get overruled by the user or group, the value is not null. If it's null, the default settings get applied.

heady birch
#

Setting(id, name)
SettingValue(id, setting_id, user_id, value) idk.

frigid badge
obtuse gale
heady birch
#

Perhaps? I mean, it you wanted it type safe maybe just one big table, depending how many settings you have

ocean quartz
#

Niall that website has dark theme

heady birch
#

well I do not know how to change it take your comments elsewhere 🙂

#

lol

prisma wave
#

lol

heady birch
#

@frigid badge You wanted diagram?

#

Oh I just realised what I've made doesnt include groups or such as blocky wanted

steel heart
#

Bruh IntelliJ the "expert" ide fails me once again

half harness
#

except that invaliding caches fixed it 😄

steel heart
#

yes now it hanged up indexing jdk like 20 times

#

fun

quiet depot
#

everybody be having intellij issues recently

#

lucky me

steel heart
#

bruh ima use eclipse srsly

quiet depot
#

i haven't had any

#

feels bad for u guys

steel heart
#

what version r u on piggy?

quiet depot
#

latest

half harness
quiet depot
#

ij ultimate 2020.3.2

#

that might be the difference

half harness
quiet depot
#

u guys using ultimate?

half harness
#

thx again for showing me the github student dev pack xD

steel heart
#

ye

quiet depot
#

dkim in case you haven't noticed already, you can get a free domain from the pack

#

well, 3 free domains

steel heart
#

wait oo

heady birch
#

No need for ultimate when eclipse exists

quiet depot
quiet depot
#

discounted on the following years

half harness
#

and I don't want to pay for a domain i wont use :p

quiet depot
#

ah

ocean quartz
#

.me is very cheap

quiet depot
#

it's not

#

iirc

#

it's like the same as any other domain

#

if not a little more expensive

#

my p1g.pw is cheap af though iirc

ocean quartz
#

Less than $5 a year

quiet depot
#

wtf

#

did they lower the price?

#

my renewal costed $15

#

that was discounted btw

#

I can't remember if it was usd or aud

ocean quartz
#

I guess renewal is a different prices than buying on namecheap, i do remember paying around 15 to renew as well

quiet depot
#

yeah well for dkim .me is free

#

cuz student

#

for first year*

half harness
#

25?

steel heart
#

is it namecheap?

quiet depot
#

yeah don't worry it won't be 25 for you dkim

#

it'll only be $15 for you

#

my namecheap is bugged

#

I have to message support every year to get them to fix it

steel heart
#

ah well

#

should I pick name.com or namecheap or the other one?

quiet depot
#

what domain r u getting

#

I recommend just getting the free domain, then transferring it to cloudflare registrar

#

you'll have to pay for an extra year to transfer it

#

but you're basically getting 2 years for the price of one

steel heart
#

oo true

quiet depot
#

keep in mind though cloudflare registrar doesn't support all domains

#

so it really matters which ur planning on getting

steel heart
quiet depot
#

might just renew that now even though it's not due till september

#

yeah cloudflare doesn't support .me :/

steel heart
quiet depot
#

namecheap

steel heart
#

ok, Ima try that one ty for helping 😄

quiet depot
#

cloudflare registrar is the best for cheapest prices

#

they just don't support many domains :/

#

oh btw conclure

#

with the namecheap thing

#

.me is free, and lots of other things are heavily discounted

steel heart
#

ah ooo that's awesome

quiet depot
#

oh, not lots

#

just a few things

#

discounts on first year registration: .io / .tech / .com / .website
$24.88 .io
$0.48 .tech
$8.88 .com
$0.48 .website

half harness
#

dkim19375.tech

obtuse gale
#

.website XDD

old wyvern
quiet depot
#

no

#

it's a domain

#

idk what they're talking about with the github pages thing on nc.me

#

it's a fully functional domain

#

you can use it for anything

old wyvern
#

oh so it asking us to point it to a github page while registering doesnt matter?

#

damn I didnt take it till now just because of that xD welp

quiet depot
#

I assume so

old wyvern
#

awesome

quiet depot
#

I don't remember having to do that

#

I got the dev pack a long time ago though

old wyvern
#

Wait lemme show

quiet depot
#

what does the info say

old wyvern
#

That link

quiet depot
#

idk

#

just leave it unchecked

old wyvern
#

ah

heady birch
#

help chat git labs server.

#

wonder how easy it would be to write a similar platform from scratch

forest pecan
#
    @Override
    public List<String> onTabComplete(@NotNull final CommandSender sender, @NotNull final Command command, @NotNull final String s, final String[] args) {
        if (args.length == 0) {
          *statement1*
        }
    }

Shouldn't statement1 be executed if i have no arguments? Like for example if it was assigned to command video if i do /video , it should do statement1 right cause there aren't any arguments

obtuse gale
#

Not quite

forest pecan
#

null?

obtuse gale
#

Tab suggestions aren't fired until you fully type the command name + a space

forest pecan
#

well yeah that

#

assuming i did that

obtuse gale
#

But by the time you tap the space bar args is already length 1

#

An empty string

forest pecan
#

oh

#

so i need to increase all my indexes

#

by 1?

obtuse gale
#

I mean it depends on how you did it

#

/cmd ksbdi is no different in args length than /cmd

#

But it is different from /cmd ksdbi (2)

#

Because of the space

forest pecan
#

tab completer dumb af

obtuse gale
#

In that last case args would be { "ksdbi", "" }

forest pecan
#

why would it be like this

#

lmao

#

its so confusing

#

xD

#

so i should make something to trim all the empty strings

#

out of my args

obtuse gale
#

Why wouldn't? By the time you are already typing the next argument the args length increases, because you are typing the next argument

forest pecan
#

so space counts an argument?

obtuse gale
#

I think it counts as an empty string, yes

#

It literally just whatevs.split("\\s") I think

forest pecan
#

well my current implementation

#
    @Override
    public List<String> onTabComplete(@NotNull final CommandSender sender, @NotNull final Command command, @NotNull final String s, final String[] args) {
        if (args.length == 0) {
            return Arrays.asList("start", "stop", "load", "set");
        } else if (args.length == 1) {
            if (args[0].equalsIgnoreCase("set")) {
                return Arrays.asList("screen-dimension", "itemframe-dimension", "starting-map", "dither");
            } else if (args[0].equalsIgnoreCase("load")) {
                return Collections.singletonList("[Youtube Link or Video File Here]");
            }
        } else if (args.length == 2) {
            if (args[1].equalsIgnoreCase("screen-dimension")) {
                return Collections.singletonList("[Width:Height]");
            } else if (args[1].equalsIgnoreCase("itemframe-dimension")) {
                return Collections.singletonList("[Width:Height]");
            } else if (args[1].equalsIgnoreCase("starting-map")) {
                return Collections.singletonList("[Map ID]");
            } else if (args[1].equalsIgnoreCase("dither")) {
                return Arrays.stream(DitherSetting.values()).map(DitherSetting::name).collect(Collectors.toList());
            }
        }
        return null;
    }
#

requires that no spaces exist

obtuse gale
#

Yeah you're off by 1 lol

forest pecan
#

yeah

#

i need to check if args.length == 1

#

instead of 0

#

☠️

obtuse gale
#

The indexes are correct

#

The length checking is off by one

forest pecan
#

yeah

#

why dont they just do like

#

.split(" ")

#

how is the first space even necessary tho

obtuse gale
#

\s accounts for all whitespaces, not exclusively ' ' but '\t', '\n', '\r' and other bs

forest pecan
#

oh bruh

obtuse gale
#

I mean a b c when split is { "a", "b", "", "", "c" }

forest pecan
forest pecan
#

What the fuck

#

my orchestral conductor is telling me to do yoga

#

????

#

"Winds/Brass, try to wear clothing that you can comfortably move around and stretch in, and if you have a yoga mat/towel nearby, have that ready as well!"

obtuse gale
#

I mean tbf he isn't wrong lol

forest pecan
#

lmao

obtuse gale
#

Pulse wtf

#

You're still tier 3

forest pecan
#

Yeah

#

dkim is even higher than me

obtuse gale
#

That's depressing

#

Discouraging

forest pecan
#

well its not at the same time

#

cause dkim says a lot of false info

obtuse gale
#

XD

forest pecan
#

lmao

#

a dkim moment

unkempt tangle
#

so mean

forest pecan
#

wow do we need a

#

n3w0rk moment

#

lol

half harness
#

😭

livid gazelle
#

[10:59:14] [Client thread/FATAL] [FML]: Suppressed additional 2 model loading errors for domain dragonmounts
[10:59:14] [Client thread/FATAL] [FML]: Suppressed additional 3 model loading errors for domain twilightforest

half harness
#

ok

prisma wave
#

ok

ocean quartz
#

ok

forest pecan
#

you realize this aint modded

#

lmao

#

athough twilight forest is an epic mod

#

very ebic

prisma wave
#

ok

half harness
#

ok

old wyvern
#

ok

half harness
#

https://paste.helpch.at/irezoqusaq.md
When the server decides to crash when you join, then when you leave it stops crashing, then when you join it crashes again, then when you leave it stops

#

:c

fallen venture
#

i-

#

thats a discord message link

#

in that case

half harness
#

lol

hot hull
#

Get fud

#

Gud

fallen venture
half harness
#

....

obtuse gale
hot hull
#

Bruh you'd take that back if you knew me url

#

Irl

half harness
#

😳

obtuse gale
#

url

#

good thing I don't

obtuse gale
half harness
#

it finally crashed with an out of memory error

#

lol

obtuse gale
#

lol

half harness
#

even tho i gave it 3gb

fallen venture
prisma wave
#

lol

#

just be patient and don't ask in other channels

#

because this aint the right place to ask

forest pecan
obtuse gale
#

yum

onyx loom
#

heard that usually fixes everything 👍

light wasp
#

lol I think someone had mentioned Haskell earlier

onyx loom
#

in that case

#

CLOJURE

prisma wave
#

fsharp

#

ocaml

#

ML

#

elm

#

uhh

#

what others

#

Lisp

#

Racket

#

Scheme

#

Erlang

onyx loom
#

emacs lisp

prisma wave
#

ofc

#

Agda

#

man most of the functional languages are really old academic ones

onyx loom
#

☹️

#

this will change when ELARA provides a MODERN solution to FUNCTIONAL programming

static zealot
#

a

#

b

#

c

#

f

#

u

#

c

#

k

prisma wave
#

INDEED

static zealot
#

sometimes I wish. sometimes I don't

#

lmao

dawn hinge
#

Thursday is the day you updated the plugin lol

half harness
#

but december 8th isn't thursday

static zealot
#

yeah I know

#

but it says

#

dec 8

unkempt tangle
#

I wanted to use this input api

static zealot
#

sooooo

unkempt tangle
#

But I noticed it includes HandlerList.unregisterAll

half harness
unkempt tangle
#

Ain' that dangerous

half harness
#
    /**
     * When this method is called all the events in this input handler are
     * unregistered<br>
     * Only use if necesary. The class unregisters itself when it has finished/the
     * player leaves
     */
#

read

#

🙂

#

wait

#

wot

half harness
static zealot
#

waiiiitt a second

dawn hinge
#

I said updated not releasing dkim

static zealot
#

yeah

#

but I dind't realease in 8 dec either

half harness
static zealot
#

it was my other update in dec 8

#

that should show the latest update

#

date

#

but it shows my other update date

#

like not the latest. the one before

#

here

#

better view

half harness
#

lol

dawn hinge
#

That's odd lol

static zealot
#

spigot being spigot. nothing wrong there xD

unkempt tangle
#

Why you cant reply to old topics

static zealot
#

because why would you even do that?

unkempt tangle
#

Got a question

static zealot
#

why would you bump 2 year old topics? XD

unkempt tangle
#

It's 8 month old

static zealot
#

still.

#

like make your own thread or find other new ones

#

ah I see. well idk

#

maybe contact the one who posted

unkempt tangle
#

Wait

#

It worked

#

I had to checkbox

static zealot
#

also you can reply

#

but you'll probably get some kind of warning if it wasn't actually needed

unkempt tangle
static zealot
#

lmao

unkempt tangle
#

Wat

half harness
#

lmao

static zealot
#

@prisma wave @onyx loom @old wyvern @hot hull @ocean quartz @quiet depot @distant sun joining?

remote goblet
#

damn i wasnt mentioned

#

feelsbadman

static zealot
#

you don't deserve to

unkempt tangle
static zealot
#

@remote goblet @half harness @obtuse gale

remote goblet
#

anyway, anyone know why my gradle takes a really long time to build

static zealot
#

hmm who else usually joins?

static zealot
#

@lunar cypress @steel heart

half harness
#

also

#

why do u disable shortest

#

😦

unkempt tangle
#

ban incoming

half harness
#

thats the only one i win at

static zealot
#

didn't make the lobby

half harness
#

i only win at shortest

#

😭

static zealot
#

@obtuse gale

#

I think that's all ? xD

old wyvern
half harness
unkempt tangle
old wyvern
#

Ill enable for next round dkim

#

ok?

half harness
#

ok

static zealot
#

oh @forest pecan

remote goblet
half harness
#

wot

remote goblet
#

3m 7s

old wyvern
#

I think everyone is in

onyx loom
#

bad pc

remote goblet
#

Shut kaliber

#

bad gpu

static zealot
onyx loom
#

☹️

half harness
onyx loom
#

watch in 2 years ori

static zealot
#

this feels kinda easy and hard at the same time lmao

obtuse gale
static zealot
#

wait

#

easy

#

join coc

remote goblet
#

i suck at anything outside of spigot plugins

obtuse gale
#

Not home

#

Rip

static zealot
#

ah ok 😦

#

well not easy.

forest pecan
#

join coc

#

"coc"

#

lmao

static zealot
#

but I understood the thing we have to do

static zealot
#

we love COC

unkempt tangle
#

Whose Coc

static zealot
#

COC is life

unkempt tangle
#

do we enjoy?

static zealot
#

ours

forest pecan
#

❤️ coc

unkempt tangle
remote goblet
onyx loom
#

gradle.... bad...? 😳

static zealot
#

am I going crazy? I can't even turn around a matrix. smh

#

by turn around I mean flip

remote goblet
old wyvern
#

transpose

static zealot
#

well the thing is I can't even make a matrix.

#

lmao

old wyvern
#

😬

#

me after writing a transpose function.... haskell already has it xD

static zealot
#

oh there's an error at the bottom.

#

I'm fucking good at this

old wyvern
#

🥲

static zealot
#

can we have a rematch? I hate arrays

forest pecan
#

i wonder

#

could you run a mc server

#

by using a ci

old wyvern
#

Sure

forest pecan
#

lmao i think its possible

static zealot
#

make new lobby please .brb

forest pecan
#

wait

#

yo

#

link me

old wyvern
#

@static zealot

static zealot
#

k I'm back

#

I'm eating some Kinder Ice Cream at 22:05

old wyvern
#

@prisma wave you comin?

forest pecan
#

mass ping

#

everyone

#

quick

old wyvern
#

lol

static zealot
#

I did above

#

lmao

#

almost no one joined

forest pecan
#

quick

#

ping bm

#

everyone

#

ping bm

#

@prisma wave

prisma wave
#

no

#

lol

#

soz

#

busy

static zealot
#

math smh

#

well I have like a 80% success rate so far

#

damn Yugi knows math

forest pecan
#

didnt have time

#

however, the fast way is to use a binary search

#

or self balanced tree

static zealot
#

lets see

#

71%

#

not that bad

#

xD

forest pecan
#

wish i had time for more opitmization

static zealot
#

share code please

old wyvern
forest pecan
#

wdym

old wyvern
#

n should be either divible by 4 or dd

#

odd*

#

check my soln

static zealot
#

oh

forest pecan
#

yea true

static zealot
#

damn

forest pecan
#

ik how to do an O(N) solution, but thats smart

#

big brain

static zealot
#

why u guys know math?

#

I don't

old wyvern
static zealot
old wyvern
#

lol

forest pecan
#

cause

#

asian

#

and asian parents

#

lmao

#

no cap tho xD

static zealot
#

damn. I think I'll kill myself and pray I'll become an asian in my next life then. because I hate maths

#

I love it but hate to have to use it

forest pecan
#

🥲

old wyvern
#

Where are you from beat?

static zealot
#

I think you can start yugi

forest pecan
#

so yeah

#

im Chinese

old wyvern
#

ah

static zealot
#

oh shit we started

#

damn its not all working

forest pecan
#

my last case isnt working

#

for some damn reason

old wyvern
#

||leading 0s?||

forest pecan
#

nah

#

its not that

old wyvern
#

hmm

forest pecan
#

answer is 131408765408199987, i got 139998700000199987

#

idk

#

lol

old wyvern
#

what are you* doing for the difference?

forest pecan
#

oh

old wyvern
#

actually first 2 are diff hmm

#

weird

static zealot
#

damn I give up

old wyvern
#

bruh wha xD

forest pecan
#

i dont understand why it doesnt work for big numbers

#

lmao

static zealot
#

yeah same

old wyvern
#

might be the integer size

forest pecan
#

i tried long

static zealot
#

tried BigInteger

remote goblet
forest pecan
#

didnt work

old wyvern
#

try BigInteger

static zealot
#

didn't work

old wyvern
#

ah

forest pecan
#

yeah

old wyvern
#

weird

#

show code

forest pecan
#
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        System.out.println(((a-b) + "" + (a*b) + "" + (a+b)).replaceAll("^0+(?!$)", ""));
    }
old wyvern
#

kotlin.math.abs(a*b).toLong()
Uh blitz

#

That will still overflow

#

xD

static zealot
#

yeah don't worry about it

forest pecan
#

lmao

static zealot
#

I just did a lot of ctrl+z

#

and went with first instance

#

that worked

#

with first options

#

lmao

old wyvern
#

yea its probably overflow

static zealot
#

but like I tried biginteger and long and it was just overflowing

old wyvern
#

Thankfully I for somereason used Integer instead of Int

#

xD

forest pecan
#

lmao

#

another one?

old wyvern
#

yup

forest pecan
#

(not me btw)

old wyvern
#

lmao

forest pecan
#

what

#

the

#

fuck

#

lmao

static zealot
#

love the fact that you had to mention it

#

oh

#

this seems interesting

unkempt tangle
half harness
#

i think i know

static zealot
#

I am confusiion

half harness
#

i think i know!!

#

YES

#

okay

#

it fit all the examples

#

how am i gonna write this code

static zealot
#

share with the stupider people here please/

#

ah

half harness
#

nooo

#

blitz

static zealot
#

well I know what to do. how to is a bit harder

#

lmao

half harness
#

lol

#

uh oh

forest pecan
#

lmao

static zealot
#

Expected: Nothing

#

are you fucking kiding me?

forest pecan
static zealot
#

ugly af for kotlin but it works

half harness
#

i give up

static zealot
#

lmao

half harness
#

🖐️🖐️

forest pecan
#

i % 2 == 0

#

smh

#

(i & 1) == 0

#

so much better

static zealot
#

shut up and share code sometime

forest pecan
#

lmao

#

@old wyvern

#

you okay

#

🥲

half harness
#

🥲

static zealot
#

no he not

old wyvern
#

God that was aweful

static zealot
#

haskel killing him

old wyvern
#

Debugging is haskell is fun

static zealot
#

make new lobby.

old wyvern
#

🥲

static zealot
#

will be ready soon

forest pecan
#

imagine using modulo

#

lmao

#

(i & 1) == 0

#

😻

#

"You've joined the coc50870851 channel. Send a message to say hello!"

#

thats a lotta cocs!

half harness
#

y u guys starting so quickly

#

:c

#

my page takes a while to load

static zealot
#

lets see

#

fuck I'm not there

half harness
#

too hard

forest pecan
#

ah

#

i got it

#

its easy

static zealot
#

yes easy

forest pecan
#

just be organized

static zealot
#

almost

forest pecan
#

😉

half harness
#

;-;

static zealot
#

ah nvm its not what I thought it is.

#

fuck man

#

why is this so hard for me rn?

forest pecan
#

make a table

#

lol

static zealot
#

I literally can't figure anything out. I had one idea and I know its wrong but same idea keeps poping off in my head

forest pecan
#

its easy once you make a table

#

and sort it

static zealot
#

table?

forest pecan
#

Yes

#

a t chart

half harness
#

thats what im doing

static zealot
#

chart with what?

#

lmao

half harness
#

and was doing

forest pecan
#

submitted 😄

half harness
#

for th epast minute

forest pecan
#

its N(N+1)/2

#

right

#

cause its sum

static zealot
#

yeah

#

just said that in COC chat

#

lmao

forest pecan
#

lol

#

i have to go do science hw

old wyvern
#

alrighty

forest pecan
#

:((((

#

cya

surreal quarry
#

tf is COC chat

old wyvern
#

ciao

old wyvern
forest pecan
#

adios

surreal quarry
#

oh

old wyvern
#

@static zealot

static zealot
#

ye here

#

hmm

#

I am a bit confusion

#

damn my code is ugly af

surreal quarry
#

same lmfao

#

theres probably a really clean way to do this

#

but im too lazy to figure it out

static zealot
#

yeah same. well I knew how to improve mine lmao. just 1 line instead of 2 and no double loop.

old wyvern
#

welp

#

1 more?

static zealot
#

1 more

old wyvern
#

Alrighty

half harness
#

dont start @old wyvern

#

let my page loadd

old wyvern
#

ok xD

surreal quarry
#

not doing this one

half harness
#

u didn't do shortest 👀

old wyvern
#

👀

half harness
#

uh

static zealot
#

hmm interesting

half harness
#

is this some form of ||binary||

#

AHA

distant sun
#

I dont want to do binary

static zealot
#

what's binary about this?

#

hmm

old wyvern
static zealot
#

yeah I saw it xD I'm just wondering what the hell the formula or whatever is

half harness
#

oh wait

#

oh nooo

static zealot
#
Found: 0
Expected:    0``` thank you
#

I love this sometimes

half harness
#

lol

distant sun
#

:))

frozen furnace
#

help me in #bot-commands

static zealot
#

why do I keep going for the messy solutions ?

distant sun
#

why blitz lol

old wyvern
#

🙃

half harness
#

i give up

old wyvern
#

There we go

static zealot
#

think that's it for tonight. gn

old wyvern
#

gn

half harness
half harness