#dev-general

1 messages ยท Page 219 of 1

forest pecan
#

I don't understand at all

#

what you are trying to say

#

I get the first part where it takes a location

obtuse gale
#

problem is that you need to subtract 2 from the overall magnitude

#

which is uuuh it'll require some fancy math to compensate for orientation

#
  • angle dependent
leaden sparrow
#

okay let me try to explain again, so the entities current location is 0, 50, 0 and the player is on 10, 50, 10 so the entity should move to the player, but instead being directly on the player it should stay away 2 blocks, think about this, lets image i want to simulate Social distancing in minecraft, it will require that the entity keeps a specific distance.

forest pecan
#

Ah

obtuse gale
#

social distancing in minecraft?

#

๐Ÿ˜ฆ

forest pecan
#

I understand now

leaden sparrow
#

which is uuuh it'll require some fancy math to compensate for orientation
@obtuse gale thats what i thought too, but i am shit in maths so i asked here

forest pecan
#

Well basically you want to calculate the point based on an angle

#

think the player

obtuse gale
#

basically you want to keep a radius from the player

forest pecan
#

as the center

#

of a circle

#

then the circle has radius 2

#

then you want to find the nearest point on that circle closest

#

to the player

#

you can do some math to calculate this

obtuse gale
#

yes he knows what he has to do

leaden sparrow
#

yea now you guys understand it ๐Ÿ˜„ but that still require math and i am shit in math

obtuse gale
#

but how

forest pecan
#

Well you got two ways. You can be not precise and use a brute force ๐Ÿ‘€

#

Or

#

let me grab it one sec

#

use this weird shitty formula

#

from newton or idk fuck

#

and yeah

leaden sparrow
#

well fefo is pretty good with that kind of stuff, so i hope he tells me that the formula is good, as it should happens pretty fast even if the player is moving

obtuse gale
#

uuh

leaden sparrow
#

also if i use pathfinding from paper, how can i assure that the entity always goes to the location, i dont want it to have like a queue, that it first walks to one location and from there to the other, is always should have the direct path to the specified location

forest pecan
smoky crypt
#

oh i had once written some code for that problem but i forgot it and i cant look it up now

forest pecan
#

this doesnt look fun

#

lol

leaden sparrow
#

that made it worse, i understand less then on the first page you send me

#

oh nvm

#

it just looked weird

#

i kinda get it?

forest pecan
#

Its actually not that hard

obtuse gale
#
double vX = pX - cX;
double vY = pY - cY;
double magV = sqrt(vX*vX + vY*vY);
double aX = cX + vX / magV * R;
double aY = cY + vY / magV * R;

Taken from the first link, this looks good

forest pecan
#

when looking at a 2nd time

obtuse gale
#

I mean it's as fast as it gets

leaden sparrow
#

so i assume R is the radius i want to keep eg 2 blocks

obtuse gale
#

The most expensive operation is the sqrt but the performance impact is negligible

leaden sparrow
#

and X and Y should be X and Z correct?

obtuse gale
#

btw magV is just the distance between the two locations

leaden sparrow
#

pX is current and cX is player location correct?

#

and aX and aY is my final stuff

obtuse gale
#

p is the point, i.e. the location of the entity

#

c is the location of the player

#

v is the vector between them

#

and a is the point on the circle

#

i.e. the target location

leaden sparrow
#

should the p and c be the vector itself or just the X value and Z Value?

obtuse gale
#

R is the radius, yes

#

what?

leaden sparrow
#

is this correct? Java public Location calculateNewLocation(KittyPlayer target, int radius){ double vX = entity.getLocation().getX() - target.requestPlayer().getLocation().getX(); double vZ = entity.getLocation().getZ() - target.requestPlayer().getLocation().getZ(); double magV = Math.sqrt(vX*vX + vZ*vZ); double aX = entity.getLocation().getX() + vX / magV * radius; double aZ = entity.getLocation().getZ() + vZ / magV * radius; return new Location(target.requestPlayer().getWorld(), aX, target.requestPlayer().getLocation().getY(), aZ); }

#

its just temporary the values will be replaced ofcourse

obtuse gale
#

If you only do for x and z you'll basically "draw" a cylinder centered on the player that extends all the way vertically, if you want a sphere around the player you should also account for y

#

yeah looks good ig

leaden sparrow
#

i think i only need x and z, i will try it rn. Fefo are you online in like a few min?

obtuse gale
#

mhm

leaden sparrow
#

How can i make an Entity invisible?

#

like completely invisible

smoky crypt
#

dont send the packet over to the client

remote goblet
#

Entity#setVisible

obtuse gale
#

isn't that exclusive to armor stands?

ocean quartz
#

I think so

lost forge
#

Pretty sure it is.

cinder salmon
#

hey
what you know how I can do so that on filezilla its transfer only 1 files per 1 files instead of 2 by 2

frigid badge
#

idk I don't use filezilla

hot hull
#

big brain Lemmo

quaint isle
hot hull
prisma wave
#

It's ok when it's my code though ๐Ÿ™‚ ๐Ÿ‘

hot hull
#

Yes bb

static zealot
#

Em can I steal ugh I mean inspire from your code? Thanks

normal talon
#

Yes ofc

fluid crag
#

Aw, I was going to post a wiki about a programming language I just heard of today

#

called Brainfuck

#

+brainfuck ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

hot hull
#

shab, you sometimes make me want to use the suislide

prisma wave
#

it's no clojure

errant geyser
#

I mean

#

Elara is obviously superior

prisma wave
#

||commission :)||

#

||not my idea||

errant geyser
#

Dear god

hot hull
#

Poor naming

prisma wave
#

i know

errant geyser
#

I can only imagine

prisma wave
#

i lowkey feel like i'm selling my dignity away

hot hull
#

katsu

errant geyser
#

Yes dear

hot hull
#

I wanna see what u been up to

prisma wave
#

elara hopefully

errant geyser
#

A lot of coding

hot hull
#

push push push

errant geyser
#

You know I'm incapable of learning Go BM

#

Friday Frosty, friday

#

Can you hold on that long senorita?

prisma wave
#

Go is easy

#

it's just java

