#dev-general

1 messages ยท Page 95 of 1

obtuse gale
#

she can't find sum if digits in a string english

#

yes

hot hull
#

Java loses here ,-,

jovial warren
#

any rules for shortest mode?

old wyvern
#

Ill join in later

hot hull
#

Nah, just do what you want

obtuse gale
#

"non-decreasing"

old wyvern
#

have to finish a project

obtuse gale
#

Isnt non-decreasing increasing lol

#

this is kinda like the one i failed last night as well lol

hot hull
#

yes

prisma wave
#

I'll join soon

#

In the car rn

#

@topaz bay there's some ambiguity there. What would happen if Object had 2 methods that returned String?

topaz bay
#

I thought of that too, but I'm speaking purely theoretical

prisma wave
#

Theoretically it sounds cool

topaz bay
#

It would still be possible to use reference syntax

prisma wave
#

But could also be a gimmick

topaz bay
#

Well everything high level is gimmicky

prisma wave
#

True

#

I think you could take some elements of that and it would be nice, but at the moment there's way too much ambiguity to be practical

#

It's like type coercion on steroids

topaz bay
#

I would say its more like type inference on steroids

prisma wave
#

Somewhat

topaz bay
#

Its technically the same logic as any 0 param, void function being compatible with being passed as Runnable

prisma wave
#

That's fine though because it's more explicit what you're doing

ocean quartz
#

Damn I beat python

prisma wave
#

Function<Object, String> is very vague as to what the function actually entails

jovial warren
#

I've just been beaten by Kotlin

obtuse gale
#

oh god

prisma wave
#

Ha

hot hull
#

Does util not contain Collectors lmao?

obtuse gale
#

i know ive done this a really weird waty

jovial warren
#

probably because I can't code for the life of me

obtuse gale
#

I think I have an unhealthy obsession with lists

prisma wave
#

Collectors are java.util.stream I thought

topaz bay
#

@prisma wave well its a function that takes in an object, and returns a string

prisma wave
#

Well yes

obtuse gale
#

oof

prisma wave
#

But there's no saying what the function actually is

topaz bay
#

The notation would technically be Function<T, String>

distant sun
#

@jovial warren smh we said no py for shortest -.-

jovial warren
#

I still got beat gaby

#

and no we didn't

distant sun
#

idm

obtuse gale
#

lol compare mine to matts tho

topaz bay
#

Well thats the same without this system no?

prisma wave
#

Well not exactly

ocean quartz
#

Aj wtf is this e.forEach a@{

topaz bay
#

It doesnt really matter what it entails, the contract is that it takes some type, and outputs a string

obtuse gale
#

lol

#

so i can return@a

#

idk if i did that right tho lol

prisma wave
#

Object::toString is clearer than pulling a Function out of nowhere

ocean quartz
#

Java loses like half solely on the imports

distant sun
#

:))

prisma wave
#

Very sad

#

I actually kinda love js

ocean quartz
#

Burn

prisma wave
#

It's fast and the type system actually works really well on the shortest ones

distant sun
#

yup

ocean quartz
#

Also why yall using contains("+")?

distant sun
#

does java like when you ask it to split on a char that doesn't exist?

ocean quartz
#

If the character is not present it only adds the string to the first index of the list/array

distant sun
#

hmm

jovial warren
#

||print("+".join(sorted(input().split("+"))))|| that might actually work idk ๐Ÿค”

#

yeah that should work

hot hull
#

;c

jovial warren
#

that's what I should've done

distant sun
#

show code

jovial warren
#

and it's 43 characters

distant sun
#

brb

jovial warren
#

oh and that code works as well

hot hull
#

Join Bardy

jovial warren
#

I have

obtuse gale
#

no clue how to do this lol

hot hull
#

Imma lose

ocean quartz
#

This one is pretty hard to make small

jovial warren
#

yeah

obtuse gale
#

i dont even know how to make it big lol

hot hull
#

What?

obtuse gale
#

imma fail

hot hull
#

Y'all good?

obtuse gale
#

NO

#

absolutely not

jovial warren
#

trying to compact this

obtuse gale
#

trying to make this work lol

ocean quartz
#

This one is awful

hot hull
#

just get the char at the int

#

Compacting is the hard part

obtuse gale
#

im getting an arrayindexoutofbounds lol

#

cos of that first int

hot hull
#
  • 1
obtuse gale
#

dont i just need to completely ingnore that first int?

#

actually dont worry lol

#

this works

hot hull
#

2:30 left

obtuse gale
#

i feel ive done mine a weird way again lol

#

bruh

#

i messed my thing up

#

it worked for the tests lol

#

then i changed something and didnt double check

jovial warren
#

72 chars will have to do

hot hull
#

rip

jovial warren
#

I swear if I get beaten by Kotlin again

hot hull
#

lol

jovial warren
#

@ocean quartz 30 seconds

#

yeah my method was kinda cheese

hot hull
#

Matt, you could've gotten way more if you made a 1 liner :p

#

I took 100 chars of with cramming it into 1 lin e

jovial warren
#

nah 1-liners don't matter

hot hull
#

line*

ocean quartz
#

Can't do that

hot hull
#

brb

jovial warren
#

it counts chars not lines

ocean quartz
#

Plus \n doesn't count

jovial warren
#

and \n doesn't count yeah

ocean quartz
#

I had a shorter version but didn't manage to get it to accept it

#
readLine()
val c = readLine()!!.toCharArray()
val p = readLine()!!.split(" ").map { it.toInt() }.forEach { print(c[it]) }
jovial warren
#

forEach returns null doesn't it?

