#dev-general

1 messages Β· Page 506 of 1

jovial warren
#

you remember that paragraph trying to combat your points in ?plsnolombok?

#

then insane humans use Kotlin, IntelliJ and don't need nullability annotations 🌝

stuck harbor
#

pfffft intellij

ocean quartz
stuck harbor
#

pffft 'features'

jovial warren
stuck harbor
#

well ive converted to sublime text

jovial warren
#

average vim fan vs average IntelliJ enjoyer

stuck harbor
#

after converting to emacs

prisma wave
#

it's worth mentioning at this point that haskell does optionals SO MUCH better

stuck harbor
#

ive done the reverse power user

prisma wave
#

pattern matching makes maybe monad a work of art

potent nest
#

I hope they find a nice way to bring pattern matching with optional too

prisma wave
#

They'd better

jovial warren
#

wdym optional pattern matching?

#

example?

prisma wave
#

Pattern matching sealed classes 🀀

potent nest
#

Because pattern matching is epic

jovial warren
#

isn't Java's pattern matching basically ported when?

ocean quartz
#

Haskell ahegao

potent nest
#

Probably my favorite Haskell feature

potent nest
prisma wave
#

There's only one pattern you can match

jovial warren
#

show me the difference

jovial warren
prisma wave
#

the only thing when can match is booleans

jovial warren
#

not true...?

prisma wave
#

Pretty much true

jovial warren
#

when can match anything

potent nest
jovial warren
#

how can it not?

#

show me wtf you two mean

potent nest
#

It takes the first branch that evaluates to true

prisma wave
#

mhm

jovial warren
#

ah

prisma wave
#

Proper pattern matching is about matching the structure of objects

ocean quartz
#

Deconstructed is probably the only true pattern matching in Kotlin

prisma wave
#

oh yeah

#

that could be considered a pattern match

jovial warren
#

you mean destructuring?

prisma wave
#

right back at pc now

obtuse gale
#

i.e. when is just a bunch of chained if else's 🌚

jovial warren
#

yeah

prisma wave
#
case someFunctionThatReturnsAMaybe of
  Just value -> putStrLn value
  Nothing -> putStrLn "Function did not return a value"

this is a pretty basic example

jovial warren
#

that literally looks like a when

prisma wave
#

sure

#

similar syntax

gusty glen
prisma wave
#

but i'd like to see when do that, in it's current state

#

the closest you could get is smart casting