hot hull
#

I don't think so

prisma wave
#

well it's not

#

but it's close enough

errant geyser
#

:-

prisma wave
#

:=

errant geyser
#

That ^

hot hull
#

"-"

errant geyser
#

It's like python bread with Clojure

hot hull
#

My internet is shit

prisma wave
#

how

hot hull
#

Watching wildcat's stream, 10 sec loading, 1 sec watching

prisma wave
#

walrus operator is hot

#

none of this let val var

errant geyser
#

:= mr walrus that nobody likes, and I suppose it's like the opposite to clojure since not many brackets

prisma wave
#

no

errant geyser
#

But still

prisma wave
#

it's nice

#

concise ๐Ÿ™‚

#

the only thing about go that sucks is no generics

errant geyser
#

Well so is let, var, or val

prisma wave
#

:= is more concise

errant geyser
#

So is e for event but Frostiboo has a vendetta against me if I use it

prisma wave
#

that's too concise

#
mappedSlice := make([]string, len(otherSlice))
for i, e := range otherSlice {
  mappedSlice[i] = e.string()
}
#

no slice.Map ๐Ÿ˜ฆ

#

imperative everything

errant geyser
#

Unfortunate

prisma wave
#

sucks

#

still better than java

#

fast

errant geyser
#

So is machine code but nobody likes writing that

prisma wave
#

wdym

#

i love it

#

whats ur favourite opcode

old wyvern
#

MOV

#

JZ?

ocean quartz
#

If anyone wants some great content

distant sun
#

I see 2 nerds

umbral mica
#

do I spy a cat

ocean quartz
#

You do spy a cat

hot hull
#

I dislike him already after seeing that spacing @ocean quartz

ocean quartz
#

When are you gonna just let people do things the way they like? xD

hot hull
#

Never.

prisma wave
#

relocation

prisma latch
#

How do I unlink a discord account from the spigot linking ?

onyx loom
#

an admin has to do it i think

prisma latch
#

Okay

#

How to I contact an admin or support?

hot hull
#

And why would you need to link a new account?

prisma latch
#

The old one got compromised. I have my new one (this one) in the spigot account

hot hull
#

In that case, CC: @pallid gale

prisma latch
#

Okay thanks

#

@pallid gale would it be possible to unlink the Ruinfox account from =spigot 666004. That account is no longer in use (was compromised) I would like to link this one. Thank you

steel heart
#

so I blame @steel heart then
@obtuse gale how dare you blame my holy concotion of wealthy functional interfaces

obtuse gale
#

I already did

#

so

#

yea

steel heart
#

tbf I did that for the ratings

#

lol

obtuse gale
#

xD

steel heart
#

consider doing a revamp on it as well but with stuff like a quadconsumer etc

obtuse gale
#

Imagine having to make an interface for each extra argument

#

tsk

#

I miss C++'s template varargs

steel heart
#

ah man

#

also

#

like

#

uh

prisma wave
#

vararg generics

steel heart
#

Generics sucks

#

in java

#

in my opinion

old wyvern
#

types eq

obtuse gale
#

I miss templates

#

lol

old wyvern
#

ew

#

contracts PlusOne

steel heart
#

well I'm excited for the remarkable elera generics

prisma wave
#

elara type system is actually amazing

#

if we can get it implemented :)

obtuse gale
#

elarics

prisma wave
#

it's literally a dynamically typed language, but static

steel heart
#

Idk but alex, if you somehow get it to work then all I can say is that your intelligence probably lays somewhat beyond humanity and society

old wyvern
#

it doesnt need to be static

#

I mean dynamic

prisma wave
#

exactly

old wyvern
#

I started working on the static typer earlier

prisma wave
#

it's all of the benefits of dynamic typing, but as a static language

#

nice

old wyvern
#

Kinda lazy this week but ill start soon

#

it's all of the benefits of dynamic typing, but as a static language
mhmPlusOne

prisma wave
#

should i rewrite pdm or try and salvage the current codebase

#

im conflicted

hot hull
#

Rewrite

#

When in doubt, rewrite it out

prisma wave
#

you're probably right

#

but rewriting is effort D:

steel heart
#

or save yourself some time by using haskel

prisma wave
#

tempting

onyx loom
#

delete the project

prisma wave
#

no ๐Ÿ˜ฆ

#

glare and other high profile people are depending on it

hot hull
#

Don't delete it

#

It's kowl

prisma wave
#

when it works

hot hull
#

If it works sad_fingerguns

steel heart
#

pdm is like epic but more epic when no bugs

prisma wave
#

welp

#

anyone wanna contribute

steel heart
#

uh sure

prisma wave
#

i dont think i have the willpower to do a full rewrite on my own

steel heart
#

what do you need?

prisma wave
#

idk

#

lol

steel heart
#

Well, nor do I but I can make plentiful prs

prisma wave
#

i like the sound of that

steel heart
#

Fabric kinda pooped on me rn

#

and I need to learn about class loaders anyways

prisma wave
#

the classloading is the easy bit

#

the pain is parsing maven poms

onyx loom
#

did i hear maven

prisma wave
#

sadly

steel heart
#

well whats the pain? doing it fast or get it to work?

hot hull
prisma wave
#

parent poms

#

they make me want to die

#

every time i think i've got it working another "unknown placeholder" error comes up

hot hull
#

Just make the placeholder known, duh dummy

prisma wave
#

because these "professional" projects have about 30 different modules with 1 placeholder in each pom

#

and so it has to be loaded in the right order

#

fml

steel heart
#

that sounds like a total disaster

prisma wave
#

it is

#

not to mention the current gradle plugin is a mess of kotlin spaghetti

#

lemme just write a quick haskell hello world to calm me down

steel heart
#

lol

old wyvern
#

i dont think i have the willpower to do a full rewrite on my own
@prisma wave
Im in

#

๐Ÿ˜‚

heady birch
#

Hello ๐Ÿ™‚

prisma wave
#

Yo

#

Pdm gang?

ocean quartz
prisma wave
#

It's done by bytes I think

ocean quartz
#

C# be like: You can copy my homework but make sure you change a bit so it doesn't look the same

#