ocean quartz
#

It was incomplete

prisma wave
#

It returns Unit

ocean quartz
#

It'd return unit

jovial warren
#

which is pretty much the same as null BM

#

or void

prisma wave
#

Not really

#

Unit is an object

jovial warren
#

it's void sorry my bad

prisma wave
#

Null isn't

#

yeah Unit = void

jovial warren
#

void, not null

prisma wave
#

but better

jovial warren
#

void just means do nothing

#

null means it has nothing

#

or there is nothing

prisma wave
#

Void means it returns nothing

#

Null is a lack of value

#

Unit is Void but with a value

#

Which has some benefits

#

And don't get me started on Nothing

#

That's black magic

onyx loom
#

elucidate

jovial warren
#

uses for Unit are: being able to set it as the value of an expression body for a method you don't want to implement

#

for methods that you actually don't need but need to be implemented anyway

obtuse gale
#

lol what the fuck

prisma wave
#

@onyx loom you wish to learn the black magic of Nothing?

hot hull
#

Binary

#

nice

onyx loom
#

YES

#

please elucidate

prisma wave
#

Gladly

#

Nothing represents a function that will never return

#

So for example ```kotlin
fun nothing() {
throw Exception()
}

#

This function returns Nothing

#

And Nothing can be any value

obtuse gale
#

lol ive got no clue on this one btw

prisma wave
#

for example ```kotlin
val x: Int = nothing()

jovial warren
#

done

#

lol

prisma wave
#

This compiles fine, as Nothing is a sub type of every type

jovial warren
#

you mean supertype?

obtuse gale
#

look its safe to say i wont be able to do this lol

jovial warren
#

in python you literally just substring it and convert it to hex

#

||t = input()[2:] followed by print(hex(int(t, 2)))||

hot hull
#

Is it not this? Integer.toHexString

jovial warren
#

might work

hot hull
#

It don't tho

obtuse gale
#

its not an int in the first place tho

jovial warren
#

you can convert a base 2 int to base 10 with ||Integer.parseInt(binarystring, base)||

#

then you might be able to print that to hex using that method you mentioned frosty

#

||System.out.println(Integer.parseInt(Scanner.next(), 2).toHexString())|| might work?

#

idk

#

actually no because you need to prefix it with 0x, though you would've thought it would do that itself

ocean quartz
#

You'll need to remove the 0b from the binary as well

prisma wave
#

@jovial warren subtype

#

What's the question?

jovial warren
#

yeah that's easy, just substring it

#

basically convert 0b1101 to 0xwhateverthefuckitisinhex

ocean quartz
#

Binary to hex bm

prisma wave
#

Hm

#

I think we've had this one before

ocean quartz
#

