#dev-general

1 messages ยท Page 249 of 1

jovial warren
#
fun String.replace(values: Map<String, Any>): String {
    values.forEach { (key, value) -> replace("\${$key}", value.toString()) }
    return this
}
```any idea if I could improve this somehow? I'm basically trying to take a string and replace a bunch of keys from a map with their associated values
#

you know like what StringSubstitutor#replace does from commons-text?

#

I just don't want to add the overhead of bundling commons-text for literally one method

#

I suppose it's only 211 KB at the end of the day

prisma wave
#

that won't work anyway

jovial warren
#

any idea what might?

prisma wave
#

cuz replace returns a new string

#

use fold

#

on the values map

jovial warren
#
fun String.replace(values: Map<String, Any>) = values.entries.fold(this) { accumulator, (key, value) -> accumulator.replace("\${$key}", value.toString()) }
```found this on StackOverflow lol
prisma wave
#

thats exactly what i was suggesting lol

jovial warren
#

alright cheers

#

wonder what I could do about ```kotlin
object DatabaseUtil : PunishmentsKoinComponent {

suspend fun getName(player: PlayerEntity) = transaction {
    HistoryEntity.find { HistoryTable.player eq player.id }
            .orderBy(HistoryTable.time to SortOrder.DESC)
            .limit(1)
            .single()
}.name

}

#

maybe convert that to a property with a getter?

#

but that has to suspend since transaction is suspending

obtuse gale
#

PunishmentsKoinComponent

jovial warren
#

I use koin

static zealot
#

Allow elevator.exe to make changes?

#

yes or no

jovial warren
#

yes

obtuse gale
#

oh is koin an actual thing

#

i thought it was a kotlin typo lol

#

im just dumb

jovial warren
#

koin is a lightweight Kotlin dependency injection library

obtuse gale
#

o

#

im just dumb then lol

static zealot
#

KOtlin INjection ?

jovial warren
#

it's not annotation-based, which is a bit different shall we say

#

you use inject<MyInjectableClass>() for DI

#

that one's lazy injection

#

then get<MyInjectableClass>() for non-lazy DI

jovial warren
static zealot
#

I'm smart xD

#

look its pacman

#

Written in pure Kotlin

#

hmm

jovial warren
#

oh it is

static zealot
#

hmmm

jovial warren
#

a few shell scripts in there

#

it means the library is pure kotlin, not necessarily the entire repository lol

static zealot
#

please let me look smart for 1 minute.

#

k thanks

jovial warren
#

lol

prisma wave
#

weak coupling ๐Ÿคฎ

jovial warren
#

wat dis

prisma wave
#

what koin encourages

#

bc it's not constructor injection

jovial warren
#

ah okay

#

you got any idea how I can fix my issue btw?

#

I gotta find a way to retrieve the name

static zealot
#

yes

jovial warren
#

because of the way my database relations work though, that's easier said than done

static zealot
#

wrong channel wops

jovial warren
#

getter and util class = ๐Ÿคฎ

#

fixed it anyway by just not having a method to do that

prisma wave
#

that is horrible

jovial warren
#

I know

#

but I can safely say that I didn't write it

#

any idea how I could possibly make them better?

jovial warren
#

I did not write that, trust me

old wyvern
#

Is this not what you wrote that day

#

xD

jovial warren
#

copy and paste from the old project pretty much

old wyvern
#

who wrote the old project?

jovial warren
#

my friend wrote the matcher code

old wyvern
#

ah

jovial warren
#

and also the format code

jovial warren
#

also, would anyone have any idea why I get no syntax highlighting or code completions in my build files with the Kotlin DSL?

onyx loom
#

dsl bad

jovial warren
#

shut it you

distant sun
#

when kali is right, is right

onyx loom
#

no ๐Ÿ™‚

compact perchBOT
#
Happy New Year Countdowns!

Here are some countdowns till each Admin is in the new year.

funnycube:

Happy New Year! ๐ŸŽ‰

Clip:

14h 58m 35s

Glare:

15h 58m 35s

PiggyPiglet:

1h 58m 35s

onyx loom
#

o

distant sun
#

happy new year @pallid gale

onyx loom
#

funnycube#0001 hows 2020 ng+ so far? ๐Ÿคจ

distant sun
#

ng+?

onyx loom
#

happy new year

#

new game+ smh

distant sun
#

what

onyx loom
#

๐Ÿ˜

static zealot
#

2020.2

distant sun
#

well usually rewrites are meant to be better so .. fingerguns

pallid gale
#

2021 pretty good so far

distant sun
#

food ๐Ÿ˜‹

#

first 5m are good

jovial warren
#

apparently the bug I have has been fixed, but also apparently not according to my IDE

#

it just won't syntax highlight or code complete properly

distant sun
old wyvern
distant sun
#

Virus free

old wyvern
#

o.o

distant sun
#

any idea why when I move a kt file to a new package it doesn't update the package?

livid bluff
#

@obtuse gale por cierto, muchas gracias <3

jovial warren
#

feel free to ridicule me for anything stupid lol

#

still a bit of a W.I.P but I wanna make sure I'm on the right track lol

distant sun
jovial warren
#

not bad

prisma wave
#

lowercase file names ๐Ÿ˜

#

Miss me with that

#

The convention for "extension files" is [ClassName]s.kt

#

Like Files.kt, Lists.kt, Strings.kt

distant sun
#

smh

jovial warren
#

@prisma wave you know how I can get all subclasses of a given class?

prisma wave
#

org.reflections

#

Or classgraph

jovial warren
#

which one's better?

prisma wave
#

Neither is better

#

Reflections is simpler but classgraph is faster and more powerful

old wyvern
#

lowercase works technically for mutli class files

prisma wave
#

As far as I know

old wyvern
#

Does it auto lowercase the package name?

prisma wave
old wyvern
#

Since a muticlass file is a package later on

#

If it doesnt that might end up looking weird with java interop

distant sun
prisma wave
#

Mostly

distant sun
#

mostly?

prisma wave
#

not sure you need to match the package name like that

old wyvern
#

why do you have a extensions package?

prisma wave
#

^

distant sun
#

ignore that, it was created after I have renamed the package

old wyvern
#

Extensions should be present as close to their usage location as possible

#

ah

#

fair enough

distant sun
old wyvern
#

Is that entire project extensions? o.o

#

@distant sun

distant sun
#

yes

old wyvern
#

๐Ÿ˜ฌ

distant sun
#

what

#

I use most of them in all projects such as String#color

old wyvern
#

I see

distant sun
frigid badge
#

I still find it weird to have an extension for bukkit in a string class

distant sun
#

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

#

you are weird

jovial warren
#

@prisma wave maybe you'll be happy to know that I've got so fed up with this Kotlin DSL bug that I've switched to Groovy DSL

static zealot
#

o

jovial warren
#

and also, I kinda now agree, Groovy DSL better

prisma wave
#

I'm very pleased

#

yes

#

Obviously

#

It's much better

onyx loom
#

i must also agree

jovial warren
onyx loom
#

what a wise choice u have made

jovial warren
#

don't question my use of opt-in rather than @OptIn please lol

distant sun
#

I have the same problem BB

#

and a shit tone of warnings

onyx loom
#

probably wont solve it, but cant u do compileKotlin.kotlinOptions instead of having them seperated?

prisma wave
#

You can

#

There's just no need to

distant sun
#

same thing

onyx loom
#

looks better ๐Ÿ™‚

ocean quartz
#

Haven't had those warnings since the ij update

jovial warren
#

what version?

#

I'm on 2020.3.1 and I still have it

ocean quartz
#

Latest, don't remember the number might be that one

jovial warren
#

press help -> about

onyx loom
#

IJ 2021 when

jovial warren
#

in... 2021...?

ocean quartz
#

Mobile fingerguns

jovial warren
distant sun
#

IntelliJ IDEA 2020.3 (Ultimate Edition)
Build #IU-203.5981.155, built on December 1, 2020

#

ou update

static zealot
#

ugh there was an update today wasn't there? or yesterday

onyx loom
#

yesterday ye

jovial warren
#

any way to have modules inherit dependencies from other modules they depend on btw?

lunar cypress
#

What sort of modules are you speaking of

jovial warren
#

Gradle modules

lunar cypress
#

They always do that because of dependency transitivity

#

Is your question about exposure

#

In that case you'll want to look at the api dependency declaration

#

You get it from the java library plugin

jovial warren
#

I have implementation project(":api") on my common module, and then if I depend on common on my bukkit module in the same way, somehow I can't access anything from api

#

that's what I mean

lunar cypress
#

Yes, that is what I was refering to

#

Change implementation to api

jovial warren
#

and also can't access the coroutines dependency from common

#

ah okay

#

do I do that for all the dependencies I want to be accessible like that or what?

lunar cypress
#

The only difference between implementation and api is that the latter exposes this and its transitive dependencies

jovial warren
#

ah okay

#

cheers

#

okay, so I've got api "org.koin:koin-core:2.2.1" on my common module, but my bukkit module (which depends on common) says it can't find KoinComponent (from the dependency)

#

it's supposed to be exposed to the consumers, but apparently it isn't for whatever reason

#

api seems to work just fine for kotlinx-coroutines-core and :api, but not for koin-core for whatever reason

#

ah okay, seems to be in the runtimeClasspath but not compileClasspath

#

reimport seems to have made it appear in compileClasspath, but it's still not available for some reason

prisma wave
#

Try invalidating caches

jovial warren
#

just did

#

apparently this exact bug has been fixed in the Kotlin plugin version I have

#

lemme try getting the latest Kotlin plugin (apparently it won't auto-update to 1.4.21 so I have to get it manually)

half harness
#

who pinged me ๐Ÿ‘€

#

oh

prisma wave
#

easy way to find out

jovial warren
#

okay this bug is worse than I thought

#

I've literally added it as an implementation to the bukkit module and it can't find it at all

#

and it's in the fucking compileClasspath

#

like wtf?

#

omfg I'm so stupid

#

koin is in jcenter, and you'll never guess what the bukkit module doesn't have in it's repositories block

old wyvern
#

this guy

#

!!!

jovial warren
#

wtf is that

old wyvern
#

One of the guys from the project keeping pushing shit like this

#

Im so annoyed

jovial warren
#

how do you sleep at night writing if statements like that?

old wyvern
#

Im sick of fixing it

old wyvern
#

He doesnt fucking listen

#

๐Ÿ˜ซ

jovial warren
#

I'm just about to test my plugin on 1.8 lol

old wyvern
jovial warren
#

it uses the paper 1.16.4 API, but as long as I don't use any non-1.8 methods it shouldn't matter should it

jovial warren
old wyvern
#

I guess IJ can auto fix a lot of these but now time to spend time renaming everything

jovial warren
#

also, for anyone who says "why tf are you supporting 1.8?" it's a punishments plugin, and I want it to be as backwards-compatible as possible lol

old wyvern
jovial warren
#

yep

old wyvern
#

ah

jovial warren
#

I basically want it to have the sort of compatibility that LuckPerms has

old wyvern
#

I see, good luck!

prisma wave
#

why tf are you supporting 1.8?

jovial warren
#

because I want backwards-compatibility for this thing

prisma wave
#

ik lol

jovial warren
#

I intend to support as far back as Bukkit will go if I can lol

prisma wave
#

it was a poor attempt at humour

jovial warren
#

anyone know what the oldest version of Bukkit is?

#

is it 1.7?

prisma wave
#

either 1.7 or 1.6

#

i think

jovial warren
#
java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'
```never seen this one before
#