int[,] is weird

#

Oh interesting, it's just a 2d array, kinda better than int[][] in a way

prisma wave
#

That literally was the point of c# though lol

ocean quartz
#

I know yeah xD

#

Just so weird how similar and different it looks at the same time

prisma wave
#

Classic Microsoft

#

Yeah it's a weird language

obtuse gale
#

OH EW

#

methods are UpperCamelCase

#

ew ew ew ew ew

#

that's so unsettling

light venture
#

brain cells are lost here

obtuse gale
#

Hey

#

I'm trying to install JDK-8 on debian 10

#

But I can't figure how to make it work

hot hull
#

Quick question, would it make sense to have a timed cache which stores all recent access of data, (if not present, data get's querried and put into the cache), asking cause some data will never get used so seems pointless to have it loaded

quiet depot
#

memory is cheap and fast so the answer is usually yes

dusky drum
#

i usually just store everything in mem, since query sql can be slow if you use mysql that isnt on same server.

hot hull
#

I do the same Gasper most of the time, but seems pointless to have data which you'll never use (since there's gonna be plenty of data)

dusky drum
#

depends on plugin usecase since in my plugin i just have to check if its special crop each time user breaks crop XD

hot hull
#

Well yea that would make sense, but in my case it's triggered by a command which will not be used very often/if at all by some users

#

However this might be tedious to sync data between the cache and the db, so gotta think of that as well

outer crater
#

Deluxemenus has a bug, it does not read the item minecraft:dye in any way.

lost forge
#

Probably because there are many different types of dye

hot hull
#

With JSONMessage#runCommand, does it need a / or nah?

steel heart
#

?tryandsee

compact perchBOT
prisma wave
#

I think so

steel heart
#

It doesnโ€™t though

#

Would make no sense if you had to include it

distant sun
#

what makes sense in minecraft?

steel heart
#

Gravity?

static zealot
#

Zombies

#

Their pretty accurate to real life

steel heart
#

Except that they donโ€™t exist ?

quiet depot
#

u can't implement gravity in mc without mods

steel heart
#

In real life

quiet depot
#

it's straight up impossible

steel heart
#

Lol

quiet depot
#

kinda stupid

#

like you can add a potion effect, but it's eh

#

not too much control

steel heart
#

Yeah true

quiet depot
#

you can do vectors, but it's laggy af and you can't control strafe

#

that's why you'll never see a good gravity impl on a server, because it's impossible

#

just a fun fact

steel heart
#

Thatโ€™s sad

prisma wave
#

Doesn't gravity already exist lol

quiet depot
#

yeah but you can't modify it

prisma wave
#

Oh yeah

static zealot
#

Except that they donโ€™t exist ?
@steel heart you've rly not seen one irl? I have a zombie pet

normal talon
#

should this be free? cuz of student plan ?

old wyvern
#

Dont think so

lost forge
#

Nah.

normal talon
#

9 8 7 6 5 4 3 2 1 0

This program is so crappy

#

It doesnt even say how to print something like that

#

System.out.println("9 8 7 6 5 4 3 2 1 0");

#

nvm found out

obtuse gale
#

that didn't work, did it?

normal talon
#

that worked

lost forge
#

Right..

normal talon
#

it said write a program to print this 9 8 7 6 5 4 3 2 1 0

lost forge
#

It probably meant a loop to countdown.

normal talon
#

no it was basics of java string or something

hot hull
#
String result = "";
for (int number = 9; number >= 0; number--) {
  result = result + " " + number;
}

println(result);
#

However, that wouldn't work, cause spaces at the end fingerguns

normal talon
#

I tried it on this

#

it just printed the numbers

obtuse gale
#

However, that wouldn't work, cause spaces at the end fingerguns
StringJoiner reversed_fingerguns

hot hull
#

shut up weeb

obtuse gale
#

sHuT uP wEeB

lost forge
#

@normal talon If you're wanting to learn Java. The Java Mastercard by Tim Burkle or whatever his last name is on Udemy is pretty good.

quiet depot
#

tim buchalka

hot hull
#

I bought that but never actually went over it kek

quiet depot
#

i think

normal talon
#

im on jetbrains academy

hot hull
#

Buchalka yes Piggy

lost forge
#

Yeah that sounds right. I did start the course. Haven't finished it though. He is really good at teaching though. Explains things well.

quiet depot
#

best way to learn is to decipher a project

#

and then add on to it

hot hull
#

best way is to bully people into hiring you for projects

#

You'll learn the most fingerguns

normal talon
#

Best way is to steal code, and make it yours

quiet depot
#

yes

#

basically

hot hull
#

Piggy, go bully GH into adding folders, thanks

quiet depot
#

you're stupid

hot hull
#

I have 70 repos, and everytime I try and find something I reeee

quiet depot
#

oh

#

I thought you meant like making folders on a repo lol

#

hence the "you're stupid"

hot hull
#

No lol, actual folders which you can put repos in

#

So you can have them organized

quiet depot
#

yeah that'd be cool

#

I'm sitting at 92 repos or something ridiculous

#

not even my all time high

#

I had 100+ a while back, deleted some tho

hot hull
#

I have 49 public ones, and it's kek

quiet depot
#

61 public ones 4 me

hot hull
#

I don't wanna delete any cause if someone finds anything interesting they can use it

quiet depot
#

I just deleted empty ones & old forks where I didn't pr anything

hot hull
#

Makes sense yea

lost forge
#

Gh folders would be cool.

hot hull
half harness
#

wait

#

final in parameters?

#

how's that work?

hot hull
#

lol

#

Same as it does everywhere else

half harness
#

but

#

does the parameter

#

have to be final?

hot hull
#

No

half harness
#

because iirc you can't change parameters... or can you?

ocean quartz
#

You can

half harness
#

wut

hot hull
#

If they aren't final you can

ocean quartz
#

But you shouldn't

steel heart
#

Itโ€™s stupid to have them final

#

Just pedantic

half harness
#

oof

hot hull
#

You're stupid Conclure fingerguns

ocean quartz
#

Can't in Kotlin, cuz Kotlin smart

steel heart
#

Nah u r 4head