Mine
||```Kotlin
fun main(args : Array<String>) {
val input = Scanner(System.in)
val T = input.nextLine().replace("0b", "")
println("0x"+Integer.toHexString(Integer.parseInt(T, 2)))
}

jovial warren
#

in python that's just:

t = input()[2:]
print(hex(int(t, 2)))
prisma wave
#

Iirc my solution was just a substring, parse in binary, "0x"+toString(16)

#

Seems fairly simple

jovial warren
#

yeah python has some really simple methods, like being able to parse strings to integers and specify the base

#

and the built-in hex() method

prisma wave
#

Java can do that too

#

Somewhat

jovial warren
#

yeah but no where nearly as compact as python does it

prisma wave
#

True

#

But python bad

jovial warren
#

python is useful for things like this

hot hull
jovial warren
#

because it's easy to write, super compact and kinda lightweight, and runs quite fast

#

you need to prefix it with 0x @hot hull

#

||"0x" + Integer.parseInt(Scanner.next(), 2).toHexString()||?

#

hmm...

hot hull
jovial warren
#

"0x" + Integer.toHexString(Integer.parseInt(Scanner.next(), 2)) looks about right

#

no idea how it parses things

#

you did remove the 0b at the beginning right?

hot hull
#

Jesus this was dumb, and ye I did

jovial warren
#

it was a bit annoying yeah

jovial warren
#
t = input()[2:]
print(hex(int(t, 2)))

that was it in Python @hot hull lol

hot hull
#

@ocean quartz

#

@obtuse gale

ocean quartz
#

I'll pass on this one, will play again later

jovial warren
#

oh fuck reverse mode

#

oh it's US phone number formatting

obtuse gale
#

gotta do smthn quickly

jovial warren
#

no idea

#

not no idea how to solve, no idea how regexes work in Python

hot hull
#

ew regex

jovial warren
#

show code then

hot hull
#

nuh, mine is ugly af

jovial warren
#

just do it

#

everyone else does

hot hull
#

shared code

#

Now be disguisted

distant sun
#

is it the one that the output have to be (###) ### ####?

jovial warren
#

yeah

#

guess it works frosty

hot hull
#

(###) ###-####

distant sun
#

I just used substring :))

jovial warren
#

should've probably used a regex

hot hull
#

Could've, but ah

jovial warren
#

or substring I guess, that works too

distant sun
#

guess substring also work

jovial warren
#

go there to test regexes

distant sun
#

([\d]{3})([\d]{3})([\d]{4})

#

much easier smh

jovial warren
#

yeah

#

oh and it uses mongodb

#

and docker

#

npm+nginx+mongodb+docker sounds like my worst nightmare

#

should probably just write my own

distant sun
#

:))

prisma wave
#

Docker is good

distant sun
#

hey km

prisma wave
#

Are you guys still playing btw?

#

Hello

jovial warren
#

docker is annoying as fuck

distant sun
#

nah

prisma wave
#

:(

#

Anyone up for some more now I'm back?

jovial warren
#

I gotta work on writing my own pastebin software

prisma wave
#

Alrighty

old wyvern
#

Im in

#

for a few

prisma wave
#

Yay

prisma wave
#

i gotta reinstall my OS at some point

#

turns out it's been on my hard drive this whole time

#

so my SSD has been useless

old wyvern
#

lol

#

@jovial warren @hot hull You guys in?

jovial warren
#

@prisma wave perfect time to switch to arch

prisma wave
#

could be

#

i'm dreading the idea of wifi drivers though

onyx loom
#

wait what

jovial warren
#

does this do what I think it does

onyx loom
#

i wanna reinstall my OS too

#

didnt reinstall when i changed my cpu

jovial warren
#

what you running?

#

trashdows 10?

onyx loom
#

yes

jovial warren
#

if you wanna reinstall try a linux distro

onyx loom
#

no

jovial warren
#

why not?

prisma wave
#

genuinely

#

wtf is going on in this one

hot hull
#

What's the pattern here lol

#

Ah I see

onyx loom
#

windows for life im sorry bardy

old wyvern
#

wtf is going on in this oneIts simpler than it looks tbh dont overanalyze it

#

||check output for odd/even||

prisma wave
#

oh ffs

#

I swear I tried that and it didn't work

old wyvern
#

xD

prisma wave
#

@jovial warren regarding arch, what is the sitation regarding things like KDE? I am considering switching but I find things like KDE Connect useful. Are these usable on Arch (without a desktop environment)?

hot hull
#

idfk anymore

prisma wave
#

it was very simple lol

#

well that sucked

prisma wave
#

where did everyone go lol

old wyvern
#

no idea

#

@hot hull @jovial warren You guys coming?

#

ayy gaby is in

prisma wave
#

get in here NOW

#

or there will be trouble

distant sun
#

yo

prisma wave
#

yo

old wyvern
#

oy

distant sun
#

this is @topaz bay

prisma wave
#

looks just like him

topaz bay
#

Bitch

#

How dare you

hot hull
#

Yes. Don't mind about doors and windows, paint them all!

jovial warren
#

@prisma wave you can fully install KDE on arch if you want, but most tools like what (idk what it does) are usually available through another third-party program

old wyvern
#

ew

#

75

prisma wave
#

bad

old wyvern
#

what did I fuck up this time? oof

distant sun
#

50 :))

prisma wave
#

@jovial warren hm alright. I quite like the KDE software so ideally will still use it. I guess i'll try i3 and if I really dislike it I'll install a proper DE

distant sun
#

oh forgot to divide by 5

#

fuck

old wyvern
#

(Q*5/totalVol > 0)That should be the same as Q*5 >=totalVal

prisma wave
#

smh

#

imagine not doing all the tests before submitting

distant sun
#

I did smh

old wyvern
#

I did all the tests

hot hull
#

Sorry I had to submit lmao

prisma wave
#

oh lol

old wyvern
#

it passed all

distant sun
#

2 of them failed xd

old wyvern
#

im confused

prisma wave
#

bad website

hot hull
#

Just to get that 100 75 50 25

old wyvern
#

nah

distant sun
#

:))

old wyvern
#

I have something wrong probably

#

fuck

prisma wave
#

aha

old wyvern
#

oh wait I found the issue

#

๐Ÿ‘€

#

dammit brackets

prisma wave
#

@distant sun get in here

#

stop helping people

distant sun
#

cmon b1tch3s

prisma wave
#

let's gooo

distant sun
#

nah fuck shortest mode

old wyvern
#

Python not allowed right?

distant sun
#

no ๐Ÿ˜ฆ

prisma wave
#

nope

old wyvern
#

alrighty

prisma wave
#

oof 285

distant sun
#

ye gtg

prisma wave
#

ok cya

old wyvern
#

dead

#

welp ill play again after a bit

prisma wave
#

ok

#

me too

frigid badge
#

maybe Iโ€™ll join later tonight

prisma wave
#

yes

#

join

#

it's fun

lunar cypress
#

So will I in order to distract myself from learning UML

hot hull
#

I't snot

heady birch
#

@frail glade you got access to papi github?

frail glade
#

No

#

What's papi

onyx loom
#

dadi

frail glade
#

Never heard of it

jovial warren
#

lol

prisma wave
errant geyser
#

Holy shit

#

Your actually doing it

prisma wave
#

yep

#

I did say

errant geyser
#

I didn't expect this level of dedication

hot hull
#

You're*

errant geyser
#

Shut up Frosty

hot hull
#

:))

prisma wave
#

I'm very dedicated to procrastinating

old wyvern
#

Fros tea*

errant geyser
#

Just cos you aren't as cool as KM ๐Ÿ˜Ž

prisma wave
#

nobody is as cool as KM ๐Ÿ˜Ž

hot hull
#

BM follows me, meaning I'm cooler

#

dun dun

errant geyser
#

dun*

prisma wave
#

hmmm

old wyvern
#

I'm coolerYou're frozen

onyx loom
#

good point ^

errant geyser
#

BM when you get around to selecting the, cough, entertainment ima need some samples

prisma wave
#

The entertainment?

errant geyser
#

plays the loudest earrape possible

prisma wave
#

Ah yes

#

I'm kinda scared about that part

errant geyser
#

I'm willing to sacrifice my ears to the cause

hot hull
#
statistics:
  - 'stat.playOneMinute'
  - 'stat.playerKills'
  - 'stat.deaths'
  - 'stat.useItem.minecraft.reeds'
  - 'stat.killEntity.Blaze'

@old wyvern I need a better system for this ,-,

#

Just got the ones I'm actually displaying rn

old wyvern
#

wdym?

#

what do you currently have?

heady birch
#

someone find me a stupid autocomplete that just works

hot hull
#

looping through the above, which is the stats' paths

errant geyser
#

Kite

hot hull
#

Niall, autocomplete for?

heady birch
#

bootstra p4

#

found one beter work

old wyvern
#

@hot hull
Check out Statistic#getType()
It returns one of these

UNTYPED
ITEM
BLOCK
ENTITY```
Everything other than ``UNTYPED`` takes in an argument.
heady birch
#