#
when (val res = someFunction()) {
  is Just -> println(res.value)
  is Nothing -> println("no value")
#

more noise, and an extra variable

#

what else

#

you can pattern match lists too

potent nest
#

smart casting was a fault, change my mind

gusty glen
#

@prisma wave arrow-kt ❀️ ```KT
val someValue: Option<Double> = Some(20.0)

val value = when(someValue) {
is Some -> someValue.value
is None -> 0.0
}```

jovial warren
#

that actually looks kinda nice ngl

prisma wave
#

not bad

jovial warren
#

the arrow one

prisma wave
#

although still noisier

jovial warren
#

close enough

obtuse gale
#

anyone into MERNING

jovial warren
#

wat

gusty glen
#

you can also use fold to pattern matching KT Some(3).fold({ 1 }, { it * 3 })

potent nest
#

I mean the Maybe monad is basically the easiest, but Haskell allows way more pattern matching

old wyvern
#

It also cant do further constructor matching

obtuse gale
prisma wave
old wyvern
#

ErLang takes all that to the extreme

#

Except its syntax is absolutely horrific

jovial warren
old wyvern
#

Even assignment is pattern matching in erlang

jovial warren
#

it should be fold(1) { acc, it -> acc += (it * 3) }

prisma wave
#
reverse l = case l of
  [] -> [] -- reverse of empty list is empty list
  [a] -> [a] -- reverse of single element is single element
  (a:xs) = reverse xs ++ a -- head:tail turns into reverse(tail):head

list pattern matching in haskell

#

yeah ik guards

potent nest
#

I prefer multiple function declarations over case of

prisma wave
#

indeed

#

me too

#

just trying to keep simple

old wyvern
#
{message, Value, Id, {to, Uid}} = MyMsg

This would match MyMsg against the left structure and assign variables as they match,
So it would capture, Value, Id and Uid

prisma wave
#

kotlin kinda has that in destructuring

#

but not as powerful

gusty glen
old wyvern
#

This also matches objects in them tho

jovial warren
#

you put { 1 }, which is a function secretx

prisma wave
#

yeah

old wyvern
#

Destructuring cannot really match

jovial warren
#

that's weird

gusty glen
#

yes

jovial warren
#

why don't they use the normal Kotlin fold style?

gusty glen
#

it's a default value in case the Option is None

jovial warren
#

ah

gusty glen
#

because the idea behind functional programming is laziness, all values must only be computed if needed, hence why 1 is a lambda (lazy supplier)

#

there's a lot of extension functions to work with nullables etc

jovial warren
#

maybe Krypton should use arrow and become more functional

prisma wave
#

structuring things functionally is hard

old wyvern
#

ErLang also does the "No Errors at Runtime" very differently even tho its functional

prisma wave
#

without experience

gusty glen
jovial warren
#

I'd rather use Arrow than switch to Haskell lol

prisma wave
#

obviously

old wyvern
#

Its way is to simply crash the process if any slight thing goes wrong

prisma wave
#

lmao

old wyvern
#

And spin the process back up

#

Yup

#

Its built to crash

#

Quite literally

#

But the entire application continues

#

ErLang processes are lightweight

prisma wave
half harness
#

what happens if i do ```kt
@Nullable
fun test(): String {
return Some.COOL
}``````java
public class Some {
@NotNull
public static String COOL = null;
}

jovial warren
#

thinking about Haskell, can someone teach me Haskell lol

prisma wave
#

yes

gusty glen
old wyvern
#

Yes!!

jovial warren
#

if I can get this stupid piece of shit IJ plugin to work

half harness
# jovial warren thinking about Haskell, can someone teach me Haskell lol
import Data.Char

llIlIlIIlIllIll :: String -> IO ()
llIlIlIIlIllIll llIIllIIIlIIllI = putStrLn $ lIlIlllIlIlIlll llIIllIIIlIIllI
main = do {
  lIlIIIlIIlIIIlI;
}
lIlIIIlIIlIIIlI :: IO ()
lIlIIIlIIlIIIlI = do
  llIlIlIIlIllIll . lIIIlllIIIIlIll $ llllIlllIlIIlll lIlIllIllIlIIll
lIlIllIllIlIIll :: [String]
lIlIllIllIlIIll = lIlIlllIIIlllll "ghi" (-6)
lIIIlllIIIIlIll :: [String] -> String
lIIIlllIIIIlIll = head . tail
lIlIIlIlIIIIIlI :: [String] -> [String]
lIlIIlIlIIIIIlI lIIlIllllIIllll = filter (lIIllIIllIIlIll) lIIlIllllIIllll
lIlIlllIlIlIlll :: String -> String
lIlIlllIlIlIlll lIlIIIlIIIIIIII = filter (llllllIlllIIIII) lIlIIIlIIIIIIII
llllllIlllIIIII :: Char -> Bool
llllllIlllIIIII lIIlIIIlllIIlll = lIIlIIIlllIIlll /= '\''
llllIlllIlIIlll :: [String] -> [String]
llllIlllIlIIlll llIlllllIIlIIIl = lIlIIlIlIIIIIlI $ fmap (\lIIlllIlIIllIll -> lIIlllIlIIllIll) llIlllllIIlIIIl
lIIllIIllIIlIll :: String -> Bool
lIIllIIllIIlIll _ = True
lIlIlllIIIlllll :: String -> Int -> [String]
lIlIlllIIIlllll lIlIIlllllIIlIl llIllIlIIllllIl = (\llIlllIIIlIIlIl -> show $ chr $ ord llIlllIIIlIIlIl + llIllIlIIllllIl) <$> lIlIIlllllIIlIl
```easy smh
old wyvern
#

Dont use that

prisma wave
# gusty glen
do
  a <- Just 1
  b <- Just (1 + a)
  c <- Just (1 + b)
  return $ a + b + c
``` 😌
old wyvern
#

It sucks

#

Use the vsc plugin

#

Or just ghcid

prisma wave
#

emacs 😌

stuck harbor
#

πŸ˜‰

#

eemacs

prisma wave
#

this guy gets it

jovial warren
#

oh yes, I've already got the Haskell plugin in VSC

old wyvern
#

imacs

jovial warren
#

just gotta find out how to run it lol

old wyvern
#

Yea use that bard

#

Its much better

jovial warren
#

VSC is complaining about GHC not being installed

old wyvern
#

Use stack run to run if you're using stack

jovial warren
#

which is BS, since it is fucking installed

stuck harbor
#

bardy just git good

old wyvern
stuck harbor
#

just git good

jovial warren
#

also, stack run gave me No executables found.

#

do I need to compile it first or something?

old wyvern
#

Oh right build it

#

stack build
stack run my-project-exe

obtuse gale
#

Oh god Bardy trying Haskell?

jovial warren
#

apparently ghc actually doesn't exist thonking

prisma wave
#

smh

jovial warren
#

anyway, lemme build this

prisma wave
obtuse gale
#

D:

jovial warren
#

Error parsing targets: The project contains no local packages (packages not marked with 'extra-dep')

#

AAAAAAA

old wyvern
#

You dont see ghc installed globally if you're using stack, it should install a local version

old wyvern
jovial warren
#

I just ran stack init

#

like it told me to

old wyvern
#

theres also stack setup

jovial warren
#

ah

stuck harbor
#

bardy just use macos

#

easy

#

peasy

prisma wave
#

no correlation found

gusty glen
#

Arrow-KT Option is like Optional, except that it doesn't suck

old wyvern
jovial warren
#

what does this error parsing targets mean

old wyvern
#

It says you dont have any packages added

#

You need atleast base

#

Stack setup should do that for you

jovial warren
#

it worked

prisma wave
#

😌

old wyvern
#

😌

jovial warren
#

right, where do you tell this thing which file the entry point is?

old wyvern
#

You dont need to

prisma wave
#

^

#

just module Main where

#
module Main where

main :: IO ()
main = undefined
half harness
#

BARDY

jovial warren
#

all I get is someFunc

half harness
#

ur learning haskell

#

πŸ‘€

prisma wave
jovial warren
#
module Main where

main :: IO ()
putStrLn "Hello World!"
main = undefined
```probably borked code
prisma wave
#

very much so

jovial warren
#

what's wrong with it?

prisma wave
#

that hello world cant go there

jovial warren
#

where does it go?

prisma wave
#

main = putStrLn "hello world"

old wyvern
#

Wrong directorybard

prisma wave
#

and yeah

old wyvern
#

Look under app

prisma wave
#

app is where your entrypoint and impure stuff usually goes, the rest in lib

jovial warren
#

oh

old wyvern
#

src contains your main "logic"

prisma wave
#

oh src*

jovial warren
#

right

#

Hello World! ayyyyy

prisma wave
#

πŸ‘

#

okay anyway

jovial warren
#
module Lib
    ( helloWorld
    ) where

helloWorld :: IO ()
helloWorld = putStrLn "Hello World!"
```more borked code?
stuck harbor
#

now make a RESTful API you child

#

πŸ˜‰

jovial warren
#

lol

stuck harbor
#

easy stuff

prisma wave
#

that looks fine

jovial warren
#

right, introduce me to some core concepts and some... questionable syntax choices

prisma wave
#

everything is a lazy function

#

every function is a single expression

#

everything is pure

#

everything is an expression

old wyvern
#

Functions can be partially applied

prisma wave
#

🀀

old wyvern
#

😌

potent nest
#

currying is epic

steel heart
#

curry is epic

jovial warren
old wyvern
#

Haskell Curry is Epic

prisma wave
#
add :: Int -> Int -> Int -- function signature
add x y = x + y 

add3 :: Int -> Int
add3 = add 3

main :: IO ()
main = print (add3 5)
#

all functions are single parameters

#

i.e a mathematical function, 1-to-1 mapping

#

well not necessarily 1to1

#

but

half harness
#

print $ add3 5 😌

prisma wave
#

still

old wyvern
#

You can actually define custom operators with custom precedence as well. Oh and operators can be partially applied as well

half harness
#

putStrLn $ show $ add3 5 😌 😌

prisma wave
old wyvern
#

😌

prisma wave
#

😌

#

wait no

#

dkim 😌 license removed

#

putStrLn $ show 🀒

old wyvern
#

You can also apply any function in infix form by using them in the infix spot with ` on either sides

prisma wave
#

i think hes stopped listening

old wyvern
#

Lol

obtuse gale
half harness
#

Lol

potent nest
#

`div`

prisma wave
half harness
prisma wave
#

because all functions only have 1 parameter, functions with more just return functions

half harness
prisma wave
#

add takes an Int and returns an Int -> Int

half harness
#

x y = parameters

potent nest
#

you can also write something like map (+2) [1..]

prisma wave
#

😌

half harness
#

🀒 (+2) <$> [1..] ftw

prisma wave
#

lol

#

functors 😌

half harness
#

idkwhatthatisbutthatseemscool 😌

prisma wave
#

what that is

#

any type with the <$> operator (fmap) is a functor

obtuse gale
#

Okay I think I get it

half harness
#

oh

obtuse gale
#

Hmmm

prisma wave
#

in java terms it's ```java
Function<Integer, Function<Integer, Integer>> add = x -> y -> x + y;

half harness
#
val function = {(x: Int, y: Int) -> x + y }
``` 😌
#

wait

prisma wave
#

lmao imagine needing types

half harness
#

i didn't do that right

prisma wave
#

function x y = x + y

obtuse gale
half harness
#

lol

obtuse gale
#

That's cool and it makes sense cause lazy

prisma wave
#

yes precisely

#

and like the others have said, it has some nice side effects

#

map (+2) [1..5] = [3, 4, 5, 6, 7]

#

because + is curried

#

really immature dkim

half harness
#

<$> 😌

prisma wave
#

yeah yeah you dont need to tell me

old wyvern
prisma wave
#

😌 😌 😌

ocean quartz
#

Thoughts? thonking

old wyvern
#

Looks great!

heady birch
#

@prisma wave Scala > Kotlin

prisma wave
#

absolutely not

#

actually maybe

heady birch
#

I looked at scala and kotlin is like a copy

prisma wave
#

yeah

#

kotlin took a lot from scala

heady birch
#

kotlin doesn't have TRAITS though

prisma wave
#

😌

ocean quartz
#

A blog post titled "Why Scala wins against Kotlin" on a website called Scalac.io, is definitely not going to have any bias 🌚

old wyvern
#

Scala is pretty great

ocean quartz
#

Pretty high pay as well

old wyvern
#

mhm

prisma wave
#

why use scala when you could use elara

#

!!

old wyvern
#

^^

#

Elara ftw

prisma wave
frail glade
#

Lol

jovial warren
#

I just read 2 blog posts and I still think Kotlin is superior

winter iron
#

can i preserve comments in my yml file if i change something and save it?

jovial warren
#

how dare you insult my religion

prisma wave
prisma wave
jovial warren
#

use configurate maybe?

jovial warren
prisma wave
jovial warren
#

Haskell will likely never be my favourite language

prisma wave
#

we'll see about that

winter iron
jovial warren
#

thinking about Sponge, I wonder what else I should steal from Sponge πŸ€”

#

the way Sponge gets around messy static abuse is even more hacky lol

#

it uses factories and a factory provider to provide those factory instances from the backend

ocean quartz
#

Do like forge, embrace the static abuse 🀑

jovial warren
#

wait I haven't seen Forge yet

#

dare I look?

ocean quartz
#

Everything is done with a singleton

jovial warren
#

any idea where that singleton is?

ocean quartz
#

Check any mod or mod tutorial and you'll see
I am talking about the mod creation part, i have no idea about the internal forge code

jovial warren
#

FMLModLoadingContext?

obtuse gale
#

why is my obs quality so bad i have the file size set to indistingushable and video bitrate at 5000 kbps its recording format is mp4 and the encoder is hardware (amd)

frail glade
#

So is there something with Kotlin 1.5.x, Gradle + Shadow 7 causing an issue with setting the archived file name from shadow? On Gradle 7.0.2 and Shadow 7, works fine when on Kotlin 1.4.32, but when I go to Kotlin 1.5.10, the output file jar is not keeping capitalization set. Looks like it's pulling the name from the settings.gradle file?

onyx loom
#

i had same issue a few days ago

#

idk if its still happening for me or not

old wyvern
#

adding a v behind the version seems to work

#
archiveClassifier.set("")
archiveBaseName.set("Guilds")
archiveVersion.set("v${project.version}")
ocean quartz
#

Normally I set something like archiveFileName.set("Project-${project.version}.jar") on shadow to get the name the way i like

#

Works fine on 7

old wyvern
#

That seems to get overwritten

old wyvern
#

oh wait setting archivesBaseName to the capitalized name seems to fix it

#

outside shadowJar

onyx loom
#

ill have to try that out

#

@onyx loom pinging myself so i can try it if i remember

obtuse gale
#

@onyx loom have you tried yet?

onyx loom
#

im in bed 😐

obtuse gale
#

Excuses excuses

ocean quartz
#

😐

obtuse gale
#

Who

#

Where

#

When

ocean quartz
#

Dev den

obtuse gale
#

k banned

ocean quartz
#

Lmao

onyx loom
#

wait, u havent heard of the spigot build tool?

ocean quartz
#

Is it better than Ant?

onyx loom
#

anything is better than ant

forest pecan
ocean quartz
pale shell
steel heart
#

Yo any1 wanna review some code?

pale shell
steel heart
pale shell
#

Oh I gotta load stuff

#

Whats vanis

#

Oh no

steel heart
#

?

forest pecan
#

🀑

steel heart
#

Wait

#

Uh

#

Shit

pale shell
#

Is this bad?

#

Shouldn't you resolve the apply being null?

steel heart
#

Uh well the Map#copyOf doesn’t take a map with null key

pale shell
#

Hm

#

Don't you log it or anything?

#

Oh no my ocd doesn't like this bit of code

#

It's not in alphabetical order :(

steel heart
#

Yeah

#

Lol

pale shell
#

Dude that triggers me so much idk why

#

I question if I have ocd sometimes

#

I have a suggestion

#

In GameServer you have maximum players, but no minimum players?

steel heart
#

Nope

pale shell
#

Don't you want that?

steel heart
#

Not my game

pale shell
#

Oh is it for someone else?

steel heart
#

Check out that site

#

Then you’ll probably understand

pale shell
#

Um, we're gonna need to have words.

#

You need your commit messages to explain what you did...

steel heart
#

Idk

#

I didn’t have a good message

pale shell
#

Also, why such big commits??? Please do them in smaller commits and push them all.

steel heart
#

No

#

I am lazy

pale shell
#

No

#

Bad excuse.

steel heart
#

You think I waste effort on that

#

No way

pale shell
#

It takes 2 seconds to do that.

steel heart
#

No it doesn’t

pale shell
#

It does.

steel heart
#

More like 20 min

pale shell
#

No, it takes like 2 seconds to commit each thing

steel heart
#

Yes too much time

steel heart
#

Not reading that

pale shell
#

Read it.

steel heart
#

No

pale shell
#

TL;DR
Revert a commit with ease if something goes wrong. Big commits are harder to revert

Small commits are easier to understand when reviewing a pull request.

old wyvern
#

Conc, you can do them finally if you wish to as well

#

Just add selectives files for commits

#

and describe what you changed in those

pale shell
#

Yugi, what is better? A bunch of smaller commits with one push of smaller code or one big push with all code

forest pecan
#

that isnt really a valid point lol

#

hes working alone

#

so nobody would care anyways

pale shell
#

It's still good habit to do smaller commits.

#

Idc if there's 1 person or 300. Smaller commits are better than larger.

forest pecan
#

uhhh, it definately matters if you are on a team or not

#

Lmfao

pale shell
#

No, it doesn't.

#

I do smaller commits when I'm coding by myself now.

forest pecan
#

Because you fuck up a ton?

#

Lol

pale shell
#

No

forest pecan
#

And also dude

#

its literally his second commit

#

Lol

pale shell
#

Because it's a good habit to get into. Once you start doing it the correct way (smaller commits) then you'll notice a improvement of source control.

old wyvern
#

Also yea

#

calm down

pale shell
#

Thank you yugi, someone else who understands the correct way to do it.

old wyvern
#

You did the same thing like 3 days ago

pale shell
#

Large commits?

old wyvern
#

I think conclure got the point

forest pecan
#

Frank, it's really not a big deal. There is much better advice which can be given...

pale shell
#

Yugi, I have changed though.

forest pecan
#

also, it's literally his second commit

#

you want him to commit like 20 times for like the first or seocnd commit?

#

Hell no

pale shell
#

Sorry, its just drilled into my brain on how to do it.

forest pecan
#

makes no sense at all

old wyvern
#

Sure, but no need to continuously rant on about it. You already told him once

pale shell
#

Sorry.

old wyvern
#

All good

pale shell
#

Idk how to explain, but it's drilled into my brain on doing small commits so for some reason I feel the need to get everyone else to do it.

forest pecan
#

because in reality if you are working alone nobody is going to give a shit anyways. Plus, you should already be writing recyclable code that would be easy to implement additions/deletions in the future..

pale shell
#

I feel like I should shut up.

forest pecan
#

Also, branches exist too

pale shell
#

I am worried that I'm going to let loose again. I didn't mean to go on a rant like that. I'm so sorry.

steel heart
#

Btw I have committed over 300 files in one commit once

old wyvern
#

😢

ocean quartz
#

How does Sponge handle the whole load, enable, disable stuff?

#

Is it similar?

#

Ah found it, similar enough

ocean quartz
forest pecan
#

why does that remind me of groovy

#

like the gradle scripts

ocean quartz
#

Groovy has something similar yeah

#

now that i think about it, the config() access is kinda redundant thonking

zenith raft
#

I'd really like to fully learn kotlin sometime, so many parts of it make it seem like an ideal language

#

but ever since using the gradle kotlin dsl, the whole lambda syntax thingy has reeeally confused me

#

it's a wee bit scary at first sight, lol

gusty glen
frail glade
#

Anyone watch the UE5 showcase yesterday? Really exciting what all they have to offer soon. It also looks amazing in-game.

cinder flare
#

dang what game is that?

frail glade
#

It's the demo project that you can get with UE5.

#

Only around 200GB in size and took a solid hour to compile for the first time.

cinder flare
#

wow, it looks kinda amazing though

frail glade
#

It really does. Especially if your graphics card supports their new Nanite rendering.

cinder flare
#

was it unreal or unity that started adding DLSS support?

frail glade
#

The compiled output game is 25GB. Not bad.

#

I'll be honest I do not know.

cinder flare
#

huh, cause that seems like the biggest improvement in performance for the next few years

frail glade
#

But with UE5 you can now drag things from the Marketplace directly into the world you're working on.

cinder flare
#

oh woah that's really nice

#

it's coming a lot closer to Unity-levels of ease-of-use

obtuse gale
zenith raft
prisma wave
#

why use kotlin when you could use

steel heart
#

java

#

Yeah I know

#

Foolish move

prisma wave
#

Hmmm

jovial warren
#

Haskell

#

😌

jovial warren
prisma wave
jovial warren
#

lol

steel heart
#

Man spigot discord hates on gradle as usual😞

jovial warren
#

lol

#

man, the new sealed interfaces are pog

#

I'm using them in the new Krypton command system I'm designing (which I totally didn't at all completely steal from Velocity)

steel heart
#

Ooo

#

Krypton has my expectations

jovial warren
#

there's going to be 3 types of commands:

  • Brigadier command, which wraps a Brigadier LiteralCommandNode
  • Legacy command, which is modelled after BungeeCord's command
  • Raw command, which is useful for "bolting on" external command frameworks
#

raw command gives you the arguments as a single string, without any processing

#

legacy command gives you them as an array of strings (I'm using an array since most cross-platform plugins seem to use an array, and having to convert to a list is expensive)

#

I wonder if I should keep the legacy command as an abstract class that takes parameters though or make it an interface

#

probably the former tbh, since I find that easier to work with

prisma wave
#

Dear god

#

Compiling with gradle on a laptop with 3gb ram

#

This not good

jovial warren
#

lol

cinder flare
#

i mean what's the alternative

prisma wave
#

71MiB of ram free apparently

cinder flare
#

also 3gb of ram wtf

#

it's like, $20 for 8GB

prisma wave
#

ddr3 of course

#

Laptop ram?

cinder flare
#

oh might be a little more

#

but shouldn't be too bad

prisma wave
#

Last I checked it's pretty expensive

#

For the type this laptop uses

#

Cuz it's old

cinder flare
#

oohh

#

alright, buy a new laptop

#

problem solved

prisma wave
#

can't afford one 😭

#

can't afford one that would be worth upgrading to, anyway

cinder flare
#

see if your school or a nearby university has a surplus

#

they sold like, 50 2015ish macs for like $20 a pop at my uni a bit ago

prisma wave
#

hmm

#

Could be an idea

#

My school probably won't, they only have shitty chromebooks

cinder flare
#

oop

distant sun
#

^

cinder flare
#

any nearby universities? they usually have some good stuff

prisma wave
#

ehh none that are near

cinder flare
#

in fact, my uni actually has a program for CS majors to get free laptops forever

onyx loom
prisma wave
#

Wow

#

lucky

cinder flare
#

if you complete the first two coding classes, and stay as a CS Major and don't drop out, you get a free laptop

#

and if you graduate you get to keep it, it's very cool

prisma wave
#

That's neat

cinder flare
#

you should come here BM

#

we can hang out

#

haha

prisma wave
#

yeah day trip to america

#

That'll be cool

cinder flare
#

yea!

onyx loom
#

day trip to america

#

man 2/3 of the day will be on a plane

prisma wave
#

probably like 90%

cinder flare
#

do a week trip

prisma wave
#

8 hour flight + ferry + train to london

cinder flare
#

hotels around here are very cheap cause everyone is gone for the summer

onyx loom
#

ferry haha

gilded granite
#

lmao i was to lazy to figure out how to make an infinate loop, so i just made a while (0 == 0) {

distant sun
#

while (true)

#

for(;;)

gilded granite
#

that works too

#

is there a permanant loop in java or am i actually supposed to do it like this

cinder flare
#

while (true) is the permanent loop

gilded granite
#

alright

#

yeah i'll change it to that so intellij stops screaming at me that its always true

#
            if (actionDone == "viewXp") {System.out.println("XP: " + xp + "/" + xpUntilNextLevel + " Level:" + level);}```
does anyone know why this just does nothing when i type viewXp?
distant sun
#

dont use == to compare strings

gilded granite
#

oh right

#

its .equals

#

i completly forgot about that lol

#

thanks for reminding me

obtuse gale
#

yo what was the thing called that i could use to host an sql server locally for testing purposes called? Deleted a ton of my files and forgot what it was called lol

cinder flare
#

you can just host an sql server

#

mariadb, if you're a good boi

obtuse gale
#

there was smthn i used to use but ig if i can do it without that thatll work too

cinder flare
#

you can use MySQL Workbench to send commands prettily

#

and that works with MariaDB

#

or if you have IJ Ultimate, you can access the SQL from IJ itself

obtuse gale
#

yeah i do

obtuse gale
#

ah yes

cinder flare
#

you don't need XAMPP if you just want the SQL

#

you can just download MariaDB right from their website

#

or package manager it if you're on not-windows

lunar cypress
#

Yes

#

Don't forget that xampp also installs the malware known as "php"

cinder flare
#

haha, and Perl and Apache

#

nginx gang rise up

gilded granite
#

how can i put a bunch of text in a file/class, then access the file/class in a my main method? since i don't wanna have 300 println's like i did in my last project

cinder flare
#

uh, example text?

gilded granite
#

what do you mean?

cinder flare
#

what kind of text are we talking about here

gilded granite
#

strings

#

lemme give an example wait

#
        System.out.println("Current Gear:");
        System.out.println("Level 3 Sword");
        System.out.println("Level 11 Helmet");```
#

so, what i want to do, is store the text in a file or class

#

then i can just print that in 1 line in my main method

cinder flare
#

do you care about what text you send? or do you just want to send all of it in order?

gilded granite
#

because i don't want 90% of my code to be print's

#

it would be exact text in exact order

#

im using it to make GUI's in a console rpg

cinder flare
#

oh yeah so you can just use a text file, separate it by newlines, and use a scanner to read through it in order

gilded granite
#

okay, do you know any guides for doing that? im quite new to java

cinder flare
#
Scanner sc = new Scanner(new File("potato.txt"));
while (sc.hasNextLine()) {
  System.out.println(sc.nextLine());
}```
#

that should do it

gilded granite
#

okay ty

#

can you give an example of what the file looks like?

cinder flare
#

actually it should be by lines

#

uh

#
Current Gear:
Level 3 Sword
Level 11 Helmet
#

it just reads them in line order

gilded granite
#

oh its that simple

#

okay

#

ty

cinder flare
#

You can use different delimiters if you really want to, or a file format if you plan on changing the data stored in it

gilded granite
#

okay

#

where should i store the project? am i able to store it in like /ProjectName/Texts/file.txt

#

or will it not be able to reach it from there

cinder flare
#

are you using gradle/maven?

gilded granite
#

unless intellij has that enabled by default, no

#

i've heard those names but i have no clue what they are

cinder flare
#

oh okay you can just put it in your project directory wherever you want

gilded granite
#

okay ty

obtuse gale
cinder flare
obtuse gale
#

indeed

gilded granite
cinder flare
#

uh

#

this sounds like a problem that would be best solved with OOP

#

as in, have each item have its own print method that you can just iterate through

distant sun
onyx loom
#

bardy uses exposed afaik

jovial warren
jovial warren
#

despite what false information BM might try to spread πŸ™‚

prisma wave
#

I am warming up to exposed actually

#

Using it in devdenbot

jovial warren
#

πŸ‘€

prisma wave
#

Although I still think I'd prefer hibernate for something really big

jovial warren
#

oh btw, anyone wanna see my newly designed command system for Krypton?

#

I based it off of Velocity's

#

I've officially deprecated the old Command (renamed to LegacyCommand now) to encourage the use of its (kinda) replacement, BrigadierCommand

#

BrigadierCommand is a command that's backed by Brigadier's LiteralCommandNode

#

then the other addition is RawCommand, which is a command that has its arguments supplied as a single string, to allow external frameworks to do their own processing

#

talk about breaking changes though amirite

#

what's binary compatibility though? /s

half harness
#
fun main() = runBlocking { // this: CoroutineScope
    launch { // launch a new coroutine and continue
        delay(1000L) // non-blocking delay for 1 second (default time unit is ms)
        println("World!") // print after delay
    }
    println("Hello") // main coroutine continues while a previous one is delayed
}
```what does runBlocking do? what if i put launch outside of runBlocking?
#

(also im not on intellij rn so i can't tryandsee)

half harness
#

since i think it creates the coroutine scope?

#

oh wait so runBlocking just runs, while blocking, but also creates a coroutinescope

#

so i'd assume theres something similar to runAsync {}?

prisma wave
#

runBlocking blocks

old wyvern
#

Inside a coroutine context you have async which exists for parrallel computation

prisma wave
half harness
old wyvern
#

If you dont want to execute skmething parallely just switch contexts with withContext where needed

cinder flare
#

hey Yugi

old wyvern
#

Hi star

cinder flare
#

remember that typescript thing

old wyvern
#

Which?

#

Oh that google script

cinder flare
#

the data connector thing i was working on a month ago

prisma wave
cinder flare
#

yea

old wyvern
#

Yea?

cinder flare
#

i uh... need some more help

old wyvern
#

Sure

cinder flare
#

join room 1?

half harness
old wyvern
#

In like 5 minute, not at pc rn

cinder flare
#

ah no problem, thanks in advance

prisma wave
#

Because you're using runBlocking there's no benefit from using launch afaik

#

Unless you change contexts in doWorld

half harness
#
fun main() = runBlocking { // this: CoroutineScope
    launch { doWorld() }
    println("Hello")
}

// this is your first suspending function
fun doWorld() {
    delay(1000L)
    println("World!")
}
```if i removed the `suspend`, would it print ```
World!
Hello
```?
prisma wave
#

it wouldn't compile

half harness
#

o

prisma wave
#

because delay is suspending

half harness
#

ah

#
fun main() = runBlocking { // this: CoroutineScope
    launch { doWorld() }
    println("Hello")
}

// this is your first suspending function
fun doWorld() {
    println("World!")
}
```would it print ```
World!
Hello
```?
prisma wave
#

probably

#

Try it and see

half harness
#

;-;

#

i can't rn

prisma wave
#

ima be honest I think the coroutine library is really overcomplicated and hard to learn, so im not super familiar with how it works

half harness
#

bardy's here!!!

jovial warren
#

you call launch, which launches a new coroutine

old wyvern
#

launch launches in the same context as a child

jovial warren
#

so that's gonna cause a race condition to see who can print the fastest

old wyvern
#

No bard

prisma wave
#

it's not a race condition if both are blocking

jovial warren
half harness
#

OH

jovial warren
#

launch isn't blocking though, is it?

old wyvern
#

There isnt a race condition here afaik

half harness
#

im barely understanding what yugi's saying thonk

old wyvern
#

The oarent waits for the child

prisma wave
old wyvern
#

The issue exists mostly for globalscopes

half harness
#

yugi u have to remember i have no idea what any of these are

jovial warren
#

does runBlocking use its own scope?

half harness
#

πŸ₯²

jovial warren
#

didn't know that

prisma wave
#

no idea

#

I just couldn't think of a better word

half harness
#
fun main() = runBlocking { // this: CoroutineScope
    launch { doWorld() }
    delay(1000L)
    println("Hello")
}

// this is your first suspending function
fun doWorld() {
    println("World!")
}
```would it print ```
World!
Hello
```?
prisma wave
#

yes

old wyvern
#

As long as you're launching in the same scope, it should wait for completion

half harness
#

uh

#

idk what scopes are

old wyvern
#

Now say you are in scope A and you launch into GlobalScope, the job starts executing separately

half harness
#

launch = create new scope?

old wyvern
half harness
#

runBlocking = create new scope?

prisma wave
#

launch = new coroutine in the same scope

half harness
#

hawdjksnd

#

then wheres the scope

old wyvern
#

Every coroutine call you make, is split up into mutliple jobs for the scope by the compiler

prisma wave
#

runBlocking would kinda be the scope here

#

there's not an obvious one in this scenario

jovial warren
prisma wave
#

Yes because parent waits for child

half harness
#

kotlin playground?

jovial warren
jovial warren
#

you sure it's not the other way around?

half harness
old wyvern
#

Parent jobs wait for child jibs

prisma wave
#

What about it?

jovial warren
#

because runBlocking is the parent here and launch is the child

#

and yet the println inside of the runBlocking runs before the launch code runs

#

so I get ```
Hello
World!

prisma wave
#

That's weird

half harness
#

also that box is really big

#

for me

jovial warren
#

import kotlinx.coroutines.*

half harness
#

i can't press the X 😩

jovial warren
#

lol

#

what a noob

prisma wave
#

Zoom out

jovial warren
#

^

half harness
#

😌

prisma wave
#

Anyway coroutines overcomplicated and hard ExecutorService good coroutines bad

jovial warren
#

wat

prisma wave
#

Or f# computation builders good, coroutines bad

jovial warren
#

coroutines aren't that complex

half harness
#

bm

prisma wave
#

We have already seen they're complex

jovial warren
#

contexts are a bit strange to understand, but they kinda make sense

prisma wave
#

i think the coroutines library is very overcomplicated

prisma wave
prisma wave
jovial warren
#

you sure that launch gets executed under a child context here?

prisma wave
#

wat

old wyvern
#

Yes bard

#

Try this

jovial warren
#

what if it gets launched under the parent context and then happens to run after the println?

old wyvern
#

define 2 launches

#

they should execute sequentially

jovial warren
#

yeah ik that

half harness
#

idk i just think launch as create new coroutine

#

and since u create new one after, it runs after

#

but if you delay the first, the second runs

old wyvern
#

Then it works fine?

jovial warren
#

yeah those get executed sequentially since they're launched on the same scope and put into the same queue

old wyvern
#

Yea

jovial warren
#

what's the outcome of that?

old wyvern
#

The parent is waiting for the children

#

But lets say

jovial warren
#

who is the parent here though?

prisma wave
#

runBlocking

half harness
jovial warren
#

yeah but how can the parent be waiting on the children if the parent gets executed first?

prisma wave
#

?

#

that's how coroutines work

#

it compiles to callbacks

#

Although probably not in this case

jovial warren
#

ik how coroutines work under the hood

#

I just don't get how that logic makes sense

prisma wave
#

parent starts
suspends, waits for first launch call to finish
resumes
etc
parent finishes

jovial warren
#

yeah

old wyvern
#

the job is alive

jovial warren
#

ah

half harness
#

why is there apparently no main method for this: ```kt
import kotlinx.coroutines.*

fun main() = runBlocking { // this: CoroutineScope
launch { doWorld() }
launch { doHello() }
}

suspend fun doHello() {
delay(100L)
println("Hello!")
}
suspend fun doWorld() {
println("World!")
}

old wyvern
#

Waiting not in the blocking sense

jovial warren
#

I thought you meant waiting on the children to finish execution

#

that's usually what waiting in this context means

old wyvern
#

Now if you were to launch those into another scope, the parent would die befor the children

prisma wave
old wyvern
#

This also means by cancelling the parent, you cant cancel the children

#

Another this is affects is exception handling

prisma wave
#

Add a type signature

#

wait wrong language

jovial warren
old wyvern
#

thing*

prisma wave
#

Add a return type*

jovial warren
#

@half harness just shove Unit at the end of runBlocking lol

old wyvern
#

another thing this*

jovial warren
#

adding a return type will cause you compile errors

half harness
#

uh

#

not for me :))