hot hull
#

Very, so any suggestions on my question

half harness
#

ahHhHh I don't get the point of using kotlin when there's java

#

and groovy for build.gradle

steel heart
#

Whatโ€™s your question Frosty?

hot hull
#

How jucky would this be
@hot hull

ocean quartz
#

That's the point of Kotlin, so you don't have to use the yucky Java

steel heart
#

well kotlin comes with great features and reduction of boilerplate

hot hull
#

Why drive a Fiat when you can drive a Lambo

steel heart
#

Frosty what is wrong with the code?

hot hull
#

Imagine reading omg

steel heart
#

How jucky would this be

#

That image seems literally fine

ocean quartz
#

Isn't there a Statement#setObject method? That would set it correctly without needing this?

hot hull
#

Wouldn't that fuck up the retrieval then?

steel heart
#

Well your choice of theme is kekw

hot hull
#

It's amazing fuck off Conclure

steel heart
ocean quartz
#

Probably wouldn't, retrieving and setting are separate

hot hull
#

That makes life easier then

ocean quartz
#

You'll have to test though since i don't remember if it's correct or not

hot hull
#

Will do

#

Eventually

distant sun
#

@prisma wave does kt not support ArrayListMultiMap?

prisma wave
#

wut

distant sun
#

using entries().forEach() it is Entry<UUID, Robot> instead of Entry<UUID, Array<Robot>>

hot hull
#

Jesus, please change your system โค๏ธ

prisma wave
#

that's how multimap works

distant sun
#

whaaat

prisma wave
#

entries() has multiple entries with the same key

#

it's the same in java lol

distant sun
#

smh

hot hull
#

RobotProfile object fingerguns

distant sun
#

shut up

hot hull
#

Never!

distant sun
#

which was the map type that made the work with list as values easier?

#

ahh

#

I thought it will give me the entire list xd

old wyvern
#

Are you talking about MultiMap?

distant sun
#

ye

hot hull
#

Clean enough or?

final StatementCreator databaseStatement = new StatementCreator(connection, Statement.DATABASE_CREATION);
databaseStatement.assignObjects(databaseName).execute();
distant sun
#

StatementCreator#of sounds better imo

hot hull
#

Indeed it does

steel heart
#

Why though

hot hull
#

Wdym why tho

hot hull
#

@forest pecan You need to be sentenced to death.

obtuse gale
#

lol what happened

hot hull
static zealot
#

Show

#

Case

#

He

#

He

#

Funny

#

I

#

Laughed

#

He

#

He

obtuse gale
#

lol

#

l

#

o

#

l

forest pecan
#

I

#

am

#

unkillable

steel heart
#

@prisma wave why not use unsafe whenever possible in java?

prisma wave
#

because it's unsafe

#

and so it's easy to break stuff

#

lol

steel heart
#

And?

#

Who cares about that

prisma wave
#

unsafe is pretty much C but more verbose

steel heart
#

Shouldnโ€™t it be faster or anything ?

prisma wave
#

unless you have a specific reason, you shouldn't be using it

#

not to any practical degree

#

it's faster in that it circumvents all of the benefits of java

#

memory safety, safe access, etc

steel heart
#

Hmm okay

#

I think Iโ€™m gonna make a plugin with only Unsafe

prisma wave
#

๐Ÿ˜ฌ

#

it's called unsafe for a reason

#

as i demonstrated you can use unsafe to segfault in 2 lines

#

when that should normally be impossible in java

steel heart
#

Well, it might be faster than regular java

#

== good plugin

prisma wave
#

if you want speed that much, use c++ or c lol

steel heart
#

Wish I could

#

Isnโ€™t like ruby also pretty fast?

onyx loom
#

ASSEMBLY

prisma wave
#

ruby is dynamic

#

so it's at an instant disadvantage

steel heart
#

Whatโ€™s the fastest then?

#

In regular computing

prisma wave
#

define regular

#

The fastest would obviously be machine code

#

Since that's the lowest level you can possibly get

steel heart
#

So why donโ€™t we code that

prisma wave
#

Because it's totally impractical and barely human readable

steel heart
#

Barry human readable is a hoax

#

I can probably make whatever you want

old wyvern
#

The fastest would obviously be machine code
@prisma wave
Lets try direct eectricla impulses

prisma wave
#

Bruh assembly is hard enough to read

old wyvern
#

electrical*

prisma wave
#

Damn you're right

old wyvern
#

๐Ÿ˜‚

#

codinggame?

prisma wave
#

Nah just about to go to bed

#

Tomorrow

old wyvern
#

ah alrighty

#

gn

prisma wave
#

gn

#

Also if anyone has any idea how to use RandomPattern from WE API please ping me

#

Not to ask to ask, but it isn't working

#

Only outputs the first value

#

No randomness

smoky crypt
#

erm that doesnt seem fair

half harness
#

Just curious.. what would happen if you had method a that called method a? ๐Ÿ˜‚

quiet depot
#

stack overflow

half harness
#

oo

#

it gives error?

quiet depot
#

yes, it gives a stackoverflowerror

half harness
#

o

quiet depot
half harness
#

thx

quiet depot
#

soonโ„ข๏ธ

obtuse gale
#

Source analyzer?

quiet depot
#

nah

#

just scans javadocs

obtuse gale
#

รถ

quiet depot
#

only have support for types atm

#

gotta add methods, constructors, fields, and parameters now

obtuse gale
#

it probably won't work, and you probably won't be able to access that site afterwards.
Nice lol

quiet depot
#

yeah it's basically a dos tool

#

if you use it like that

#

I could probably add some sort of cooldown but I won't, because if it had one it'd take like 10 years to index something

#

going to have to implement something to save indexes so it doesn't have to do it on every startup

#

ah shit

#

I didn't account for the fact that there's duplicate names in bukkit

hot hull
#

L

hot hull
#

I could use some table design help, so I have two "groups"
Creators Group

uuid | supporters | supportCodeUses | supportCode

Supporters Group

uuid | supportedCreator | supporterSince
#

However me no likey

quiet depot
#

looks fine to me

#

on another note docdex uses 1.7gb mem so that's cool

hot hull
#