course it didnt work

old wyvern
heady birch
#

no

#

javascript html

#

I found one

old wyvern
#

wha?

#

ok

heady birch
#

WHAT

old wyvern
#

?

heady birch
#

lol

#

I mena

#

For a website

#

Autocomplete on a input field

old wyvern
#

oh I misunderstood you

late grove
#

How do I make a GUI command, like /shop?

old wyvern
signal tinsel
#

nice

#

The annotation parameter is a String[] of required classes

#

Which the hooks manager just checks with Class.forName

onyx loom
distant sun
#

What meme

onyx loom
#

the greatest of all time

#

dont u agree?

distant sun
#

Yes I do not agree

prisma wave
#

:(

#

You can't disagree

#

It's a fact

distant sun
#

I cant agree either

onyx loom
#

ur lying

heady birch
#

Im looking forward to trying kotlin for javascript

#

worst language ive ever seen

old wyvern
frail glade
#

LOL

old wyvern
onyx loom
#

damn that song is so old now...

#

vibes...

jovial warren
#

lol

lunar cypress
#

@prisma wave

onyx loom
#

yuck

old wyvern
#

it is not readable and it is ugly and thats a fact

hot hull
#

That second one is fucking godly lmao

old wyvern
#

which?

prisma wave
#

@lunar cypress did you make that yourself lol

lunar cypress
#

yeah

prisma wave
#

Ah yeah

#

It seemed very specific

#

@topaz bay

#

Your point about infix being natural is now invalid

jovial warren
#

what?

jovial warren
#

that DNS took way too long to update

old wyvern
#

Where are you hosting it?

onyx loom
jovial warren
#

hetzner @old wyvern

#

I also set the max key length to 4 as you can see to keep the URL short

#

though I probably need to increase it

ruby kernel
jovial warren
#

nope

#

well, they probably have, but I doubt anyone in here has

prisma wave
old wyvern
ruby kernel
#

Thx

jovial warren
#

@prisma wave get out xD

prisma wave
#

Absolutely not

#

I will pollute all your URLs with JavaScript

jovial warren
#

you dare

onyx loom
#

yeah i will too

jovial warren
#

the key length is only 8

#

that's (26+9)^8 possible combinations

prisma wave
#

hastebin has an API

#

Could easily be brute forced

jovial warren
#

try it

#

lol

onyx loom
#

?js-factionname

compact perchBOT
#
FAQ Answer:

Send a different message if the player is factionless

function factionName() {
  var name = "%factions_faction%"; // Replace with the placeholder of your factions plugin
  
  return name == "" ? "" : name + " ";
}

factionName();```
prisma wave
#

I will

#

At some point

onyx loom
#

i believe ur bin service could be filled up with this too

prisma wave
#

ooh

onyx loom
#

some lovely PAPI

jovial warren
#

also, it's rate limited to like 500 connections every 60 seconds or so I think

#

time to up that

prisma wave
#

won't take long to fill them all up

jovial warren
#

actually it's 500 connections every 600 seconds

#

a.k.a 500 pastes every 10 minutes

old wyvern
#

hehe

jovial warren
#

it defaults to 60000 usually

#

but I thought that was way too high lol

old wyvern
#

what characters are allowed for a key?

jovial warren
#

a-z 0-9

old wyvern
#

You can remove saved ones right?

jovial warren
#

afaik

#

yes I think

#

well, I definitely can since they're stored on my redis database

old wyvern
#

2,251,875,390,625nvm

#

xD

jovial warren
#

yeah gl with that

#

okay

#

rate limit increased to 500 connections every 6000 seconds

old wyvern
#

owo

topaz bay
#

...

jovial warren
#

to prevent BM from filling it up

topaz bay
#

Imagine being so hurt about prefix notation that you make that

jovial warren
#

I could increase it to say 5000 connections ๐Ÿค”

onyx loom
#

yeah i give up

#

atleast we filled it up a little

#

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

jovial warren
#

1000 connections every 6000 seconds

prisma wave
#

I will brute force it at some point

onyx loom
#

lmao

prisma wave
#

And get a vps

jovial warren
#

it'll take you ages but sure

old wyvern
#

I mean we can keep it to not work

jovial warren
#

I can increase the key length you know that right

prisma wave
#

Even so

old wyvern
#

But you still limit it right?

#

is the limit per ip?

prisma wave
#

It will be a remarkable achievement

jovial warren
#

idk Yugi

#

I didn't make hastebin

old wyvern
#

lets test that

jovial warren
#

I'll dig it up

#
// Rate limit all requests
if (config.rateLimits) {
  config.rateLimits.end = true;
  app.use(connect_rate_limit(config.rateLimits));
}
#

that's the code for it if that helps anyone bypass it lol

old wyvern
#

what if we just keep it at ratelimit always?

jovial warren
#

what?

old wyvern
#

500 connections every 6000 seconds

jovial warren
#

it's 1000 connections now

old wyvern
#

I mean whatever it is set to

#

Lemme try to show u an example

#

one sec

jovial warren
#

also, looks like it uses connect-ratelimit for rate limiting

old wyvern
#

not sure if this will work tbh

jovial warren
#

now for the images

#

BM didn't you say all I have to do is serve images over HTTP?

old wyvern
#

@jovial warren its down?

jovial warren
#

shouldn't be?

old wyvern
#

weird

#

yup its down @jovial warren

#

xD

jovial warren
#

ik why

onyx loom
#

we crashed the site

jovial warren
#

caddy failed to start because I forgot to generate an SSL cert for a new CNAME record I didn't add

onyx loom
#

lets gooooo

jovial warren
#

please don't get rate limited by let's encrypt

old wyvern
#

why?

jovial warren
#

I've been rate limited for requesting too many certs

#

this is what happens when you don't gen your cert and add your cname before starting your web server

prisma wave
#

Rip

jovial warren
#

it's fine

#

I can still start it

#

just without the config for i.bardy.me, which is gonna be for my image server, though I should probably just use img.bardy.me now

#

it's back up now

old wyvern
#

its still dead

jovial warren
#

it isn't

#

maybe your cache is out of date

#

it's perfectly fine for me

old wyvern
#

I mean its up but it wont load up

#

nvm

jovial warren
#

it works!

old wyvern
#

what works?

jovial warren
#

the image thingy

#

it's just serving images over HTTPS

#

and I'm using rsync to upload them via SFTP

prisma wave
#

Image servers ez

jovial warren
#

yeah

#

that's the command I ran

#

it's in that screenshot

onyx loom
#

Memory: 4.9 GiB / 3.6GiB

#

???????????????

jovial warren
#

yeah no idea

#

lemme look at that lol

#

that should be %used / %total but it obviously isn't

#

%used / %available that might explain it

hot hull
#

Some witchcraft

jovial warren
#

it's displaying the used ram / the available ram lol

#

bigbrain over here

onyx loom
#

frosty just mad cus ur using more ram than hes allowed laugh

jovial warren
#

lol

hot hull
jovial warren
onyx loom
jovial warren
#

there we go

#

that's better

onyx loom
#

wew

jovial warren
#

now, I should probably get to work on colouring my terminal with zsh lol

old wyvern
#
https://bin.bardy.me/v3SXkkhm
https://bin.bardy.me/RKJYpaGz
https://bin.bardy.me/PWtuNUGj
https://bin.bardy.me/ukzxIuZE
https://bin.bardy.me/GjD1h815
https://bin.bardy.me/WznRK5bC
https://bin.bardy.me/2xrBTC7q
https://bin.bardy.me/CRpV8nBJ
https://bin.bardy.me/FBBzoyKZ```
jovial warren
#

and watch some more children's programs

old wyvern
#

@jovial warren whats the limit atm?

jovial warren
#

1000 connections per 6000 seconds

old wyvern
#

hmm gimme a few mins

#

are sure of that limit?

#

@jovial warren

jovial warren
#

positive

old wyvern
#

1 connection as in 1 upload right?

#

thats approx 1.5k

#

Stopping it for now

jovial warren
#

you really spamming it?

old wyvern
#

wdym?

#

spanning?

jovial warren
#

fixed

old wyvern
#
https://bin.bardy.me/W9dmuyF6
https://bin.bardy.me/85jFBwbv
https://bin.bardy.me/u67v8RK1```
#

yea I was testing what would happen when you reach the rate limit

#

fixedSo 1k more = rate limit?

jovial warren
#

no I fixed my message lol

old wyvern
#

xD

#

Why does the rate limit not work?

#

it still keeps going if I start it

jovial warren
#

idk

#

alright gtg

#

brb

old wyvern
#

ciao

jovial warren
#

back

old wyvern
#

rate limit test?

#

still not limiting

#

just finished 2 sets of 2k within less than 5 mins

jovial warren
#

just why

prisma wave
#

@old wyvern you are doing god's work

jovial warren
#

try those links again maybe

#

I may or may not have just ran redis-cli FLUSHDB followed by redis-cli FLUSHALL

#

and I can run that every time you try to fill it up ๐Ÿ™‚

prisma wave
#

Wait it's all in redis?

jovial warren
#

yep

prisma wave
#

Huh

jovial warren
#

hastebin supports redis for storage

old wyvern
#

I mean im more interested in the rate limit not functioning

#

If I wanted to fill it up I could leave it running over night / when you are asleep

jovial warren
#

before I just cleared the entire keyspace, there was 213 keys in db0 and 3467 keys in db2 (the paste database)

old wyvern
#

๐Ÿ’€

#

There should be more than 3.4k tho

jovial warren
#

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

old wyvern
#

huh

#

Also why does the connection limit NOT WORK?????

#

xD

#

Are you sure its 1k per 10 mins?

jovial warren
#

should be

#

it's 500 per 10 minutes now

old wyvern
#

its not working then

jovial warren
#

actually no

#

600 seconds is 10 minutes

#

this is 6000 seconds

old wyvern
#

It should still timeout

#

I mean limit it

jovial warren
#

you gotta remember though that it's also fully proxied through cloudflare as well

#

still shouldn't make a difference

#

unless the receiving ips change since they're from cloudflare

old wyvern
#

Its supposed to limit all connections

#

not from 1 ip

#

fix the rate limiter now!!!!! ๐Ÿ˜‚

jovial warren
#

"connect-ratelimit is connect middleware for limiting the number of requests per client ip/hostname to your node server."

old wyvern
#

ah per ip

#

welp thats useless then

#

I imagined it limited the service to that

#

requires further testing

jovial warren
#

why

onyx loom
#

:)))