also don't question why I'm using Dispatchers.Main here

#

any idea how to fix that?

#

actually I've just realised that Dispatchers.Main is not what I'm after here

prisma wave
#

Main dispatcher only exists on certain things

#

because otherwise kotlin has no idea what you want to use as the "main" thread

jovial warren
#

should probably be using Dispatchers.IO here anyway since I'm creating missing tables and columns

#

or is that not the sort of IO that IO is for

prisma wave
#

any IO is IO

jovial warren
#

would creating database tables/columns if they don't exist count as the sort of IO you would use Dispatchers.IO for?

prisma wave
#

it's a query going over the network

#

so yes

#

anything that could block for a long time should use the IO dispatcher

jovial warren
#

right, which one of these mother fuckers depends on SLF4J

#

wait... doesn't Spigot's logger count as an SLF4J implementation?

#

because paper depends on SLF4J

#

or why is that message showing up?

prisma wave
#

paper uses slf4j i believe

steel heart
#

spigot uses logback or log4j what it now is called

jovial warren
#

so why would I get that message then? wtf?

steel heart
#

or wait perhaps not

#

it uses the default logger my bad

#

I think

#

although it has the log4j xml thing

#

org.apache.logging.log4j

#

oo

jovial warren
#

yeah it doesn't depend on log4j I'll tell you that