smh, okay then, me still no likey

obtuse gale
#

It feels so good to see a stacktrace after debugging something not working for ages

#

I take that back

hot hull
#

:kek:

obtuse gale
#

"issue":"may not be null"

#

AHHHHH

hot hull
#

@quiet depot I need assistance, so I have "user" interfaces/objects, however in the past I named the package as wrapper for them, I don't know if that's approriate tho, suggestions?

quiet depot
#

show me your code

hot hull
#

Code has nothing to do with this eeee

quiet depot
#

yeah but I don't understand what you're trying to say

hot hull
#

sec

quiet depot
#

"user" as in users, like entities that can see, breath, feel, hear, or "user" as in the user is meant to use these interfaces, they're not internal

#

and wrapper as in you literally named the package wrapper, or wrapper as in the composition pattern

#

guessing the former on the latter question, because you said "named the package"

#

i'm just confused though

#

that's why it's easier to just see the code

hot hull
#
SomeInterface
> A Type Class 1 implementing that interface
> A Type Class 2 implementing that interface
#

Type classes being "user" classes, let's say creator, or a supporter

quiet depot
#

ok

hot hull
#

You get what I'm trying to say?

quiet depot
#

I get part of what you're trying to say

#

a little fuzzy on the actual question though

hot hull
#

What would the package name for those classes be

#

if that makes sense

quiet depot
#

types

#

or users

#

or implementations

#

probably the last one

hot hull
#

my interface being outside of that package, correct?

quiet depot
#

yes

hot hull
#

k danke

quiet depot
#

for "simple" components, where there is only an interface and implementations, I'll do

#
.
|-- implementations
|   |-- Impl1.java
|   `-- Impl2.java
`-- Interface.java
#

for more complicated scenarios, where there might be multiple interfaces, different kind of impls, etc

hot hull
#

Another question, what would I call that interface then?

quiet depot
#
.
|-- framework
|   |-- HashSet.java
|   |-- LinkedSet.java
|   `-- Set.java
`-- implementations
    |-- hash
    |   |-- ConcurrentHashSetImplementation.java
    |   `-- HashSetImplementation.java
    `-- linked
        |-- ConcurrentLinkedSetImplementation.java
        `-- LinkedSetImplementation.java
hot hull
#

It would define the common stuff for both supporters and creators

quiet depot
#

User is fine

hot hull
#

k

quiet depot
#

however you may want to prefix it, as User is also common in some apis

hot hull
#

prefix with what, a letter?

quiet depot
#

god no

hot hull
#

:kek:

quiet depot
#

your project name probably

#

or if you can think of something more relevant, that

hot hull
#

I've no clue what would be relevant tho lol

steel heart
#

basically have everything in one class

quiet depot
#

well what are these supporters and creators?

hot hull
#

With a broad word, what would you call a Creator and a Supporter

quiet depot
#

youtubers?

#

streamers?

hot hull
#

Creator would be let's say a youtuber, supporter would be the user supporting that creator

quiet depot
#

is it a youtuber?

#

because that's relevant here

#

what platform is this for

hot hull
#

If who is a youtuber

#

Creator is, Supporter isn't

#

Supporter is a random kid let's say

quiet depot
#

so

#

YoutuberUser

#

creator, supporter

#

both fit under that title

#

however that limits your platform to only youtube, thus why I asked specifically what platform this is for

#

because if it's for multiple, that obviously doesn't work

hot hull
#

Let's say it's broad, no specific platform

#

InfluencerUser, however that doesn't work so nicelly does it?

quiet depot
#

no and it doesn't make sense

#

if you can't do anything specific, then do the project name

#

however just going back to the start

#

these prefixing shenanigans are only necessary if User is already a taken name

hot hull
#

User is not taken, so I can just use that then I guess

hot hull
#

I don't like the fact that I have to specify the values twice due to the update

#

but not sure how I'd even approach that

obtuse gale
#

didnt kotlin have a (1..100).random() function?

#

oh it does im just dumb

hot hull
#

Anyone else wanna judge, since Piggy dead

obtuse gale
#

java

hot hull
#

Okay 4head

prisma wave
#

No offense

#

But why would you want to use this over an actual ORM

hot hull
#

u talking to me?

obtuse gale
#

Anyone used ngrok before?

#

I used it once before and its not working for me anymore

#

basically the paypal api to send test webhooks requires a https url and obviously my localhost doesnt have that, so in past ive used ngrok to like forward it to a secure site first then to my ip, but now the request is coming through, but my spring app isnt picking it up

frigid badge
#

I've used it

#

then your ngrok isn't setup correctly

obtuse gale
#

if I go directly to the URL I get the expected GET method not supported, which is good

#

but when i chuck it in the paypal webhook simulator the POST request shows up on my ngrok console, but my rest controller doesnt print anything

#

If I send the webhook to myself locally via postman it does work

#

so its not a problem with my code, its a problem with this

frigid badge
#

does spring console show anything?

obtuse gale
#

if its the first time im sending it it does something like this

#
2020-11-19 22:28:17.627  INFO 7548 --- [io-42069-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-11-19 22:28:17.627  INFO 7548 --- [io-42069-exec-2] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2020-11-19 22:28:17.631  INFO 7548 --- [io-42069-exec-2] o.s.web.servlet.DispatcherServlet        : Completed initialization in 4 ms```
frigid badge
#

and if you use a rest client?

#

to send a post request to test

obtuse gale
#

oh wait no it doesnt show that lol

#

thats from something before

#

and if I use something like PostMan to send the request to localhost:42069/paypal it works

frigid badge
#

not localhost

#

to ngrok

obtuse gale
#

yeah that fails as well

frigid badge
#

what's your ngrok command

#

and is spring working with tls

obtuse gale
#

ngrok.exe http 42069

#

idk how tls or whatever that works so idk what u mean by that second question

frigid badge
#

you are using the https url right

obtuse gale
#

yeah ofc

frigid badge
#

go to localhost:4040 and inspect the requests

obtuse gale
#

and paypal says Your event has been successfully queued at November 19 2020, 22:37:04

#

nothings coming up in the ngrok console at all now

#