jovial warren
#

3,458 TLSv1.2 requests in the last 24 hours

old wyvern
#

There should be more

#

whats the 95% of?

#

@jovial warren

jovial warren
#

95% of requests in the last 24 hours have been from TLSv1.2

#

TLSv1.3 requests are probably the normal people

old wyvern
#

welp

#

is that statistic up to date?

prisma wave
#

Had to flex my 450MB๐Ÿ˜Ž

old wyvern
#

451*

#

@jovial warren You gone?

jovial warren
#

@prisma wave I got one of those lol

old wyvern
#

whats the stat at rn?

jovial warren
#

@old wyvern I took that screenshot about a minute before I uploaded it

#

if that

#

still the same

old wyvern
#

huh

#

one sec

jovial warren
#

doesn't update instantly

old wyvern
#

ah be ready

frail glade
#

Not bad

old wyvern
#

I forgot i+1 so its 2k more than shown btw

#

welp imma stop procrastinating and go back to work now

#

ciao

jovial warren
#

do I need to flush again

old wyvern
#

probably

#

10k in

#

setRequestProperty("User-Agent", "BardBoi");

jovial warren
#

10001 keys

#

yep

#

don't make me set up cloudflare rate limiting

old wyvern
#

xD

jovial warren
#

and it's all clear again