#

it uses java.util.logging

steel heart
#

yeah

distant sun
#

Write the logs on paper

steel heart
#

it probably uses apaches log4j shaded

#

internally

jovial warren
#

that doesn't explain why paper depends on slf4j-api though

prisma wave
#

because paper uses it

jovial warren
#

actually maybe the paper server is supposed to depend on log4j

#

but then if it did, why would I get that?

#

actually, this server is 1.8 and I'm using paper-api 1.16.4, I bet slf4j has been added after 1.8

distant sun
#

Why though

jovial warren
#

why what?

distant sun
#

this server is 1.8 and I'm using paper-api 1.16.4

steel heart
#

how to java enterprise

jovial warren
#

oh that, thought you were going to ask why I'm supporting 1.8 lol

distant sun
#

Dumb

jovial warren
#

I thought it doesn't matter unless you use 1.9+ specific features

#

might be better if I just depend on spigot 1.8 and be done with it

prisma wave
#

why would you use 1.16 api on a 1.8 server

distant sun
#

Well yea but you have to check what's available on x version

jovial warren
#

my punishments plugin ain't gonna use anything that's been changed since 1.8, or at least, I highly doubt it is

prisma wave
#

spigot is forward compatible not backwards compatible

#

just use 1.8 api and be done with it

jovial warren
#

apart from that maybe

#

still got the slf4j thingy though

#

ah I know why

#

exposed depends on slf4j

distant sun
#

isnt that a kotlin lib?

jovial warren
#

yeah

distant sun
#

Is it provided by paper?

jovial warren
#

what? exposed? no

#

also, apparently adding slf4j-simple got rid of it

distant sun
#

Mkay

jovial warren
#

but simple has a different format which makes it look stupid

steel heart
#

what is a symbolic link

#

tf