or localhost:4040

#

stuff used to come up, it just stopped tho :/

frigid badge
#

restart ngrok

obtuse gale
#

still nothing

#

manually going to the URL obviously shows the GET request

#

hm

#

now sending it through ngrok via postman works

#

its just not wokring on the paypal website

#

๐Ÿ˜ฎ

#

hold up

#

I just got one from the paypal website

#

but now no more are coming through :/

obtuse gale
#

hm

#

according to paypal the webhook is pending

#

but why....

#

ugh I need sleep but if I dont finish this now ill lose all motivation to do it

#

so we got a problem

#

no, we don't got a problem

#

you got a problem reversed_fingerguns

#

plus paypal is like the whitest website ever

#

ok now ones saying it got through but it didnt :/

#

cold shower time reversed_fingerguns

quiet depot
#

@hot hull looks fine, but like bm said, orm

hot hull
#

Time to use Hibernate then fingerguns

quiet depot
#

rpf >

hot hull
#

Shut up, you said you don't recommend it's usage

quiet depot
#

i will one day

hot hull
#

Soonโ„ข๏ธ amirite

#

Just like with papi3 coming out in 2030

quiet depot
#

yes

frigid badge
#

nice thing about papi3 being slow is ecloud can be slow too which fits my needs since time is a spare thing

#

so I am very happy with you piggy

#

๐Ÿ˜›

hot hull
#

Okay mr slacker

normal talon
#

when is papi 3

hot hull
#

Just like with papi3 coming out in 2030

frigid badge
hot hull
#

smh

obtuse gale
#