prisma wave
#

error is more obvious

half harness
#
import kotlinx.coroutines.*

fun main(): Unit = runBlocking { // this: CoroutineScope
    launch { doWorld() }
    launch { doHello() }
}

suspend fun doHello() {
    delay(100L)
    println("Hello!")
}
suspend fun doWorld() {
    println("World!")
}
```this prints ```
World!
Hello!
prisma wave
#

Well yes

#

why wouldn't it?

half harness
#

so basically

jovial warren
#
fun main(): Unit = runBlocking { // Type inference failed. Expected type mismatch: inferred type is Job but Unit was expected
    launch { doWorld() }
}
half harness
#

idk it works for me tho

#

lol

#

maybe Unit is an exception?

old wyvern
#

unit extends everything

#

That should work fine

jovial warren
half harness
#

ya

cinder flare
#

yeah Unit is like Object in java

old wyvern
#

Or should I say, everything extends Unit

prisma wave
#
producer :: Coroutine (Yield Int) IO String
producer = do yield 1
              lift (putStrLn "Produced one, next is four.")
              yield 4
              return "Finished"
``` :relieved:
jovial warren
#

I have never had that work for me Yugi

prisma wave
#

Or Nothing

jovial warren
#

I've always got that compiler error

prisma wave
#

yields

cinder flare
#

???

half harness
#

proof no error

old wyvern
#

Unit works in a similar sense bm

jovial warren
#

yeah Any is the superclass of all types, Nothing is a type to represent something that never returns

half harness
jovial warren
#

never has for me Yugi

prisma wave
#

I have no idea, presumably it supplies the value to the coroutine

jovial warren
#

Unit is still a type

prisma wave
#

similar to a sequence

old wyvern
#

Its implicit

half harness
#

wait so would launch {} and thread {} sorta do the same thing?

half harness
#

except that launch can run suspend functions

old wyvern
#

Coroutines jobs are not threads

#

They run on threads

half harness
#

i know

#

that's why i said sorta

#

since i want to know how they function first

jovial warren
half harness
#

i don't want to overcomplicate myself

half harness
cinder flare
old wyvern
#

With launch you cant expect it to be ran on another thread for sure

half harness
#

that's why i said sorta

old wyvern
#

If already in a coroutine context

prisma wave
old wyvern
#

You mgiht be dispatching to the same thing

jovial warren
prisma wave
#

XMonad best wm

cinder flare
#

well yeah you can't readjust after you let go? it takes the screenshot

half harness
cinder flare
#

you press Ctrl+PrntScrn to select the area you want to take a picture of

jovial warren
half harness
prisma wave
#

ehh

#

Kinda

cinder flare
prisma wave
#

They have the same effect, very different implementations

half harness
#

they both "sleep" the thread/coroutine

cinder flare
#

can you change the title of them perchance?

half harness
jovial warren
prisma wave
#

thread.sleep sleeps the entire thread, delay suspends the coroutine and resumes it after the time has passed

half harness
#

i know that coroutines are different from threads

cinder flare
old wyvern
prisma wave
#

mhm

old wyvern
#

It schedules the continuation to be ran after that time and lets other jobs execute

half harness
#

so besides it letting other jobs execute

prisma wave
#

yeah delay is more like bukkit runTaskLater than anything else

half harness
#

ignoring impls, it does the same thing?

prisma wave
#

yes

half harness
#

alr

old wyvern
#

mhm

half harness
#

okay

prisma wave
#

hell, a lot of coroutines are pretty similar to the bukkit scheduler

cinder flare
prisma wave
#

Very similar concept

cinder flare
#

the bukkit scheduler is a very cool idea i like it

half harness
#
val job = launch { // launch a new coroutine and keep a reference to its Job
    delay(1000L)
    println("World!")
}
println("Hello")
job.join() // wait until child coroutine completes
println("Done") 
```oh, and this would be like `Future#get`? (the job.join() part)
old wyvern
jovial warren
#