jovial warren
#
try {
    GlobalScope.launch(Dispatchers.Default) { command.execute(BukkitSender(sender), args) }
} catch (exception: CommandException) {
    sender.sendMessage(exception.message)
}
```first one to spot the issue gets a cookie
#

I honestly don't understand how I can be this stupid sometimes

obtuse gale
#

whats the best voting plugin to go alongside with nuvotifier

ocean quartz
prisma wave
ocean quartz
#

I need people to judge this config section: https://paste.helpch.at/awexocutom.json
Need to know if this would be some nice notification settings
cough @distant sun
Open to suggestions, like as many changes as you feel like xD

steel heart
#

Matt nice but it feels weird that the placeholders sometimes are identified by %% and other times {}

ocean quartz
#

Well, i thought it would be easier since PAPI placeholders are %% and mine are {} for people to identify which ones are coming from where

steel heart
#

oh yeah then I guess

ocean quartz
#

I don't mind having it all ass %% though if it's easier to understand

steel heart
#

yeah just felt inconsistent

old wyvern
#

Happy new year!

prisma wave
#

Happy new year ๐Ÿ™‚

old wyvern
#

o.o

#

Living in the past I see

high violet
#

oh so you too are on cet

#

nice

#

I thought I was the only one

prisma wave
#

dont associate me with the "people" in cet

steel heart
#

cet?

jovial warren
#

it's called GMT @high violet

#

21:33 for me

steel heart
#

22:33

jovial warren
#

just under 2 and a half hours to go

obtuse gale
#

y'all dealing with time zones

#

Tsk

#

Just UTC everything

jovial warren
#

unix time

#

1609450432

#

when it reaches 1609459200, that's 2021

#

01/01/2021 00:00:00 = 1609459200

#

just a random question btw, what font size do you guys use for the editor on IJ?

#

I usually use 14-16, but I've heard some people use like 11 or 12

winter iron
#

13

#

question

#

how to check if armor stand is placed

#

it doesnt trigger block place

jovial warren
#

I believe it's technically an entity not a block

#

tried entity spawn event?

winter iron
#

i have not

#

i shall try

jovial warren
winter iron
#

ty

jovial warren
#

yw

winter iron
#

erm

#

another question

#

i need the player

#

so im guessing i need interact event instead?

jovial warren
#

you need the player who spawned it?

winter iron
#

ye

jovial warren
#

this just proves that Google is your friend if you know what to give it to keep it happy

winter iron
#

i didnt know what to give it

#

i tried searching

#

u pulled this one from the graves

jovial warren
#

"spigot get player who placed armor stand"

winter iron
#

๐Ÿ‘€

jovial warren
#

always prefix or suffix your search with what thing you're specifically targeting

#

in this case, we're talking about spigot, so we only want results about spigot, so we prefix the query with spigot to tell Google "hey, I only care about anything to do with spigot, everything else can go fuck itself"

#

then just search what you want, but try to use as little amount of words as you can, as then your search is more likely to be picked up

#

because then Google can focus on the individual words and not try and match a title that contains "the" for example

#

Google searching 101 right there

old wyvern
obtuse gale
#

spigot get spigot player who placed spigot armor stand - spigot

#

does it actually say that yugi?

half harness
#

y u looking at serial killers ๐Ÿ‘€

prisma wave
#

dev-general

half harness
old wyvern
half harness
#

either

  1. edited image
  2. Used inspect element thing
old wyvern
#

No idea

#

just found that on the codinggame discord

half harness
#

๐Ÿ˜ฎ Why isn't Map#entry in java 8 ๐Ÿ˜ญ

#

its in java 9

#

NINE

#

๐Ÿ˜ 

ocean quartz
#

Just update

half harness
#

but-

#

I'm trying to look for java 8 alternatives

ocean quartz
#

Paper 1.17 will be Java 11 anyways

ocean quartz
half harness
#

;-;

prisma wave
#

java 11 is SO much better than 8

#

almost as good as kotlin

half harness
#

okay

#

I got an alternative

#
public final class Entry<K, V> implements Map.Entry<K, V> {
    private final K key;
    private V value;

    public Entry(K key, V value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public K getKey() {
        return key;
    }

    @Override
    public V getValue() {
        return value;
    }

    @Override
    public V setValue(V value) {
        V old = this.value;
        this.value = value;
        return old;
    }
}
```bam
#

ez

prisma wave
#

horrid

half harness
#

lol

haughty spear
prisma wave
#

@everyone in a discord with 8000 members

#

Lol

#

Wait

half harness
#

@everyone i have no perms

#

so I can't do @everyone

prisma wave
#

Bruh that's not even trying to be convincing

half harness
#

wait

prisma wave
#

It's absolutely phishing

half harness
#

its stream comunity

#

I didn't notice the stream at first

#

I just saw the comununity

#

woah

#

thats a lot more off than I thought

half harness
#

fish

prisma wave
#

ima flood their website with requests

half harness
#

wut

#

wdym

#

how

prisma wave
half harness
#

wait how does phishing work?

lavish notch
#

steels your ip

half harness
#

;-;

lavish notch
#

and sells it on

prisma wave
#

and your login details

half harness
#

like is he trying to trick us into logging in?

#

oh

prisma wave
#

it's a fake steam login site

#

yes

half harness
#

no, it's stream

#

๐Ÿ™‚

prisma wave
#

it's safe to look at, just don't type anything real in the login box

#

you can type some nice messages though

half harness
#

lol

#

welp idek how I "log in"

prisma wave
#

I can pretty much guarantee every username and password just gets put in a database somewhere

half harness
#

theres no log in button

prisma wave
#

Click any of the items

half harness
#

wtf

#

jeez

#

thats fast

#

that hurt my eyes

#

so bright

prisma wave
#
import requests
import random
import string

url = 'https://streamcomununity.com/auth/login'

entries = ['fuck off', 'nice try', 'get a real job', 'not fooling anyone', 'worst scam ever', '', '  ', '   ', 'bristermitten.me']

for i in range(100): #Add some dummy data to the mix
    rand_string = ''.join(random.choices(string.ascii_uppercase + string.digits, k=30))
    entries.append(rand_string)

i = 0