ngrok still no work :((

#

Its just paypals not working with it

#

it now works if I send it locally off something like PostMan

frigid badge
#

could try using localtunnel

#

instead of ngrok

quiet depot
#

could try port forwarding

#

instead of using weird tunnels

frigid badge
#

for testing?

quiet depot
#

yeah

frigid badge
#

nah

quiet depot
#

i mean could be worth a try

#

maybe paypal blocks ngrok for whatever reason

frigid badge
#

doubt that but possible

#

I never really have this problem since we have test servers for this

#

but I've used ngrok before and it's useful

obtuse gale
#

ive used it before for pp

quiet depot
#

pp

frigid badge
#

big pp

quiet depot
#

smol pp

obtuse gale
#

smol pp definitely

frigid badge
#

I love how netstat is telling me there is no service listening on 8090

#

but docker is like nah bruh there is

quiet depot
#

oh hey i'm on linux now so I can use docker without weird hacks

#

probably still won't though, sorry to disappoint you lemmo

frigid badge
#

smh

obtuse gale
#

nothiung from localtunnelk

#

oh wait

#

yes

#

something from localtunnel

frigid badge
#

why did you need weird hacks tho

quiet depot
#

cuz i have windows home

#

and docker only works on windows pro

#

unless u do fancy stuff

frigid badge
#

not anymore

obtuse gale
#

localtunnel works it seems

quiet depot
#

oh

frigid badge
#

it used to require hyper-v

#

which is a pro thing only

#

which I mean you can easily get pro 4 free

quiet depot
#

how

frigid badge
#

I made a batch script the other day

#

which gives enterprise iirc

#

but you don't need it anymore since it can run on wsl2

quiet depot
#

tbh i'm just waiting for the department of education in western australia to allow students to download windows education edition from onthehub

#

was meant to happen ages ago

#

still hasn't happened

frigid badge
#

I gave Gaby windows too

#

using that script lol

#

what does windows education give

quiet depot
#

it's just enterprise

frigid badge
#

just pro 4 students

#

ah

quiet depot
#

well

#

it's enterprise without cortana

#

although I'm not sure if enterprise has cortana either

#

idk I haven't checked for ages

frigid badge
#

yeah it does

#

I have it

#

but I've never used it lol

#

who would anyway

normal talon
#

what is cortana I have that too

quiet depot
#

I tried it out for fun

#

see if I could get a little jarvis thing going on

frigid badge
#

cortana, please ssh into server1

quiet depot
#

yeah well I have buttons to do that so nah

frigid badge
#

i just type ssh server1

#

I just add them to my ssh config

quiet depot
#

well yeah

#

same

#

but I've got shortcuts on my task bar for important servers

frigid badge
#

ah yeah I don't ;p

quiet depot
#

I honestly don't get why people use shit like mobaxterm, the cli ssh client is great

frigid badge
#

I hate cluttering taskbar

quiet depot
#

windows is already a clusterfuck so I don't see any harm in having them

frigid badge
#

I just have a terminal open

#

or open one ALT + SPACE and type cmde and we're done

quiet depot
#

back when I was trying to get it there was no "pro education"

obtuse gale
#

Windows 10 has twelve editions

quiet depot
#

it was just education, and it actually had more features than enterprise iirc

obtuse gale
#

what

frigid badge
#

yeah now enterprise has more features than education

quiet depot
#

sad

frigid badge
#

not that any are useful

quiet depot
#

I only ever wanted it for remote desktop

young kettle
#

How could I go about paying someone to make an alteration on an open source plugin or make a sub plugin for that

#

This of course not being a plugin theyโ€™ve likely dealt with

quiet depot
young kettle
#

Do people do that sort of thing though

quiet depot
#

yes

young kettle
#

With plugins they donโ€™t know

#

Ah ok I might give that a shot then

#

Thanks !

static zealot
#

well if they're an actual dev then they can work with code that they've not seen before as long as the code is not actual trasgh

#

trash*

obtuse gale
#

I have dealt with literal trash code before

#

Let me look it up lol

#
if (main.getUils().secondes == 9 || main.getUils().secondes == 8 ||
    main.getUils().secondes == 7 || main.getUils().secondes == 6 ||
    main.getUils().secondes == 5 || main.getUils().secondes == 2 ||
    main.getUils().secondes == 3 || main.getUils().secondes == 4 ||
    main.getUils().secondes == 1 || main.getUils().secondes == 0)
#

I keep that pinned for a reason ๐Ÿฅฒ

quiet depot
#

beautiful

hot hull
#

Such beauty

#

Pulse, don't you dare

forest pecan
#

I was trying to sort a concurrenthashmap because i wanted to perform a binary search on it a couple years ago

#

lmfao

obtuse gale
#

I love how the dude managed to swap 2 with 4 and still get it working

forest pecan
#

who made it doe

quiet depot
#

jon skeet

obtuse gale
#

can't disclose

forest pecan
#

not me ๐Ÿ˜›

obtuse gale
#

all I'll say is that it's out there on github.. sadly

forest pecan
#

ay

hot hull
#

Can I get an example of how I should be using the @Contract annotation

forest pecan
#

show me the repo

obtuse gale
#

oh and it's a paid plugin

quiet depot
#

why can't you disclose?

forest pecan
#

Its paid?

#

I would go into the review section and kick em ass

#

sad that premium plugins are like this

obtuse gale
#

xD I mean it's nothing serious, I just don't want to go around saying names

forest pecan
#

Let me guess

#

it was Fofe

obtuse gale
#

nope

forest pecan
#

Pulse?

quiet depot
#

@hot hull

@Contract("null -> null")
public String toLowerCase(String param) {
    if (param == null) {
        return param;
    }

    return param.toLowerCase();
}```
#

if the first param is null, the method will return null

obtuse gale
#

!null -> !null :^)

forest pecan
#

lol

static zealot
#

Just say it! I know you want to say it! its BlitzGamer_88 isn't it?

#

You think my code is trash don't you Fefo? ๐Ÿ˜ฆ

hot hull
#

Much thanks sir

obtuse gale
#

ooh he took the repo down

#

F

forest pecan
#

LOL

quiet depot
#

fefo there's no shame in shitting on other's code, and publicly calling them out on it

forest pecan
#

What plugin is it though

obtuse gale
#

okay the dude isn't here

#

cool

quiet depot
#

even if they were here, give em a tag

#

let them know

#

no shame my dude

forest pecan
#

Its 4.5 stars

#

6.50 euros

#

and 182 downloads

obtuse gale
#

the dude has a skript authme resource??????

#

๐Ÿคฎ

hot hull
#

He deserves to be shat on

forest pecan
#

Fefo

obtuse gale
#

let me bring that down

forest pecan
#

how many positive ratings you have

#

on spigotmc

obtuse gale
#
if (main.getUils().secondes == 9 || main.getUils().secondes == 8 ||
    main.getUils().secondes == 7 || main.getUils().secondes == 6 ||
    main.getUils().secondes == 5 || main.getUils().secondes == 2 ||
    main.getUils().secondes == 3 || main.getUils().secondes == 4 ||
    main.getUils().secondes == 1 || main.getUils().secondes == 0)

there we go

#

๐Ÿฅฒ

hot hull
forest pecan
obtuse gale
#

replies feature when

forest pecan
#

/*
 * This file is part of the BetterJails (https://github.com/Fefo6644/BetterJails).
 *
 *  Copyright (c) 2020 Fefo6644 <federico.lopez.1999@outlook.com>
 *  Copyright (c) 2020 contributors
 *
 *  BetterJails is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, version 3.
 *
 *  BetterJails is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
quiet depot
#

I saw a university professor asking on spigot for good projects for his students to pr to, so they can see a codebase with good structure & general quality

forest pecan
#

\๐Ÿ˜‰

quiet depot
#

little does he know there's only like 2 projects in the minecraft community that roughly fit that description

obtuse gale
#

yeah but that's for the remake, pulse

#

the other source didn't have those headers lol

hot hull
#

Piggy, got a sec to show me of how you'd use a new keyword in the Contract, the link doesn't go in depth with it, and I'm confused

forest pecan
#

o lol

obtuse gale
#

@Contract("_ -> new") means "no matter what the argument is, this always returns a new object"

quiet depot
#

e.g.

#
@Contract("_ -> new")
public <K, V> Map<K, V> newHashMap(int size) {
  return Maps.newHashMap(size);
}```
obtuse gale
#

or @Contract("true -> new; false -> fail") "if the (boolean) argument is true, it'll return a new instance of something, if it's false, it'll throw an exception"

hot hull
#
@Contract("null -> null; _ -> new")
public Object newObject(someparam param) {
  return param == null ? null : new Object(param);
}

this would be correct then yes?

quiet depot
#

yes

hot hull
#

cool

obtuse gale
#

eeeh not quite?

#

_ implies null as well

#

should do null and !null

quiet depot
#

o

hot hull
#

I see

#

So _ would be any kind, and the null/!null would be just those

obtuse gale
#

ye

#

For example, I have these methods

// no matter the value of the two args (null or not), it'll return a new object
@Contract("_, _ -> new")
public static <T, U> @NotNull Pair<T, U> of(@Nullable final T first, @Nullable final U second) {
  return new Pair<>(first, second);
}

@Contract("null -> null; !null -> !null")
public static @Nullable String sanitize(@Nullable final String string) {
  if (string == null) {
    return null;
  }

  return /* something with the string idk */;
}
quiet depot
#

ew

#

move @Nullable & @NotNull up

obtuse gale
#

no u

quiet depot
#

but it's inconsistent

obtuse gale
#

I see it as "it'll return a nullable/notnull pair/string"

quiet depot
#

also do contracts override @Nullable?

obtuse gale
#

not as a "this entire method" thing

#

also do contracts override @Nullable?
no idea lmfao

quiet depot
#

I don't think they do, which is why I straight up don't use contracts in my code

#

partial reason actually

obtuse gale
#

apparently they do

quiet depot
#

second reason is i cba

#

well that's nice to know

#

I can get rid of my first reason

obtuse gale
#

that's good to know

frigid badge
#

yes finally people using contract annotations

obtuse gale
#

"hey dude this is wrong, like.. VERY wrong"

hot hull
#

Quick question tho, if I have a param annotated with NotNull, should I still have a contract stating that it'll fail if the param is null, or is that unnecesarry?

obtuse gale
#

Well... it'll be highlighted saying "but the arg is annotated as NotNull"

#

And I mean, fair enough, it is explicitly annotated as notnull

#

Sort of implying it'll fail

#

idk lol

hot hull
obtuse gale
#

aa

#

yes

normal talon
#

how do you null check

hot hull
#

It shouldn't be null, but just in case

obtuse gale
#

Thing is

#

the varargs itself will never be null

#

unless you explicitly (Object[]) null

hot hull
#

Well yes, but you could still pass in null

obtuse gale
#

but passing no arguments will give a valid array still

steel heart
#

For example, I have these methods

// no matter the value of the two args (null or not), it'll return a new object
@Contract("_, _ -> new")
public static <T, U> @NotNull Pair<T, U> of(@Nullable final T first, @Nullable final U second) {
  return new Pair<>(first, second);
}

@Contract("null -> null; !null -> !null")
public static @Nullable String sanitize(@Nullable final String string) {
  if (string == null) {
    return null;
  }

  return /* something with the string idk */;
}

@obtuse gale having notnull and nullable there is nice ngl

hot hull
#

But that would just be an empty list in the end, with no null objects tho?

#

or am I missunderstanding

obtuse gale
#

it would be an empty list, yes

hot hull
#

Meaning it's not null

obtuse gale
#

Correct

hot hull
#

Meaning the contract still stands

obtuse gale
#

basically:

method()                == method(new Object[] { }) // no args
method((Object) null)   == method(new Object[] { null }) // null args
method((Object[]) null) == method((Object[]) null) // null array
hot hull
#

:what: lmao

steel heart
#

contracts are horrifying when you have methods with like many params

#

so basically just notnull or nullable is nice

obtuse gale
#

nicer

steel heart
#

sure if you have like a supplier method or just wanna be explicit to the compiler why not

hot hull
#

So should I be using both Contracts and NotNull/Nullable, or either or?

obtuse gale
#

I like being pedantic

steel heart
#

If you want both

obtuse gale
#

so I just use both lol

steel heart
#

make sure they don't overlap each and other then

hot hull
#

Looks nicer with both ngl

#

Makes the code look more "advanced" fingerguns

obtuse gale
#

make sure they don't overlap each and other then
:wat:

steel heart
#

but ffs dont have the nullable or notnull above the @neat pawntract it should be before the returning type like fefo tbf

#

yeah

obtuse gale
#

xDD

#

wasn't also there a dude @harsh kettleable

#

YES

steel heart
#
@Contract("null -> null; !null -> null")
@NotNull T get(T t) {
  return null;
}
``` or smtng
obtuse gale
#

_ implies null as well

steel heart
#

yeah

obtuse gale
#

aa there you go

steel heart
#

im just unused to the contracts

obtuse gale
#

they nice

steel heart
#

ye

obtuse gale
#

Looks nicer with both ngl
Makes the code look more "advanced" fingerguns

steel heart
#

Well I'm an anti annotation dev

obtuse gale
#

I'm not anti annotation tbh, I just don't like those that define a program's behavior

#

e.g. acf

steel heart
#

lombok

obtuse gale
#

oh god

#

no

steel heart
#

spigot discord fkn glorifying it

obtuse gale
#

I see annotations more like "sticky notes" for both the compiler and the end api user

steel heart
#

Yeah ig

obtuse gale
#

And let the actual code do the thing

hot hull
#

heck out with lombok

steel heart
#

I mean when there is no more convenient way than to use annotations then its fine

frigid badge
#

cloning databases takes sooo longg

hot hull
#

Lemmo, so regarding the todo list, gonna have to delay it for a while

frigid badge
#

ah yeah take whatever time u need lol, it's not that someone actually needs it

hot hull
#

You do fingerguns

#

You just don't know it yet

frigid badge
#

ofc

#

totally forgot about myself

#

yes I need it badly

hot hull
#

I already know my 2021 new year resolutions. get hired by Lemmo's company so I can bully him

frigid badge
#

lmao

young kettle
#

dunno if anyones able to gauge from quickly looking at it

hot hull
#

Opened the first class, already wanna vommit

young kettle
#

really lol fkk. odds on me getting someone (payed) to make a small addition?

#

il ask in the forum part later when ive got more info on it from the dev

#

basically adding custon wg flags to the wg flag that that fields can use

hot hull
#

Depends how much you're spending, and what the addition is

young kettle
#

ah ok

#

il get a better idea of how it can be done from the dev whos on a long term haitus i think.

obtuse gale
#

holy

steel heart
#

moly

hot hull
#

Another data question boiz, so what would be an optimal way for caching data, should I load all data in a map, even though some data may never get used (let's say a couple thousand objects), or should I have an expiry cache which querries data uppon request, stored them in the cache and if it exists uppon request retrieves from that cache (otherwise it querries and puts into the cache)

steel heart
#

yeah

#

last one

#

use a LoadingCache by guava

hot hull
#

So an expiry cache

steel heart
#

ye

obtuse gale
#

I mean depends on the size of the objects ig

hot hull
#

Not that large, there's just gonna be a lot of them

obtuse gale
#

a couple thousand can be either a few kB or several MB

hot hull
#

I feel like it's pointless to have them all loaded since they won't get used (let's say like 30% will ever get used ish)

steel heart
#

LoadingCache

hot hull
#

oh that's fancy

#

I've got an issue tho ;C

#

I've got two tables from which the data would be loaded, and it'd be kinda pointless to querry both, since I could just specify from which one, but this mf doesn't allow for multiple params

#

@steel heart help!

frigid badge
#

for caching redis can also be used

hot hull
#

Elaborate

obtuse gale
#

no

#

you have to guess

distant sun
#

@frigid badge do you know py?

prisma wave
#

If you know any other language you pretty much know python

steel heart
#

Except if youโ€™re blitz

distant sun
prisma wave
#

line 636 ๐Ÿ˜

distant sun
#

ye ๐Ÿ˜ฆ

prisma wave
#

You're trying to cast None to an int

distant sun
#

not my code though

#

I see smh

prisma wave
#

Find out why it's None

#

Make it not None

#

๐Ÿ‘ ๐Ÿ™‚

hot hull
#

This lazy mf

distant sun
#

shut un frcsty

hot hull
#

Why you need a Teams Auto Joiner lmao

prisma wave
#

int(log_level) so log_level is none

#

Perhaps missing a required module?