could probably remove that in my own fork though in like 5 seconds

half harness
#

lol

prisma wave
#

but then you have to maintain a fork

jovial warren
#

it's not rocket science

half harness
cinder flare
#

can you not just import upstream changes?

#

i doubt they ever modify that

jovial warren
#

^

prisma wave
#

probably

#

Although effort

cinder flare
half harness
#

wait a minute

#

this does not look like java

jovial warren
#

better than switching to a hacky ShareX port

prisma wave
#

maintaining a hastebin fork is annoying enough because they keep introducing conflicts with the css

old wyvern
#

sorry let me change my earphones

#

the mic on this doesnt work

half harness
#

oh its cpp

prisma wave
#

.cpp

jovial warren
#

yeah C++ isn't that hard lol

#

well, this in C++ is not that hard

half harness
#

dkim voice reveal soonℒ️

prisma wave
#

you can see a lot of the cpp influence in java though, a lot of the code is identical

jovial warren
#

just gotta figure out how to create a new project from version control in CLion

obtuse gale
#

it couldn't be that huge ass "Get from VCS" button at the top right

jovial warren
#

I don't see that

prisma wave
#

surely not

obtuse gale
jovial warren
#

like it's not there

half harness
#

lol

jovial warren
#

oh that

prisma wave
#