old wyvern
#

for now

jovial warren
#

if I turn off cloudflare proxying you'll get rate limited properly lol

old wyvern
#

jk

#

xD

#

Sure

jovial warren
#

if I turn off cloudflare proxying I'll also probably get a slow loris from like BM or something

#

lol

old wyvern
#

loris?

jovial warren
#

you never heard of a slow loris attack?

#

basically you send incomplete requests, which open up threads, then send keepalive headers when it's just about to timeout to keep the connection open

old wyvern
#

hmm

jovial warren
#

and also, if any mods or admins see this, disclaimer: this is only for testing purposes, I do not in any way condone the use of any form of Denial of Service attack on a real website

#

just covering my arse

prisma wave
#

if I turn off cloudflare proxying I'll also probably get a slow loris from like BM or something
Turn cloudflare off

#

It will be funny

#

I promise :)

steel heart
#

indeed

old wyvern
#

This implicit default value is used when the original map doesn't contain a value for the key specified and a value is obtained with Map.getValue function, for example when properties are delegated to the map.

#

getValue has diff behaviour from the [] shorthand

#

Anyway gonna go have dinner and sleep

#

its almost 4 am oof

prisma wave
#

Yeah I think it's quite confusing

#

Ok gn

old wyvern
#

Yeah I think it's quite confusingWhats confusing?

ocean quartz
#

Ugh, I already changed all settings and still getting this, why do you hate me sql
Exception in thread "DefaultDispatcher-worker-2" java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x82 _' for column 'message' at row 1

prisma wave
#

The semantics of withDefault

#

Having it only work with getValue is a bit strange

old wyvern
#

the documentation specifies it only works with getValue

prisma wave
#

I know

#

But that seems a strange decision

old wyvern
#

true

prisma wave
#

They could've made a DefaultedMap interface that overrides the nullability of get as well

#

Idk

old wyvern
#

welp

#

Ugh, I already changed all settings and still getting this, why do you hate me sqlI just had an issue with mariadb having db name case issues for some reason

#

sql hates everyone ๐Ÿ’€

ocean quartz
#

It's something to do with UTF 4 bit character or something like that, can't figure what it is though

jovial warren
#

SQL?

#

hit me with it

#

I is bigbrain at SQL

#

@ocean quartz

ocean quartz
#

I mean i know sql as well, this error is just bothering me
Exception in thread "DefaultDispatcher-worker-2" java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x82 _' for column 'message' at row 1

quiet sierra
#

The best thing about documenting your code is that you have an excuse to having 5000 lines of code in 1 class

onyx loom
#

uh wat

quiet sierra
#

javadocs on your code

onyx loom
#

but like

#

5k

#

1 class

quiet sierra
#

Yes

#

But with enough javadocs

onyx loom
#

๐Ÿ˜ซ

quiet sierra
#

I swear this class has 100 lines of code and 500 in total

#

Because I'm documenting e v e r y t h i n g

ocean quartz
eternal mica
#

good point

#

๐Ÿคฃ

quiet sierra
#

I don't understand where those interfaces would be used but ok

#

Like let's create an interface with a uuid and stuff

eternal mica
#

what do you mean

quiet sierra
#

but then to load the crap

eternal mica
#

i dont get what you mean

quiet sierra
#

Like just use a class directly

eternal mica
#

you mean how those methods in the interfaces gets executed?

quiet sierra
#

I see the uses for interface just not in that case

eternal mica
#

mhm, i'm using them correctly tho?

quiet sierra
#

I don't get it

#

Good luck

eternal mica
quiet sierra
#

oof no imges for me

#

Like okay it's clean

old wyvern
#

cOmmeNT

quiet sierra
#

But why an interface in specific

#

Whatever

eternal mica
#

i still dont get it

#

and yes i'll do the comments

quiet sierra
#

I've spent 50 hours in my project and I have like 9 classes

old wyvern
#

whats a warp rate

quiet sierra
#

Most of the time I'm just commenting or thinking of what I should write on the comment

#

Cause I should do that

old wyvern
#

warps allowed per second? or like cost per warp?

ocean quartz
#

It's better to have more classes though

eternal mica
#

warps allowed per second? or like cost per warp?
@old wyvern people rating warps for example 1/5