headers = {
    'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
    'origin': 'https://streamcomununity.com',
    'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
while True:
    data = {
        'username': random.choice(entries),
        'password': random.choice(entries),
        'code': ''
    }
    r = requests.post(url, data  = data, headers = headers) #send the request :)
    i += 1
    print('Sent fake request', i, r.text)

It would be a real shame if everyone ran this to flood their database with dummy data

#

feel free to add some new strings to the list as well ๐Ÿ™‚

half harness
#

oh jeez

#

idk how to run that tho

prisma wave
#

python filename.py

half harness
#

๐Ÿ‘€

prisma wave
#

if you've got python installed just put it in a .py file and double click

#

it's for a good cause ๐Ÿ™‚

half harness
#

python 3?

prisma wave
#

Yeah

#

Probably

#

it might work with 2

#

But using python 2 is like using 1.7

half harness
#

im using 3

half harness
#

it cant find the modules

prisma wave
#

which ones

half harness
#

ModuleNotFoundError: No module named 'requests'

prisma wave
#

python -m pip install requests

half harness
#

maybe the others, request is at the top tho

prisma wave
#

the other 2 are standard library stuff

#

afaik

half harness
#

hmm

#

it needs to be in .py file i think

#

bc im running it via the shell

#

and its not working

prisma wave
#

You need to run the command I said

half harness
#

I'm talking about ur code

#

i installed with a warning

prisma wave
#

oh yeah use a file

#

Shell will probably mess up the indentation

half harness
#

nonono

#

iahsiudhasiudhaisudhasuidhisauhdiuashdiuas

#

im double clicking file

#

and it says module not found

#

WARNING: The script chardetect.exe is installed in 'C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

#

that happens when running ur pip command thing

prisma wave
#

That probably isn't an issue

half harness
#

ok

#

do I put in local path?

prisma wave
#

What

half harness
#

wait

#

how do i run .py file

#

from cmd?

prisma wave
#

python file.py

half harness
#

uh

prisma wave
#

Or possibly python3

half harness
#

ok

#

ill try python3

prisma wave
#

It works

#

That's right

half harness
#

uhh

#

success:false

prisma wave
#

Yeah that's on the server end

#

I'm guessing it's a ratelimit

half harness
#

ohh

#

๐Ÿ˜

prisma wave
#

But I pretty much copied the thing my browser sent and it still did that error

half harness
#

ye literally all of them are success:false

#

wut

prisma wave
#

all of them?

half harness
#

like every 10

prisma wave
#

For me it's about 9/10 of them are

#

Yeah

#

That's normal

half harness
#

it says "code:0"

prisma wave
#

Yeah

#

That means it's worked

half harness
#

๐Ÿ˜ฎ

#

wait

#

r u still doing it

prisma wave
#

yes

half harness
#

wut request

#

r u on

prisma wave
#

I've got it running on my pc and VPS lol

#

I'm on 5025 rn

half harness
#

WUAT

#

wow

#

im only on 170 ๐Ÿ˜

prisma wave
#

It's been running for like 20 minutes lol

half harness
#

will this really do anything tho?

prisma wave
#

Idk

#

Hopefully

#

if I've done it correctly, it should flood their database with random data

half harness
#

oh

prisma wave
#

but it's hard to say

half harness
#

can't they just purge the ones that say ['fuck off', 'nice try', 'get a real job', 'not fooling anyone', 'worst scam ever', '', ' ', ' ', 'bristermitten.me']

prisma wave
#

They can

#

So it also has 100 randomly generated strings too

half harness
#

wutt

prisma wave
#

Which should be harder to purge because they're not all the same

half harness
#

oh

prisma wave
#
for i in range(100): #Add some dummy data to the mix
    rand_string = ''.join(random.choices(string.ascii_uppercase + string.digits, k=30))
    entries.append(rand_string)
half harness
#

ye i see now

prisma wave
#

this adds 100 random strings to the list too

half harness
#

so everytime it succeeds

prisma wave
#

might want to turn it up to something bigger

#

maybe 10000

half harness
#

theres a new login

#

0

#

bad dyno

prisma wave
#

yeah

half harness
#

reached 500 ๐Ÿฅณ

#

is there a way to count successful requests?

prisma wave
#

sure lemme add that

#

actually i'll just ignore if it's unsuccessful

#
import requests
import random
import string

url = 'https://streamcomununity.com/auth/login'

entries = ['fuck off', 'nice try', 'get a real job', 'not fooling anyone', 'worst scam ever', '', '  ', '   ', 'bristermitten.me']

headers = {
    'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
    'origin': 'https://streamcomununity.com',
    'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
i = 0
while True:
    data = {
        'username': random.choice(entries),
        'password': random.choice(entries),
        'code': ''
    }
    r = requests.post(url, data  = data, headers = headers) #send the request :)
    if "success" not in r.text:
        i += 1
        print('Sent successful fake request', i, data)

    rand_string = ''.join(random.choices(string.ascii_uppercase + string.digits, k=30))
    entries.append(rand_string) # add dummy data
#

try this

half harness
#

wait

#

add one thing

#

nvm

prisma wave
#

it'll keep generating new random data, so it's more likely to be unique

#

and now only counts successful requests

half harness
#

h

#

hm

#

okay

#

finally got it working

prisma wave
#

Nice

half harness
#

WOAH

#

it FAST

#

um

prisma wave
#

lol

half harness
#

u did it correctly?

prisma wave
#

I think so?

#

What's wrong

half harness
#

im getting like 1-2 sucessful every second

#

much faster than the every 2 seconds before

prisma wave
#

huh

#

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

#

Pretty sure it's working

#

Although no way of telling

#

I'm sure the "masterminds" behind the scam will find out soon enough

half harness
#

โ„ข๏ธ

#

wut

#

:r:

#

(r)

#

how

#

ยฎยฉ

#

registered

#

copyright

#

;-;

#

ยฟ

#

?

#

no

#

?

#

i

#

_ _

#

woah

#

how did you do blank space

#

โ€‹

#

oh

#

wut

#

โ€‹

#

**

#

โ€‹

#

lol rip if you try nicking as โ€‹ it won't work via a bot

jovial warren
#

ayyy

#

happy new year all you british folk

prisma wave
#

Happy new years

steel heart
#

1 hour late smh

bleak cradle
#

Time zones do exist lol

steel heart
#

no

#

they dont

#

its all a hoax

prisma wave
#

interesting

#

idk about you dkim but mine has stopped

#

both on about 70 requests

onyx loom
#

and everyone else

steel heart
#

@prisma wave unsafe exist since or even earlier java 8 and then in all newer versions?

forest pecan
#

i saw this

#

in an anti cheat

#

High performance. 99% of Horizon's checks are asynchronous, which means that Horizon will almost no affect the server's TPS.

#

smh

steel heart
#

lol

prisma wave
steel heart
#

okay

#

some dude claimed it to be removed in java 9

prisma wave
#

As far as I know it still exists

#

Although stuff in the sun package is always unpredictable as not every JDK implementation will include it

steel heart
#

ah well

#

that makes sense

#

might use it to inject Listeners so listening to Event.java would be possible

#

and also make every event firing will include a dispatch of all superclasses

#

:]

prisma wave
#

Why would you need unsafe for that

static zealot
#

yes

steel heart
#

idk

#

to make it more better greater

#

reflection is more limited

#

I think

#

anyway openjdk doesnt have it for instance then?

prisma wave
#

OpenJDK does because it's effectively a mirror of oracle jdk

#

Afaik

#

But other impls may not

steel heart
#

ah okay

static zealot
#

wait I can do something like variable = !variable for a boolean?

#

oh that's nice

steel heart
#

the true power of the dark side

steel heart
static zealot
#

yes

ocean quartz
#

So, i've been thinking of a way to tell papi which player to parse the placeholder from, what would be better to use on a config:
%sender/recipient_placeholder_here% - Where you'd do either sender or recipient to get the parsing player
Or %placeholder_here%{sender/player} - This weird style?
Or feel free to suggest something else

static zealot
#

first one

#

that's what dchat has as well and looks a lot better imo. also might be easier for others to understand

ocean quartz
#

o

#

Didn't know that

#

I'll do that then xD

onyx loom
#

for sure first

steel heart
#

%sender|placeholder_here%

oak coyote
#

^ that makes more sense I feel

static zealot
#

no

ocean quartz
#

Yall are killing me

static zealot
#

nah you're killing yourself.

ocean quartz
#

Fair

obtuse gale
#

bruh

#

my projects decided to just delete itself leaving only the .idea

#

lol

#

optimistic decompilation time

#

oh wait i had this project on the hub

#

outdated version tho:(

#

Can I compare local code to a repo without like comitting to the repo or anything? So I can compare this decompiled version to the rpeo

#

Stash it maybe?

#

Dk how stashing works lol

#

idk what that means lol

#

and its safe to say looking it up didnt work

#

lmfao what

#

yeah ikd

lunar cypress
#

Clone the repo and use a diff tool

prisma wave
#

@quiet depot i was thinking about making each lesson a lot shorter, for example something like this:

1. Intro to Java - just the history
1.1 - Installing JDK + Sublime on Windows
1.2 - Installing JDK + Sublime on Linux
1.3 - Mac, but I don't have a Mac
2. Hello World
3. Variables

etc

#

thoughts?

quiet depot
#

sounds like more work but sure

prisma wave
#

possibly

#

it might make it a bit more streamlined though

#

since trying to fit in a JDK installation guide to the first lesson would be a bit janky

old wyvern
#

Do a prelogue episode with the setup?

#

Episode 0

prisma wave
#

that makes sense

#

ok

lunar cypress
#

I'm all for it

jovial warren
#

@prisma wave installing JDK + sublime????

#

you mean installing IntelliJ

obtuse gale
#

No

#

He means installing the jdk + sublime

prisma wave
#

i mean installing the jdk + sublime

onyx loom
#

fuck ides

lunar cypress
#

Programmers these days

#

All they know is ide, minecraft, eat hot chip and lie

jovial warren
onyx loom
#

"kotlin"

jovial warren
prisma wave
#

why wouldn't you

onyx loom
#

why do u need an ide to write hello world ๐Ÿคจ

prisma wave
#

exactly

lunar cypress
#

Hello world enterprise edition

old wyvern
#

AbstractHelloWorldFactoryProducer

onyx loom
#

o

jovial warren
old wyvern
#

huh?

#

xD

jovial warren
#

I said exactly

old wyvern
#

oh wait nvm

half harness
#

lol I just realized how bad learning spigot before java is xD

#

it has so many things that make java confusing

quiet depot
#

really not that bad

half harness
#

well

#

ik

#

but

#

its still

quiet depot
#

I learnt java through spigot and I think I turned out fine

half harness
#

bad

#

me too

#

i think im fine

#

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

prisma wave
#

Yeah same

half harness
#

but the @Override was confusing

#

I just figured it out a while ago

#

from fefo

#

well

quiet depot
#

Override is hardly a confusing concept

half harness
#

not exactly from fefo

prisma wave
#

@Override is one of the easier things lol

half harness
#

;-;

onyx loom
#

lol

prisma wave
#

The principle of overriding is harder to understand

quiet depot
#

it's honestly not, the english definition alone can be used to explain the function of the annotation

prisma wave
#

Also, managed to make my mic sound a lot better with a few audacity tweaks fingerguns

half harness
#

Now that I think about it overriding is so obvious ;-;

quiet depot
#

did you try rtx voice?

half harness
#

overrides its superclass

quiet depot
#

oh right windows only

#

I forgot

prisma wave
#

Yeah, used it when recording the windows jdk install

half harness
#

windows 10 pro ftw

prisma wave
#

Ngl I didn't notice too much of a difference, but it sounds good so

quiet depot
#

blow against your mic

#

and you'll see

half harness
#

did you post ep 2

#

I need to learn java :>

#

WIA

quiet depot
#

dkim he hasn't evn posted ep 1 yet

#

the ep 1 he p;osted was a draft

prisma wave
#

I haven't even posted ep 1 yet lol

#

^

half harness
#

oh

#

well

#

do u have ep 2 draft

#

๐Ÿ™‚

prisma wave
#

I have the slides for ep 2

half harness
#

๐Ÿ‘€

prisma wave
#

But not a video yet

half harness
#

i need to hear ur voice

#

what in the world does that do

quiet depot
#

the sense?

#

do you mean the purpose?

half harness
#

um

#

ok afk

prisma wave
#

Windows JDK Install video coming today hopefully

quiet depot
#

it's used natively efe

#

I think

prisma wave
#

And a Linux one too

quiet depot
#

tells the compiler to use the impl from the subclass, instead of the parent

prisma wave
#

Cube also made an amazing thumbnail design

quiet depot
#

saves processing time and may avoid ambiguity?

#

I'm not exactly sure

#

I just know that you should use it

prisma wave
#

I'm pretty sure @Override doesn't actually do anything alone

quiet depot
#

I believe it does

prisma wave
#

The compiler is smart enough to know when you're overriding

quiet depot
#

i'll check

prisma wave
#

The annotation just makes sure that you actually are overriding something

jovial warren
#

@Override likely indicates to the compiler that you want to explicitly override the method

quiet depot
#

yeah I think it's just to avoid potential ambiguity when compiling

jovial warren
#

yeah

prisma wave
#

I'm like 80% sure it's not strictly necessary

quiet depot
#

the override annotation?

prisma wave
#

Yeah

#

It just makes the compiler check that it actually is overriding

quiet depot
#

yeah I checked the doc, it's not necessary at all

#

just helps

#

because bukkit is stupid

#

like really stupid

prisma wave
#

What type of "class"

#

Both of them?

quiet depot
#

just an fyi, if you're ever implementing your own event system

#

don't go the bukkit route

#

look into the event bus pattern

onyx loom
#

what else did u expect?

prisma wave
#

The events don't have any logic inside them

#

All they are is a marker of something happening

#

The messy stuff where the event gets called is inside CraftBukkit

#

lol

#

fun main()

#

well pretty much

old wyvern
#

in older versions you needed to include the args tho

#

Kinda screwed me a lot in codechef

#

I meant kotlin version

#

codechef uses kotlin 1.2

#

So it didnt let me run the main function without the args parameter

prisma wave
#
fun main() {
    blah
}```
#

But yeah

#

Just use 1.4 :)

old wyvern
#

I cant on that platform sadly ๐Ÿ˜‚

#

But honestly kotlin still works out even if some of the helper extensions arent there on that version

#

We can just look up the extension and copy paste it into the solution

prisma wave
#

yeah 1.2 is still very usable

#

Don't need semicolon

#

Ok

#

Good

#

You still don't need a semicolon

#

Yes

old wyvern
#

The same way as you normally do?

lunar cypress
#

./gradlew build

prisma wave
#

or just click on the arrow next to main function

#

If you wanna execute it

#

If it doesn't have an arrow you've done something wrong

#

The main function can't be in a class

old wyvern
#

no need of the class

#

just the function

#

Kotlin allows top level functions

prisma wave
#

And top level variables

#

Yeah

#

First thing you need to know is that Kotlin doesn't have static

#

Which is why it can't be in a class

#

top level values are the main equivalent of static

#

But there is object too

#

Random.nextInt

#

Or an IntRange.random()

#

You can still use static methods

old wyvern
#

You also have companions

prisma wave
#

The nicest way of doing random numbers is (1..10).random()

old wyvern
#

which allow you to have something similar to static functions but in a OOP fashion

prisma wave
#

Although probably not the most efficient

old wyvern
#
class MyClass {
  companion object {
      fun test() {
        println("123465468464654")
      }
  }
}```
#

readLine function

prisma wave
#

^

old wyvern
#

or you could still use scanner like java

prisma wave
#

Or use a Scanner like you would in java

old wyvern
#

But readLine si recommended

prisma wave
#

val

#

Or var

#

Let is elara lol

old wyvern
#

xD

prisma wave
#

val number = readLine().toInt()

old wyvern
#

val is final btw

prisma wave
#

String interpolation

old wyvern
#

Strign templates

prisma wave
#

would be nice if Kotlin didn't require parens around ifs and whiles

#

Guess elara is better

old wyvern
#

^

prisma wave
#

Ooh I had a cool idea

#

I can't really describe it

#

But

#

Like implicit function composition

old wyvern
#

wdym?

prisma wave
#
let readNumber = readLine.toInt
#

So it's like an equivalent of ```
let readNumber => readLine().toInt()

old wyvern
#

Wouldnt that affect passing function references

prisma wave
#

Send code

#

Semicolons

ocean quartz
#

Wait you trying Kotlin?

old wyvern
#

Happens

onyx loom
prisma wave
#

toInt instead of parseInt

ocean quartz
#

Noice

onyx loom
#

the kotlin cult keeps growing fingerguns

old wyvern
#

But

#

Elara cult > Kotlin cult

onyx loom
#

o

#

bad

old wyvern
#

code out of code

onyx loom
#

Integer.parseInt ๐Ÿคข

ocean quartz
#

Also efe

prisma wave
ocean quartz
#

Do kt after the code block

#

You had the wrong one

onyx loom
#

ah yeah that would make sense

#

๐Ÿ‘

ocean quartz
#

Also brackets

prisma wave
#

semicolons
toInt() instead of parseInt
Braces on your ifs pls
IntRange.random might be nicer

ocean quartz
#

Yes

prisma wave
#

ifs without braces are evil

ocean quartz
#

Unless small one lines

prisma wave
#

compile time null safety

#

Literally the main feature of Kotlin

onyx loom
#

oh god no

#

NO

#

NO

ocean quartz
#
val number = Random.nextInt(10)
val number1 = Random.nextInt(10)
// or
val number = (0..10).random()
val number1 = (0..10).random()
prisma wave
#

readLine() is nullable because they might not type anything in

onyx loom
#

use ?. instead of !!

prisma wave
#

!! Is just an NPE, so it's the worst thing to use

onyx loom
#

!! is literally cursed

ocean quartz
#

Intellij will also recommend assert something != null
Just like !! should never be used

onyx loom
prisma wave
#

Braces

#

On else

ocean quartz
#

^

prisma wave
old wyvern
ocean quartz
#

Even then, though

old wyvern
#

Eh

prisma wave
#

The only purpose of !! Is when the compiler can't tell that something is non-null, but you can

#

Other than that you shouldn't use it

old wyvern
#

Or you actually want it to fail fast instead of usign wrong values or stopping execution

prisma wave
#

Eh

#

I'd prefer requireNotNull if you were doing that yugi

onyx loom
#

initialise the variable

ocean quartz
#

@obtuse gale If you want it simpler

 val line = readLine()?.toIntOrNull() ?: return
 if (line == number + number1) {
    println("You are a fucking motherfucker!")
 } else {
    println("You're bad lol")
}
old wyvern
#

Does that provide any difference?

prisma wave
#

there's an optional Exception message, and more importantly it's not an NPE

#

It's IAE or ISE

onyx loom
#

๐Ÿ˜‚

#

not an NPE, so its good

old wyvern
#

Ah in my case its just easier to use a !! as I wont get the exception name back

ocean quartz
#

Prolly a while true

old wyvern
#

or rather in the case im talking about

prisma wave
#

As Sxtanna once said, you should never manually program an NPE Into your code

old wyvern
#

for something like test cases in a coding competition

winter iron
#

only time i ever used !! is when i got something from a config but had a default value but it still thought it could be null

#

:/

prisma wave
#

Yeah that's bukkit API being dumb

old wyvern
prisma wave
#

Args

#

Like String[] args

old wyvern
#

mhm

prisma wave
#

But Kotlin equivalent

onyx loom
#

psvm equivalent

prisma wave
#

It's just optional in Kotlin

ocean quartz
winter iron
#

meh, i knew it couldnt be null so

#

it is what it is

old wyvern
#

for (VARIABLE_NAME in RANGE/ITERABLE) BODY

prisma wave
#

same as java

#

Pretty much

prisma wave
old wyvern
#

ah

#

no

#

yes

prisma wave
#

he's

onyx loom
#

var i is useless

prisma wave
#

yes

old wyvern
#

the i inside the loop is also a final one

prisma wave
#

Everything is final by default in Kotlin

old wyvern
#

except in this case you have no choice

prisma wave
#

Indeed

#

same with function parameters

ocean quartz
prisma wave
ocean quartz
#

No idea

prisma wave
#

Literally 99% of programmers will agree that immutable is better than mutable

#

Not really hard

ripe zinc
#

man reading all this is making me wanna switch to kotlin

ocean quartz
#

you should

onyx loom
#

ur more likely to use final variables rather than mutable, which means less boilerplate

prisma wave
#

Try it at the very least

onyx loom
#

theres 0 downsides lol

ripe zinc
#

downside of learning :^)

#

might give it a crack

ocean quartz
#

For me the hardest thing to getting into Kotlin was just the different syntax of variable: Type instead of Type variable

onyx loom
#

explicit type ๐Ÿ™„

#

WHEN

old wyvern
#

The only actual part that the default final variables make harder is something like changing the loop variable in a for loop

ocean quartz
old wyvern
#

But while loop easily replaces that so meh

onyx loom
#

when (variable) {
"+" -> blah
}
etc

#

or when {
variable == "+"
}

#

if else

#

basically

ocean quartz
#

When is like glorified switch

onyx loom
#

ah yeah thats better

#

-> blah

ocean quartz
#

Also @obtuse gale in kotlin something == "String!" works, unlike Java

old wyvern
#

yea and reference equality is ===