vcs fan vs zip file enjoyer

jovial warren
#

in the project menu

prisma wave
#

who needs commits when you can setup a cronjob to zip your project folder and back it up every 5 minutes

#

or better still, just don't make mistakes

half harness
#

just code everything at once, commit once, ez

forest pecan
#

vcs fan vs tar file enjoyer

half harness
#

no need to mess with vcs

forest pecan
#

me and the boys that use tar

#

Lol

prisma wave
#

7z

forest pecan
#

xz

#

@old wyvern

#

i hear you

#

i finally know your voice

#

lmao

old wyvern
#

lol

quiet depot
#

@distant sun is this pr tested?

#

oh well there's not much to test I suppose

distant sun
#

can I even test dd?

quiet depot
#

why couldn't you?

distant sun
#

idk does it not need a db or whatever?

quiet depot
#

the bot needs a mysql db (you don't need to run the docdex app, you can just use the official ver)

#

but what developer doesn't have mysql installed

distant sun
#

Β―_(ツ)_/Β―

old wyvern
#

Shouldnt running your defined tests be enough?

quiet depot
#

hah

distant sun
#

the changes were done on the discord module

quiet depot
#

I ran out of time to make tests yugi

old wyvern
#

ah

#

ok

quiet depot
#

I only had time to write code

#

and write a wiki

#

there's no documentation or tests

distant sun
#

trust me, it works!!

#

also, why the decimal format for colors smh

#

instead of 0x1RRBBGG where you clearly see the rgb

quiet depot
#

well I didn't know that was a thing

onyx loom
quiet depot
#

why

#

how

cinder flare
#

piggy only has code

frigid badge
#

docker

cinder flare
#

no test

frigid badge
#

imagine having mysql installed

#

couldn't be me

onyx loom
#

never bothered

old wyvern
#

Imagine having docker installed

quiet depot
old wyvern
#

trigger warning

frigid badge
#

docker better

quiet depot
#

mysql is like so essential

cinder flare
#

i mean why would I need docker locally

quiet depot
#

whether it comes in docker or not

#

it's essential

distant sun
#

@quiet depot wanna change the format?

old wyvern
#

oh btw finally got to actually using docker once

quiet depot
#

star lemmo runs everything in containers

cinder flare
#

oh

distant sun
#

lemmo lives in a container

cinder flare
#

I don't have enough RAM for that I don't think

old wyvern
#

Lemmo is a container

quiet depot
#

with a will there's a way

frigid badge
#

docker doesn't use much ram

old wyvern
#

Haskell doesnt use much ram

cinder flare
#

oh does it dynamically allocate resources?

frigid badge
#

yeah and you can limit it

cinder flare
#

oh hmm

#

pros of that vs running locally?