ocean quartz
#

SRP

quiet sierra
#

I like having classes and overcomplicating

old wyvern
#

oh

quiet sierra
#

It's just that I'm commenting so much

eternal mica
#

still need to clean it

ocean quartz
#

Small classes, srp > big over complicated classes

eternal mica
#

a lot i have ๐Ÿ‘€

quiet sierra
#

I have a medium project with like 94 classes

eternal mica
#

ok there is so much to show, cant be bothered lol

quiet sierra
#

I recorded a 30 second gif of me going through them

prisma wave
#

Interfaces good

eternal mica
#

^

quiet sierra
#

I don't use them much

prisma wave
#

Btw @eternal mica nullability annotations please

#

you should

eternal mica
#

ooo

prisma wave
#

they work wonders for encapsulation

eternal mica
#

i always forget them

quiet sierra
#

For me they are very situational

prisma wave
#

I guess

ocean quartz
prisma wave
#

I would say interfaces are just as important as classes

quiet sierra
#

Because most classes I make have a single purpose

prisma wave
#

If not more

quiet sierra
#

unless it's a template

#

Then yes use interface

#

Maybe in the future I'll learn to interface

eternal mica
#

Thats a lot of classes

quiet sierra
#

But for my most classes have a really specific purpose that no other class will mess with

eternal mica
#

but yeah i'll do the annoations

#

and comments

prisma wave
#

Nice

quiet sierra
#

Amateur

#

I tripled that

prisma wave
#

Quality not quantity

quiet sierra
#

I know

eternal mica
#

is this quality?

quiet sierra
#

those review replies are quality

#

Also why tf do you have a line between each variable

#

I'd make them in groups

eternal mica
#

i do to

quiet depot
#

thatโ€™s nothing olzie

eternal mica
#

lol

#

ikkkk

quiet depot
#

i wonder how many classes my framework has

eternal mica
#

๐Ÿ‘€ ๐Ÿคทโ€โ™‚๏ธ

#

๐Ÿคฃ

eternal mica
#

Yeah why?

rugged ice
#

Wonder whenever my code falls into the "decent" or "spaghetti" quality

prisma wave
#

I'm on mobile but I'll do my best

#

Initial thoughts:
For a first plugin this isn't bad. You're not doing everything in your main class which is good, you are using dependency injection rather than static everywhere, and you seem to be following naming conventions

#

Some suggestions/nitpicks:
Your onDisable method is doing nothing, could be removed
PortalCalcCommand#plugin should be private and final
You should restructure your onCommand logic to avoid nested if statements (ideally none at all) as this reduces "arrow code" and makes your code more readable

#

You could also look into caching the config values (such as getCoordColor and the messages). While this usually doesn't speed things up, you should always try to avoid recalculating values you already have

#

On the topic of getCoordColor, should it be returning null if the string is empty? WHITE seems like a more logical decision

#

A lot of these are common things to see in a new plugin, so overall I'd say this is pretty good

#

Definitely better than a lot of new plugins

onyx loom
#

wew

rugged ice
#

you are using dependency injection rather than static everywhere
I struggled with cannot be referenced from a static context issues trying to get getConfig() to work, until I added the PortalCalc plugin; stuff

Your onDisable method is doing nothing, could be removed
Hmm, I'll probably simply stuff a message there, want to use it as a future example for plugins

PortalCalcCommand#plugin should be private and final
Which part of the code is that located? Is it PortalCalc plugin?

You should restructure your onCommand logic to avoid nested if statements (ideally none at all) as this
reduces "arrow code" and makes your code more readable
Still a noob to code, should I use the switch case thing instead?

You could also look into caching the config values (such as getCoordColor and the messages). While this usually doesn't speed things up, you should always try to avoid recalculating values you already have
Alright, this I definitely have no clue how to do, should perhaps google it

On the topic of getCoordColor, should it be returning null if the string is empty? WHITE seems like a more logical decision
I stole that portion of code from the getOperatorColor method from EssentialsX :p
Will definitely change

A lot of these are common things to see in a new plugin, so overall I'd say this is pretty good
Definitely better than a lot of new plugins
Glad to hear at least, it's not quite spaghetti code after all

onyx loom
#

๐Ÿ‘ code ๐Ÿ‘ review

prisma wave
#

I struggled with cannot be referenced from a static context issues trying to get getConfig() to work, until I added the PortalCalc plugin; stuff

Dw, using Dependency Injection (passing PortalCalc into the constructor) is the correct way of doing it. Static bad

Hmm, I'll probably simply stuff a message there, want to use it as a future example for plugins

Fair enough, again this was just a little nitpick

Which part of the code is that located? Is it PortalCalc plugin?
Yep, it should be private and final (as should every field unless you have a specific reason for it not to be)
Still a noob to code, should I use the switch case thing instead?
Not exactly. I'll explain more in another message
Alright, this I definitely have no clue how to do, should perhaps google it
It's easier than you think. Basically you load the values from getConfig() once into fields, and just use those fields.
I stole that portion of code from the getOperatorColor method from EssentialsX :p
Will definitely change ๐Ÿ‘

Glad to hear at least, it's not quite spaghetti code after all

#

It's definitely not spaghetti

#

As I said, pretty good considering

#

Anyway reducing arrow code

#

This is another fairly simple concept. The simplest way of saying it is
"Use if-not-return rather than if-so-continue"

#

So for example, rather than java if(sender instanceof Player) { blah else { you're not a player blah }

#

You would do something like java if(!(sender instanceof Player) { you're not a player blah return true } blah

#

This helps to avoid nested if statements and brackets (which can make your code look like an arrow, making it hard to read)

#

Yours isn't bad but there's always room for improvement

#

?plsnoarrowcode

compact perchBOT
prisma wave
#

This is also useful

rugged ice
#

Hmm, I will definitely consider that article

eternal mica
#

Yeah it also makes your code so much easier to read

#

I much prefer inverted ifs

rugged ice
#

Next on my to-do for this plugin is implement permissions, switch config.yml to locale.yml, implement a /reload command, allow calculating from an argument instead of just location, and give a message if running from console

errant geyser
#

So class and package names should be UpperCamelCase, methods lowerCamelCase and constants just FUCKYOUIMIMPORTANT right?

versed ridge
#

package names should be all lowercase

topaz bay
#

constants are UPPER_SNAKE_CASE

distant sun
#

๐Ÿ_๐Ÿ_๐Ÿ

obtuse gale
#

โซ ๐Ÿ ๐Ÿ’ผ

jovial warren
#

โฌ ๐Ÿ ๐Ÿ’ผ

#

๐Ÿซ ๐Ÿ’ผ

#

okay these are pretty good

#

just need one for pascal case lol

#

๐Ÿ”‘ โ˜Ž๏ธ ๐Ÿ’ผ "pass call case" lol

distant sun
#

Lol

jovial warren
#

guess that works

#

๐Ÿ”‘ โ˜Ž๏ธ ๐Ÿ’ผ

#

"pass call case"

#

about as close as we're gonna get

prisma wave
#

โซ ๐Ÿช ๐Ÿ’ผ

jovial warren
#

wow

#

๐Ÿซ that camel is for upper case

#

apparently

#

๐Ÿช that camel is for lower case

#

๐Ÿซ ๐Ÿ’ผ

onyx loom
#

๐Ÿ™„

jovial warren
#

that's techincally CamelCase

#

๐Ÿช ๐Ÿ’ผ

#

camelCase

heady birch
#

extended_clip ๐Ÿ’ผ

jovial warren
#

clip case?

#

wannabe 8 bit gangstar case?

#

what is that?

heady birch
#

i just made it up

old wyvern
#

Anyone up for some clash?

lunar cypress
#

absolutely

#

just officially finished school

old wyvern
#

gj

#

@hot hull

#

u in?

#

@prisma wave

#

@jovial warren

frail glade
#

Let's play "how many people do I get to tag before I get kicked"

#

You got 1 left

obtuse gale
#

We can take turns to avoid the kick, tell me who to tag next

frail glade
#

They share.

obtuse gale
#

@obtuse gale

lunar cypress
#

how is that kickable thonking

old wyvern
obtuse gale
frail glade
#

Bro wtf how is this censored content

jovial warren
#

lol

frail glade
jovial warren
#

answer to that is yes they do

#

@old wyvern why do I have 13,505 TLS v1.2 requests within the last 24 hours

old wyvern
#

I gave you the 10k list yesterday I think?

#

Havent done anything after that

jovial warren
#

seems legit

old wyvern
#

wdym?

jovial warren
#

wdym wdym?

old wyvern
#

seems legit?

rotund egret
#

see ms, leg it

#

Ooo
See M(icro)s(oft) le' git

prisma wave
#

@lunar cypress @old wyvern I'll be on in 5 minutes

lunar cypress
#

there is probably again some formula for this one

#

but I'm not looking it up

hot hull
#

Lemme hop on pc @old wyvern

old wyvern
#

Alrighty

lunar cypress
#

shit

#

i knew it

heady birch
#

hm

old wyvern
#

knew what?

lunar cypress
#

knew that I could make it a single calculation

old wyvern
#

lol

lunar cypress
#

but I didn't have any more time

old wyvern
#

what was your soln?

#

you actually summed all a(n)s?

lunar cypress
#
(apply + (take n (map #(+ (* d %) m) (range))))
```yup
old wyvern
#

ah xD

frail glade
#

Imagine having a case-sensative API.

jovial warren
#

lol

#

imagine having an API at all

#

obviously that's what half of these so-called "developers" out there think

heady birch
#

I got in just in time

lunar cypress
#

are you kidding me?

#

tests pass and 0%

#

again

#

this happens way too often

prisma wave
#

rip

heady birch
#

Wtf

#

I dont even get what its asking but imm a submit

#

stupid peice of

lunar cypress
#

lol

heady birch
#

OH

#

Sum

#

NO

#

I really gotta read the question

hot hull
#

I'm in for the next round

prisma wave
#

I think we should mix it up next round

#

everyone has to use a language they've never used before or something

#

idk

#

could be fun

old wyvern
#

Thats what im doing rn

#

xD

hot hull
#

Oh god

prisma wave
#

oh lmao

lunar cypress
#

that... will probably make all of us fail

old wyvern
#

PeRl

hot hull
#

Johny, worth it

prisma wave
#

that... will probably make all of us fail
but it will be good

#

for science

old wyvern
#

Yes

#

lets do that

#

fun + we learn something new

prisma wave
#

Ima try out Haskell

lunar cypress
#

Literally reading docs for 10 min is not fun but whatever you say

old wyvern
#

Imma roll a dice for next one

prisma wave
#

aha ok

lunar cypress
#

oh good luck with haskell

prisma wave
#

it doesn't look too hard

heady birch
#

ok

lunar cypress
#

and respect if you actually manage to get a result

heady birch
#

post link

#

@hot hull

old wyvern
#

We are not allowed to tag here Nial shhh

heady birch
#

how do I changed language?

prisma wave
#

in the ide

#

there's a dropdown

heady birch
#

Ok