#dev-general

1 messages · Page 56 of 1

ionic gust
#

makes it harder tho

prisma wave
#

and figure out the endpoint

distant sun
#

If you dont do the checks yourself, this is bound to happen.

prisma wave
#

to figure out

distant sun
#

It takes one motivated person

#

Then they can distribute the code

prisma wave
#

why is it so important this data is accurate?

distant sun
#

I feel like the more you try to make it harder, the more someone would want to crack it pepe_kek

#

Assuming your shit is actually worth the time, no offence!

ionic gust
#

which none of them like, so they have high motivation to spoof

ionic gust
prisma wave
#

hmm i see

ionic gust
#

how did i just realize

prisma wave
#

close enough

remote goblet
#

same channel

ionic gust
distant sun
#

God

ionic gust
#

still struggling btw

#

actually i think we sorta decided on this

#

¯_(ツ)_/¯

prisma wave
#

seems sensible

#

what does this have to do with the player count spoofing

ionic gust
remote goblet
#

maybe this is an insane question but

#

why would someone spoof it

ionic gust
#

and if we removed partners with inactive servers, theyd bypass it

prisma wave
#

what motivation would they have to do that

#

what do they get out of saying it's active when it's not

ionic gust
prisma wave
#

i see

#

im gonna be honest the most reliable way would probably just be manual checking

#

or a combination of the two

#

theres nothing stopping me as a server owner from installing a player spoofer

#

and pretending there are 100 players online

#

a human might be able to notice that they're not real but no plugin ever could

#

presumably there arent many partners, right?

#

it's a fairly exclusive thing?

ionic gust
#

we have 41 partners rn, its not super exclusive

remote goblet
#

why do you have so many...

prisma wave
#

alright

ionic gust
prisma wave
#

still though, i feel like it's fairly obvious when something is/isn't active, right?

ionic gust
# ionic gust

and then they also have to ping @everyone in their server with our ad

prisma wave
#

just look at their discord or whatever

prisma wave
prisma wave
#

right

#

yeah i mean, i guess the most sensible thing would be

#

have the plugin send automated reports

#

but also do manual checks every so often

#

so if they do manage to spoof it somehow they cant get away with it for long

prisma wave
#

and then you just review those

#

any big server will have some analytics software like Plan installed, right

ionic gust
prisma wave
#

okay

#

well, stats for the host doesn't really matter

#

theres zero incentive for the host to lie to themselves

ionic gust
#

would jsut be annoying for us if we wanna look thru some stats

prisma wave
#

the leaderboard maybe could be an issue? but i think it'd become pretty obvious if someone was lying

remote goblet
#

can i go off topic very quickly and ask for brister mitten code review

prisma wave
#

as a treat

#

(im very washed)

prisma wave
remote goblet
ionic gust
prisma wave
#

youre making a gui framework?

remote goblet
#

unfortunately

ionic gust
remote goblet
#

yes i know im not gonna use that lmfao

prisma wave
prisma wave
remote goblet
#

i feel like for the plugin scope where its supposed to be api centered, it makes more sense to have the plugin handle it

prisma wave
#

uh

ionic gust
remote goblet
#

perhaps not neccessary

prisma wave
prisma wave
#

but maybe im misunderstanding

remote goblet
#

i think i just want many aspects to be in the plugin's control

prisma wave
#

i mean you can still do that

#

triumph is fairly "thin"

#

it doesnt really enforce anything

#

ive written wrappers around it before

remote goblet
#

probably could but :(

#

i actually just cant think of how i want it to actually be written

prisma wave
#

a fully fledged gui framework is a lot of time and annoying

prisma wave
remote goblet
#

remake pyrofishing but not shit LMFAO

prisma wave
#

okay i mean i know nothing about that plugin haha

#

i mean for the guis

remote goblet
#

i think the way guis are written are just so ugly so i was trying to find a way to approach it that isnt.. ugly

#

but yeah it might be unnecessary

prisma wave
#

i agree that theyre ugly

#

but it's more of a java problem than a library problem

remote goblet
#

i quit working on any plugin the immediete second a gui is involved

prisma wave
#

so real

remote goblet
#

my hatred for them cannot be described

prisma wave
#

one day i will make elm-architecture gui framework which will still be ugly but in a more bearable way

onyx loom
#

I disagree

#

I dont think u will

prisma wave
#

you're probably right

remote goblet
#

that plugin was so fun to work on until it needed guis and i barely touched it since

prisma wave
#

many such cases

ionic gust
#

@prisma wave i released the plugin and this is the first thing someone says about it:

it seems you figured out how to obfuscate the jar
its not even obfuscated tho 😭

prisma wave
#

lmao

#

thats the best obfuscation

#

just lie

#

nobodys gonna notice

ionic gust
#

💀

ocean quartz
#

Use Kotlin on the plugin, most decompilers will cry pepeLaugh

cinder flare
#

sounds like basic web auth 101 lol, any client is all the same, a web frontend has the same level of trust as a random minecraft server - ZERO

#

just issue tokens or whatever per client so you can track requests and get rid of people if they don't follow the rules or whatever, then nobody unauthorized can use your private API and whatever

#

obsfuscating your jar isn't going to help at all, when it comes to http there are like a million ways to track requests and like proxy them to modify them and shit, it's super simple

distant sun
#

Does anybody know if there is a library for web icons that contains vegetables and other cooking ingredients?

desert horizon
#

Should be easy to find a good icon set through that

distant sun
#

Thanks

pastel imp
#

first time doing smt like this with js, I still hate javascript

#

ngl I so much rather do it in java but yk.. not possible

ocean quartz
#

Wdym is not possible?

#

As a website sure but as an app that is definitely possible

pastel imp
#

I know it's possible as an app

brazen ether
#

web dev in haskell

ocean quartz
#

Can do it in Kotlin :)

pastel imp
#

my dream, as weird as it sounds, would be to have smt like javafx or whatever other framework that works in java/kotlin for web frontend stuff

#

xd

pastel imp
brazen ether
#

goes crazy

pastel imp
#

that exists? tf?

ocean quartz
#

Yes

pastel imp
#

what does kotlin NOT have

#

lol

brazen ether
ocean quartz
#

Kotlin is not just a jvm language

brazen ether
#

):

ocean quartz
#

Ios, android, jvm, js, wasm

pastel imp
#

wonder if I can use the Kotlin/JS compiler with svelte's compiler

#

doubt it works

ocean quartz
#

Prolly not

pastel imp
#

welp, then we back to step 0 xD

ocean quartz
#

Too much going on, there's an attempt to get react working but it fails a lot

pastel imp
#

unless kotlin somehow also has a frontend framework xD

oblique heath
#

surely it does if it bothers to support compiling to js

ocean quartz
#

Compose, but only with wasm

ocean quartz
#

But hey if you really need js at least use ts instead

pastel imp
#

I love svelte, but I hate js so, xD

oblique heath
#

svelte goes hard

pastel imp
#

guess I gotta figure out a way to live with js

#

xd

pastel imp
ocean quartz
#

Then use ts instead

pastel imp
#

well

#

I am

#

xd

#

I still hate it

#

tbf I never got too much into js (or ts) since I never required extreme knowledge on it

#

until now

prisma wave
#

YEEEEEESSSSSS

prisma wave
brazen ether
#

hehe

prisma wave
#

you can actually kind of do this

#

well not literally with haskell

#

but PureScript (and Elm too kinda) is so similar it's close enough

old wyvern
#

Elm ftw

frigid badge
#

rust ftw

crude cloud
prisma wave
#

i thought this server was safe from the rust mob

frigid badge
#

wow

desert horizon
#

At least it's not brain****

distant sun
#

People with full time jobs, how the fuck do you find time and will, to learn anything programming related, after spending 8h in front of the computer on a chair?

#

I barely find motivation to go to gym after work, opening my personal laptop would require some magic

ocean quartz
#

Always nice to work on something new, specially something different from your job
That's why I keep starting new things, finishing in other hand ... pepeLaugh

distant sun
#

Like, I need to learn some web stuff (html, css, ts, layouts, whatever) and angular for work (don't start with "learn react, learn x" etc.), things that will help me at work but also for some personal projects, but I can't find motivation. After work I don't really feel like spending some more hours in front of the computer, and during weekend I usually do the things I can't do during the week

ocean quartz
#

Ah yeah that case is more complicated, for me motivators are challenges, for example when I started on backend stuff I had 0 experience with spring and very little motivation to learn it, but then I was given a pretty big challenge optimizations and that made me motivated to research and learn more

distant sun
#

I would love to work on personal projects that involve websites, but for the love of god, I can't learn html, and that demotivates me.

#

Like, I have a small layout on my mind but I can't figure out all the properties and stuff and I quit smh

ocean quartz
#

Tbh not much to learn for html, there is only like 6 tags you'll actually use for 99% of things :')
The js and css side is where it's a bit more compicated

distant sun
#

Yeah by html I also mean css

ocean quartz
#

Can you use tailwind at work?

distant sun
#

We use bootstrap; it is a quite old, inherited project

#

For my own projects id probably use tailwind or smth else

ocean quartz
#

I see, that's a little more annoying, but css isn't too bad, I find it's easier when you search for videos of people building certain things with css and then see how some properties they change affect the overall structure on the page

distant sun
#

Oh yeah, and when I do it everything goes everywhere 🤣

onyx loom
#

I'll have motivation to start smth, then by next week I cba again

wind patio
#

and, well, I try to be more versatile in case I decide to switch to a different job which has an entirely different stack

oblique heath
#

like my ad campaign which i have been spending about $10 a day is getting 1+ people a day just signing up for emails (thats all i let them do right now), which feels really good

#

working on a project without constant external validation is the true killer

wind patio
#

I do enjoy having no deadlines and not having to fix missing whitespaces during code review

cinder flare
wind patio
#

well, if you're learning something new, isn't it not for nothing?

cinder flare
#

well i suppose, but like, if i had an external reason to do it i would be 1000x more likely to do it yk

wind patio
#

makes sense

desert horizon
frigid badge
#

you rarely have the time or motivation to do something

#

when you see something really fancy you do work on it but never end up finishing it

distant sun
#

Thats not good @frigid badge smh

distant sun
#

@frigid badge

frigid badge
#

yup

desert horizon
desert horizon
#

IntelliJ is acting rather weird for me....

#

2 times in a row did some dependencies break, namely the import not being recognized or some methods...

#

And both times did I had to clear cache to fix this... Not sure what is going on there.

old wyvern
#

Updated to latest? Check your plugins for the respective languages

#

Happens sometimes when you have incompatible plugin version and ide version

#

Happens a lot with kotlin

brazen ether
#

lua is interesting

prisma wave
#

This is just higher order functions isn’t it?

#

Like it’s cool but it’s not anything particularly fancy

#

You can do this in Java even

brazen ether
#

that's the application here

prisma wave
#
record Thing(Consumer<Integer> execute){}

var thing = new Thing(i -> sout(“index: “ + i));
#

Looks pretty similar to me

brazen ether
#

i'm not saying it's a special feature bro 😭

brazen ether
#

this isn't the same

#

tables aren't the same as record classes at all

#

a lot of configuration stuff uses lua so i've been playing around with it just a tad bit

oblique heath
#

redis lua transactions my beloved

prisma wave
prisma wave
brazen ether
#

thing is just an object

#

it has no constructor

prisma wave
#

Yeah I know

#

Like JavaScript or whatever right

#

But it’s a rough equivalent in that it’ll produce the same functionality

brazen ether
#

yea, Lua's only non primitive data structure is a table

brazen ether
#

basically just repeatLambda takes in a table which should have a named field execute which should be defined as a function and should take in an integrr

#

I didn't put the annotations here

#

but like you can't rlly think of thing as a class

#

it's literally just an array/object

brazen ether
prisma wave
prisma wave
#

I know they’re not the same

cinder flare
#

classic Java

#

helped a friend do some like LeetCode-style exercies in Java, oh god it's rough man

#

I used Kotlin and had that shit in like 5 lines and he had to do a million other things, it was crazy

#
val first = string.getOrNull(index) ?: ""

vs

String first = "";
try {
  first = String.valueOf(string.charAt(index));
} catch (IndexOutOfBoundsException _) {}
#

plus just all the Kotlin sequence functions are awesome, like windowed, joinToString, etc.

potent nest
#

Was it forbidden to use if or what 😭

cinder flare
#

idk that's just what he wrote lol

#

i guess you could do bounds checking manually yeah

brazen ether
#

_

#

i always just see it named "ignored"

cinder flare
#

oh yeah it might've been ignored

#

underscore is just a lot nicer and used for stuff in like every other lang lol

potent nest
#

underscore only works since Java 22

brazen ether
#

ahh

potent nest
desert horizon
desert horizon
#

Tho probs as experimental?

potent nest
#

yeah it was a preview feature in Java 21

desert horizon
#

There is one thing I wonder right now, which is if someone ever made a GitHub Action that would analyze linked logs (i.e. via hastebin or mclo.gs) to then return some info....
Wouldn't be surprised if it would have great use within MC projects on GitHub.

prisma wave
#

Why does that need to be a GitHub action?

#

And what kind of info would it return

wintry plinth
#

Also intrigued to know what type of data would you want pulled out @desert horizon

desert horizon
#

And data would be server type + version, lists of plugins used and like notable errors/problems (exceptions and alike)

wintry plinth
#

Ahh you mean you submit an issue, and it creates a comment showing relevant extracted information from it?

ocean quartz
#

I was pretty confused at first too since you didn't mention github issues, when I think of github actions first thing I think is like commit actions instead

#

Should be pretty easy to do an action for that though

desert horizon
#

I don't have knowledge on this sadly

prisma wave
#

just make a normal script and then integrate it into an action

#

the github part is the easy bit

pastel imp
#

Random question, but any ideas on how you'd do something like modrinth's ad sharing system?

desert horizon
#

ad sharing in what way? Like their 75-25 split of ad revenue?

desert horizon
#

Pretty sure you could ask them or go through their website code.

distant sun
#

Sounds pretty straightforward, you get the revenue generated by a resource's page and just deposit x% on author's account every month.

pastel imp
pastel imp
#

ah "payouts"

#

oh god time to see if I understand it

#

seems like they fetch so called "aditude points" for a specific page from the ad network api and then use that

#

but I assume not all ad networks work like that

cerulean ibex
cinder flare
#

seems pretty nice actually

#

does it use like the Kotlin-JS compiler? or like WASM or something lol

pastel imp
cerulean ibex
#

well more like solidjs technically ig

cerulean ibex
#

its also rly nice having easy ide support since intellij pretty much just supports compiler plugins now

cinder flare
#

Compose Multiplatform just ain't it lol

pastel imp
#

Yeah it def. Is a very nice thing

potent nest
#

Pretty sure you could do the same thing in Scala without compiler plugin

ocean quartz
# cinder flare Compose Multiplatform just ain't it lol

Compose is pretty good, I'd take it over any JS framework if I could
But unfortunately not available for JS, only WASM and WASM has 2 issues, bundle size is bigger and garbage collector isn't enabled by default on any browser yet 😔

cerulean ibex
cerulean ibex
cinder flare
ocean quartz
#

Wasn't last time I checked, you needed to toggle on a flag

cerulean ibex
#

and compose multiplatform supports js although it draws to the canvas

ocean quartz
#

Oh damn seems like it is on chrome now by default yeah

cinder flare
#

yeah i want my real DOM elements yk

#

this looks pretty sweet though actually

#

although i worry if it needs Node to SSR?

#

surely I could just Kotlin SSR that bitch or something

ocean quartz
#

You can do Kotlin SSR already with htmx and ktor :)

cinder flare
#

well yeah but HTMX ain't Kotlin yk

ocean quartz
#

Well not htmx directly but the way you use it is

cinder flare
#

well yeah but i want like JS state and shit yk

#

idk I just really like Vue guys lol

cerulean ibex
pastel imp
#

I'll personally donate 2k to whoever does a svelte like framework but for kotlin

ocean quartz
#

2k :')))

cinder flare
#

yeah wow lol

#

that's like 1 week of work for an average salary dev

pastel imp
#

I said donation

#

Xd

cinder flare
#

ah, so not even guaranteed payment lmao

pastel imp
#

Lmao

#

Fair point

#

Sorry if I am broke

cerulean ibex
pastel imp
#

Although 2k donation is more than most OS projects get in a single donation

pastel imp
#

But jokes aside, nowadays with runes, it is seen as a "React but better"

#

(Like better by far imo)

#

Svelte's ecosystem is also growing quite fast honestly

#

And you have alternatives to most big libs

#

Shadcn for ex. Has a community led port to svelte

#

There is a reason it is being adopted by several big companies including even apple

#

The whole apple music and podcasts (and a few other things) are all using svelte

cerulean ibex
#

that didnt rly answer what ppl like abt it 😭

wind patio
#

using kotlin for web dev is like using a fork while eating soup

wind patio
#

personal opinion

#

but to name a couple reasons (also subjective):

  • probably a very small community/eco-system (not industry standard)
  • there are way better options that are intended/made for web dev (ex. nodejs, django/flask, ruby on rails, laravel, etc.)
  • much less libraries and what not
  • harder for beginners
  • jvm overhead

if you need a hello world app - sure, use kotlin, but there are a lot more mature alternatives, JS/TS is still probably the best
I'd also assume it would be pretty hard to find a team of people that would use kotlin for web-dev, unless you're working alone

potent nest
#

You won’t have JVM overhead when it‘s transpiled to js

#

(but you‘ll have js vm overhead, lol)

ocean quartz
#

probably a very small community/eco-system (not industry standard)
True, doesn't mean it makes it like a fork for eating soup, more like a very specific spoon that hadly anyone uses
there are way better options that are intended/made for web dev (ex. nodejs, django/flask, ruby on rails, laravel, etc.)
What makes them better if you haven't used the one you're talking about?
much less libraries and what not
Any JS library works
harder for beginners
Sure?
jvm overhead
It's not JVM

#

As for your last points, no one is arguing that JS/TS isn't better for this, it's an alternative just like Scala JS would be
And ofc you won't find a team, but hey do you think people would find a team for a react project when it first started? Things have to start somewhere

wind patio
#

What makes them better if you haven't used the one you're talking about?
Better in terms of more industry adoption,
stronger ecosystems: more libraries, tools, and frameworks built specifically for web dev and most likely better development experience such as easier debugging, faster iterations, and better tooling.
If it's for a personal project, sure, but I don't see where I am going to use it in real world.

ocean quartz
#

Even agreeing with all that you said your comparison is still dumb

wind patio
#

The way I see it is - if you're going to run into a problem - good luck finding a solution.

ocean quartz
#

Because it's perfectly functional as any js application would be?

wind patio
#

maybe

ocean quartz
#

How is it a maybe? It literally outputs a js file for you to use lol

cinder flare
#

but yeah Kotlin templating isn't the best lol, though the compilation to JS stuff can actually be quite all right

#

and besides you can use like a million templating languages for the true Django/RoR/Laravel experience

ocean quartz
#

Yeah the templating is kinda ass, same with Java using stuff like Thymeleaf or FreeMarker

#

Though Ktor does have a quite nice HTML DSL

cinder flare
#

and it works with Kotlin too, though not with K2 or 2.0+ yet which caused me some troubles lol

ocean quartz
#

Classic K2, works great when it does, causes all sorts of weird problems otherwise omega_lul

#

jte looks pretty nice yeah

cinder flare
#

typed, feels a lot like Laravel Blade templates

#

my only sadness is that they don't support custom xml components, that's like my favorite part of Blade

#

you can just do like <x-button>Click Here</x-button> and it all works really nicely

#

you have to do templates like @template.layout(content = ) and a bunch of shit

pastel imp
# cerulean ibex that didnt rly answer what ppl like abt it 😭
  • Reactive and state management is easy af
  • Compiled aka no virtual dom
  • lightweight and ultra fast
  • SvelteKit straight integration that provides ssr, file based routes and a bunch of other things
  • Builtin animations and transitions
  • Easy typescript support
  • works really well with vite, tailwind, supabase and alike
  • Easy to learn
  • Has one of the best Dev Experiences out there
#

That's just naming the obvious reasons

cerulean ibex
#

isnt that like most modern frameworks

pastel imp
#

There are several other reasons that are more niche and depend on your sue case

pastel imp
#

Dev experience in some frameworks that I wont name suck

#

And while some of those points maybe apply to other frameworks, svelte does it better than most of those

cerulean ibex
#

i mean the only real reference i have for "modern" frameworks are solid js and some rust ones

prisma wave
#

Elm is the best frontend framework

#

All the others are cringe

cerulean ibex
#

🙄

prisma wave
#

Yeah this guy gets it

cerulean ibex
#

im not convinced anyone actually uses elm

#

there just exists a bunch of fpers praising its design

prisma wave
#

doesn’t matter who uses it

#

As long as you use it

#

stop caring about what other people think

cinder flare
cerulean ibex
#

doesnt elm by design pretty much require large diffing of the entire virtual dom?

cinder flare
#

Vue has basically all of those things, plus a much larger userbase and history and libraries and shit, they just need to work on the compiler 😭

cerulean ibex
#

cuz my understanding is that elm (well not specifically elm, i think also some other functional ui libraries) are just a single pure function that turns ur data into a view

cinder flare
#

yeah maybe it's like one step higher though and can diff the function/memoize stuff before it actually has to construct a DOM or anything

prisma wave
cerulean ibex
#

prefired

prisma wave
#

I have used it but I don’t know the implementation detail

cinder flare
#

has elm been like revived lol

#

last i checked it hadn't been updated in like 2 years and that was in like 2023 or smoething

#

yeah phew, core was last committed to 4 years ago

ocean quartz
ocean quartz
pastel imp
pastel imp
ocean quartz
#

The new compiler does

pastel imp
#

Among other smaller things I think

cinder flare
cinder flare
ocean quartz
#

I am not too versed on either but iirc the new compiler does optimize a lot of stuff, like auto memoizing things
Not sure about the vdom though
But cool to see that svelte does that

cinder flare
#

yeah it does auto memoizing which is really cool, the vdom and just lifecycle of React in general are hard to get rid of

pastel imp
#

Thought the new compiler still relied on virtual dom

cinder flare
#

yeah it does

pastel imp
#

Well that alone already is the difference

cinder flare
#

i mean it's pretty much just that, if you look at the script stuff for vue and svelte nowadays it's basically identical

#

React still has all their weird idiosynchranocies with state and shit

pastel imp
#

Yeah, tbf just like react, they copied some stuff from svelte

#

Which is nice to see

cinder flare
#

you mean Svelte copied Vue?

#

cause yeah lol

#

that's why it's so nice

pastel imp
#

Svelte initially copied some things from vue

#

Then the table turned around

#

Nowadays all big frameworks are copying svelte4 stuff

#

Not saying sv5 since that has runes which kinda is how react does it and alike

#

Just better

#

Ofc

cinder flare
#

what exactly are they copying from svelte 4? lol

prisma wave
ocean quartz
#

Honestly a lot of people can't, I get comments all the time "is this lib still active? last commit was 3 months ago" like dude ..

prisma wave
#

Many such cases

cinder flare
#

i feel like they could do so much

#

and it's nice to know there's just someone there working on it yk, even if they're not like doing huge updates and stuff

prisma wave
#

the ecosystem of libraries is still being updated

#

idk you're not entirely wrong because there are still some open compiler bugs and stuff

#

but i also dont think it's a huge deal

wintry plinth
#

i tried the new react compiler, so good

pastel imp
#

And other niches

#

Svelte in general did set a new standard in terms of DX for the market

#

Which influenced other frameworks

desert horizon
#

Do you guys have any idea why IJ (or maybe gradle or maven) at times cannot resolve dependencies and imports?
To this day do I not get why this happens at times and why it requires a Cache invalidation.....

potent nest
#

Because caching is hard

desert horizon
#

Yeah, but I feel like there should be an easier way than having to invalidate all caches + IDE restart at times

#

Because it eats RAM like nothing and takes forever...

potent nest
#

I mean I don’t have such problems typically, likely probably twice a year or something like that

#

The only project that is always scuffed is intellij-community, that just completely breaks every now and then

crude cloud
#

i can't remember when i last had to do a full cache invalidation

#

the repair ide feature kinda just works in the first three or four steps

ocean quartz
#

I had to do it today, but it was the first time in a few months

desert horizon
#

I had to do it after opening a Gradle project after like 2 months or so....
Invalidation worked until I wanted to build, where it failed because repo URL was outdated... Changed it, refreshed and build.... and now the issue is back...

abstract osprey
crude cloud
#

i'm just that good

cinder flare
#

Vue had “simple reactive declarations” before Svelte and had component scoped styles too

cinder flare
pastel imp
#

Which in svelte it is regarded as simply better implemented

pastel imp
#

DX did

remote goblet
#

one day

#

im gonna jump DocFlavor.String

#

omg

#

anyway

#

i hate intellijs new copilot shit i want to write just private not PrivateKey WAH WAH WAH

old wyvern
#

The tradition is to start 50 projects and leave them all incomplete 🔪

prisma wave
#

yeah that’s why it’s so unbelievable that elm did it

desert horizon
#

IntelliJ is imploding on me ._.

#

(Well, it looked worse before I took the screenshot)

#

I'm just really confused why this started to happen now...

#

Maybe I should switch back to the 2023 version....

potent nest
#

what's the problem

desert horizon
#

Right now is it not resolving/recognizing the Dependency from the core module for some reason

#

invalidating caches doesn't help it

potent nest
#

did you try clicking on the reload maven thing

desert horizon
#

Multiple times

#

Funny enough they made a patch to fix "Sync all Maven projects..." not working

#

And now it got even worse....

potent nest
#

sounds like a you problem

desert horizon
#

Started a maven project reload... Hopefully this helps

#

Nope.... nothing changed

#

Opening it on IJ 2023 is perfectly fine.... So this must be yet again a case of the stupids for 2024 version.

potent nest
#

yes totally that version is known for the introduction of the "hardcore mode" so devs don't get bored

desert horizon
#

I mean, what else could be the reason if 2023 works fine, but 2024 is causing so many issues. No other IJ version had so many issues for me like 2024:

  • first versions where performance eating hogs, causing hugs delays, slowdowns and lag, freezing at times even.
  • I encountered more dependency issues with 2024 versions in the past month than I had with the 2023 version during my entire use of it.

Like there must be something fundamentally broken in the IDE to break down like that, which can't just be how my project is structured or how I use it... Maybe it's just not compatible with my PC specs or smth or just hates me...

abstract osprey
#

It was awful

#

sourceSets {
main {
java {
srcDirs 'src/main'
}
}
}

#

ended up doing that

desert horizon
#

I use maven tho

abstract osprey
#

try

#

<project>
    <build>
        <sourceDirectory>src/main</sourceDirectory>
    </build>
</project>
#

in your core module pom

#

I’m on mobile atm so could be completely wrong

desert horizon
#

I'm wondering, why the core module?

#

Is that to tell the IDE "hey my sources are here"?

abstract osprey
#

in a nutshell yeah

desert horizon
#

According to the docs of maven and this option is the default already src/main/java

#

So not sure if this actually would change much

abstract osprey
#

yep. Same for gradle.
And look what IntelliJ does

#

doesn’t resolve the bloody classes

#

the issue you’re experiencing happened to me randomly

#

out of the blue

desert horizon
#

Does it have to be src/main and not src/main/java?

abstract osprey
#

try both

#

for gradle it was src/main that did the trick

#

could be src/main/java for maven

desert horizon
#

Has to be src/main/java for me or IJ displays the folders weirdly

#

Also, doesn't help

#

I'll just stick with IJ 2023 for as long as I can...

#

Runs faster anyway

abstract osprey
#

should just switch to gradle KEKW

ocean quartz
#

Still having the issue? Try running mvn clean install -U I saw someone with a similar issue and that fixed it, no idea if it'll work for you but hey worth a try

frigid badge
#

oops accidentally tagged u

wind patio
#

wasnt saying vscode is good

frigid badge
#

good

lavish notch
#

Does anyone know Mojang's thought process behind the Ominus Potion not being like every other potion?

#

Can't decide if I should implement a YAML property to easily configure the strength or tell the customer to use the NBT tags property which already exists.

For context, this is for ShopGUIPlus (a shop plugin) and a user was asking about adding ominous potions of all 1 to 5 levels

prisma wave
#

What’s the downside to adding the yaml property?

oblique heath
#

yaml

quiet sierra
#

odd reason for picking a custom data component over just potion effects

#

might be because you can't mix and match?

#

I'd prioritize the end-user experience over "nbt because it's easy"

lavish notch
prisma wave
#

what about

oblique heath
#

i would make pretend that the ominous potion is a normal potion

lavish notch
prisma wave
#

ominous_bottle_strength

oblique heath
#

have the syntax to set the ominous potion strength be the same as other potions

prisma wave
#

yeah i would also do that

lavish notch
#

I did consider that but it would then be technically not to Mojang structure/spec. SCGpain

prisma wave
#

thats an unhelpful target to aspire to imo

lavish notch
#

ik ik why

wind patio
#

wouldn't be an edge case if it wasn't an edge case

#

don't stop edging

#

or whatever

prisma wave
#

so true

#

Wise words

oblique heath
#

average chrome case (i use google apps for everything)

lavish notch
# lavish notch Does anyone know Mojang's thought process behind the ``Ominus Potion`` not being...

Oh the pain... got it working but stuck on spigot-api 1.20.4 and can't update due to a BannerMeta#setBaseColor usage which was removed in spigot-api 1.20.5. why (this exists to support banners on 1.12 and below)

...and doing backwards reflection on BannerMeta#setBaseColor to use spigot-api 1.21.4 produces this error:
java.lang.IncompatibleClassChangeError: Found class org.bukkit.inventory.InventoryView, but interface was expected

desert horizon
#

I think those icons look nice.
Tho, also a little inconsistent because the paper plane is from fontawesome while the other ones are from Simple Icons, which has a consistent 24x24 pixel size for their SVG icons...

#

Also, the spigot icon is for BungeeCord... Can't find or think of one that I could use that fits better :/

abstract osprey
#

you could just squish the bungeecord logo into a 24x24 pixel svg 😭

cerulean ibex
cinder flare
desert horizon
#

It's python right?
*leaves the room before the rage*

crude cloud
#

Rich Hickey mentioned!

pastel imp
brazen ether
brittle leaf
#

how do i stop procrastinating

crude cloud
#

tomorrow

brittle leaf
#

yes

brazen ether
#

there is always more to learn and so if you find something interesting, just do that

brittle leaf
#

im sat there looking at my ide, wanting to write out a better more dynamic way for my code to run compared to the many times ive tried to implement the same idea and im just like ughh i dont want to then close the ide and go back to watching youtube

#

and this'll repeat multiple times till i eventually actually do implement it

cinder flare
#

the hardest part is getting started

#

at least for me, i think about doing something and don't want to do it so i put it off

#

but if i can get my foot in the door and like actually open up stuff and start going, i just get really into it and work

#

for instance, just spent like 6 hours trying to get a Minecraft map imported into Maya and shaded correctly (still can't get Arnold to render transparency correctly lol)

#

but hey, it was a good experience! and now i "left a brick in the door" for future times i want to do 3d modeling/animation stuff

#

idk i always think time spent learning and trying stuff is time well spent, even if you don't really have much to show for it at the end

brittle leaf
#

like yesterday i actually figured out how to do json stuff, sure half of it was copy pasted but i kinda understood how to use gson so i can do json stuff in the future in java

cinder flare
#

hell yeah dude!

#

now you gotta take the next step and migrate to Kotlin so you can use kotlinx.serialization 🙂

desert horizon
brittle leaf
#

now to just reimplement custom items with some more dynamic added properties rather then making a field for each

#

also think imma represent the item as a json or yml file included in the jar, read and generate objects from that rather then hardcode the objects

#

tho thinking about it im not sure how id represent what to do on right click, left click, etc

#

might be overcomplicating it for something thatll never see public usw

#

use

brazen ether
half harness
#

does anyone use checker framework
I remember hearing about it somewhere so I tried implementing it in an already-existing project and got a whole bunch of errors 🥲 (with null checker and some initialization checker thingy that wouldn't disable)
spent a while trying to fix them but then eventually resorted to jetbrains annotations lol

#

but I didn't know checker framework can do all of what it does... seems pretty cool, but trying to adapt an existing project isn't worth it for me

cerulean ibex
#

works fine for me

#

it doesnt always work properly for libraries using jetbrains annotations tho

wind patio
static zealot
#

I'll look at it tomorrow

wind patio
#

lol

#

I was updating it for personal use to 1.21.3, thought might aswell push an update for 1.21.4 to original

#

anyone knows how to correctly set-up a multi-module project? I had it working a while back now it's all messed up again

abstract osprey
#

Or do you already have that and I’m just not seeing it

ocean quartz
#

Also not using kts gradle cringe

desert horizon
#

*laughs in maven*

static zealot
#

bstats is down so I have no clue how many people are on those versions

desert horizon
#

Speaking of multi module stuff.... Someone actually made a PR for a velocity version of BungeeTabListPlus.

#

So people can finally use it on Velocity (Once it gets merged obviously)

steel heart
crude cloud
#

doesn't it have like MonotonicNonNull or something?

#

i just don't like cq because it litters my autocompletion pepelaugh

steel heart
#

ofc if u have free hands you could always try to redesign entire areas where checker makes it awkward

wind patio
crude cloud
#

never used cq, idk it's just, too much

steel heart
# crude cloud never used cq, idk it's just, too much

ye fairs, RNN works fine at times, but again that requires knowledge about the field, if u have an interface that specifies itself to require a certain initialization method to be invoked in order for any data accessors guarantee non nullness, then it can become tricky iirc, if ur lucky and working w pure stuff u can maybe use the purity annot, but yea

abstract osprey
static zealot
static zealot
static zealot
#

Alright. Merging it. Can you solve the conflicts for your other PR btw?

#

want to get that one merged as well

wind patio
#

ah well build failed, I'll check it out tomorrow if I cant today

static zealot
wind patio
#

yeah just pushed a fix lol

#

unable to code without IDE screaming at me 😔 🫰

static zealot
#

was about to do it myself lol

wind patio
#

ok I'm not resolving conflicts in the online editor again

static zealot
#

(:

wind patio
#

@forest pecan where is the PR

crude cloud
#

it wasn't positively received 😔

wind patio
#

too many dislikes

remote goblet
#

should i be shot for writing this, yes/no?

#

why did i do Y

#

whatever

prisma wave
#

Object instance

#

anyway yes

#

just make a common super interface

#

and accept a value of that type

#

at the very least

#

the logic can stay the same even if it's a bit gross

crude cloud
#

<T extends Object | MatchListener | SpawnLogic | Mechanic> when

cinder flare
#

i mean a switch could also be nice

brazen ether
prisma wave
#

that relies on you knowing the type at compile time

brazen ether
#

ah I see

crude cloud
#

i don't think a switch would work here

cinder flare
#

wouldn't it with the pattern matching thing?

#

like you could do java switch (instance) { case MatchListener listen -> this.listener = listen; case SpawnLogic logic -> this.spawnLogic = logic; case Mechanic mechanic -> this.mechanics.add(mechanic); }

prisma wave
#

technically has different semantics

#

if the class implemented 2 interfaces, for example

cinder flare
#

oh yeah i just figured they were mutually exclusive and you would only want one branch

#

and they just didn't write all the else's cause they were lazy lol

prisma wave
#

yeah i assumed so too but you never know

brazen ether
#

very simple path simplification with radial distance + dougles-peucker, recursive implementation though and gonna have to tune the tolerance but it's quite nice since it preserves sharp edges, which is exactly what i want

#

going to use this to automatically optimize Comet effects

#

(yellow = simplified, purple = original)

brazen ether
#

mmm going to need to make it so it tries to put lengths in multiples of some speed so that speed stays constant with varying interpolation duration

#
  • also take timestamps for points into account...
brazen ether
#

or actually just pretending timestamp is 4th dimension probably works

prisma wave
#

Very cool

remote goblet
#

i will jump so many hoops to avoid doing elseif, its a sick behaviour of mine

remote goblet
brazen ether
#

original path not shown during traversal since it blocks seeing the actual movement, this is with teleportationDuration = timeDelta + 1

#

pretty happy with it though, ofc very curvy shapes it will not look as good but that's just the way it is

#

most movement i'm using this for is parabolic or sharp so it's good for that

#

though probably still need some tweaks, it also includes time in its calculation for which points to keep (so that movement at different speeds is preserved) but currently just uses it in seconds, which might not be the optimal way

brazen ether
#

important for Comet

brazen ether
#

there's one system that optimizes position and one system that optimizes display entity stuff since those can have separate interpolation

pastel imp
#

uhm my brain is not working decently rn (hella late) but anyone knows how I'd add the ssh key of github to Webstorm (IJ)? bit confused

#

I am trying to clone a repo that has strict access in an org

prisma wave
#

you shouldnt need to edit webstorm at all

#

just use the ssh uri for the git repo when you clone / edit the origin url

#

and make sure the key is on ur account obviously

pastel imp
prisma wave
#

what

#

what exactly is going on here

#

what command are you running

pastel imp
# prisma wave what command are you running

npx sveltelaunch create, custom thing, but internally it clones the git, but getting this:

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Which I assume is because it lacks an ssh key

prisma wave
#

that would only make sense if it was a private repo

#

this is a huge XY problem

pastel imp
#

well, IT IS

prisma wave
#

what?

pastel imp
#

it is private

prisma wave
#

ah

#

well

prisma wave
#

if you run ssh <username>@github.com you'll see the same thing i imagine

#

delete your known_hosts file and then try it again

pastel imp
prisma wave
#

type yes

#

and press enter

pastel imp
# prisma wave and press enter
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
xmrafonso@github.com: Permission denied (publickey).
prisma wave
#

ok i guess you just dont have the key on github then lol

#

have you added the public key to your github account

pastel imp
#

I had, but I just remembered the one on github is not the right one anymore

#

how'd I get access to the publickey I currently have?

prisma wave
#

thatll do it lol

#

cat ~/.ssh/id_ed25519.pub

pastel imp
#

isn't it in a path

#

ah

#

that

#

thanks

prisma wave
#

assuing ur on linux

#

it'll be with \ on windows

pastel imp
#

uh

#

ok

prisma wave
#

should still work in git bash / wsl actually idk

pastel imp
#

interesting, ssh-add -l shows I have no file

prisma wave
#

i have no idea what that command does but im not sure you need it

pastel imp
#

I don't seem to be able to find the public key

prisma wave
#

what does ls ~/.ssh print

pastel imp
#

there is only a known_hosts file

prisma wave
#

oh so i guess you dont even have a key

#

ssh-keygen time

pastel imp
#

xd

prisma wave
#

uh

#

for what?

#

you can just literally do ssh-keygen

#

and thats all u need

pastel imp
prisma wave
#

yes

pastel imp
#

I just did and still the same

prisma wave
pastel imp
prisma wave
#

okay...

#

ssh -v xmrafonso@github.com run this and show me the output

wintry plinth
#

You need to cat ~/.ssh/id_ed25519.pub and paste the result in this chat /s

prisma wave
#

it's a public key so thats fine

wintry plinth
#

Oh

#

Fail

prisma wave
#

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPNPRzSLlLpDQwA9QpurZnREyON6z9wHiNJ9tZexFmgh alex@Alexs-MacBook-Pro.local

#

heres mine

#

hack me

#

:)

wintry plinth
#

Exposed your real name

#

Now we know it’s Alex

#

So mr Brister is no more

prisma wave
#

:O

#

shock and horror

wintry plinth
#

Exposed

prisma wave
#

gosh darn it

#

you got me

prisma wave
pastel imp
prisma wave
#

sure

pastel imp
cinder flare
#

bro actually has a lot of keys lmao

pastel imp
#

I am rich

cinder flare
#

id_rsa, id_ecdsa, id_ed25519, id_xmss, id_dsa

prisma wave
#

huh

#

thats weird

pastel imp
#

funny how those never showed

cinder flare
#

i have a feeling you didn't ls your folder correctly, or the permissions are somehow messed up

prisma wave
#

WAIT

cinder flare
#

but yeah i would setup a config to force it to use the right key, then you'll know it'll be trying the right thing at least

prisma wave
#

no this is actually my bad

cinder flare
#

😮

prisma wave
#

try ssh -v git@github.com

#

forgot where the username goes

prisma wave
cinder flare
#
Host github.com
    HostName github.com
    IdentityFile ~/.ssh/github
#

that's my entry in my ~/.ssh/config for github

prisma wave
#

you have a specific key for github?

pastel imp
#

I dont even have a config

cinder flare
#

yea

prisma wave
#

yeah ignore that

prisma wave
pastel imp
cinder flare
#

cause i also have a specific key for a self-hosted gitea server, and various other hosts lol

pastel imp
#

stuck at this

prisma wave
#

why not just use 1 key for everything

cinder flare
#

why not just use 1 password for every website

#

though tbh i do actually use one key for basically everything else lol

prisma wave
#

feels like theyre different things?

#

a password can be broken, a public key gives an attacker zero information

cinder flare
#

i think i just needed to upload the key to some other servers for ci stuff so i didn't want to expose my private key yk

prisma wave
#

ah fair

cinder flare
#

omg i still have the devden dedi ssh setup 😌

prisma wave
#

wholesome

pastel imp
#

I have a solution

prisma wave
#

shame the server doesnt exist anymore

pastel imp
#

I shall delete .ssh

#

ez

prisma wave
#

wait

#

just try the original npx command now

pastel imp
#

seems like it worked?

#

well, ignoring this

'touch' is not recognized as an internal or external command,
operable program or batch file.

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'touch C:\\Central\\WebStorm\\Supabase - Learning\\SvLaunchTest\\test/.env.local',
  stdout: '',
  stderr: "'touch' is not recognized as an internal or external command,\r\n" +
    'operable program or batch file.\r\n'
}
cinder flare
#

bro's not a toucher

prisma wave
#

I don’t think this is designed to be ran on windows lmao

#

Probably time to break out the WSL

cinder flare
#

could just make the files yourself lmao

prisma wave
#

better late than never

pastel imp
#

lmao yeah

prisma wave
cinder flare
#

oh true if it just runs unconditionally

prisma wave
#

Assuming it’s part of a bigger script

#

yeah

pastel imp
#

welp time to figure out how to add WSL to webstorm

prisma wave
#

it should just be an option in the terminal

#

but also why do you need to add it

prisma wave
#

why not just run this npx command in a WSL terminal

#

no need to mess around with webstorm

pastel imp
#

well I am already using webstorm sooo

prisma wave
#

suit yourself

pastel imp
#

but I guess

#

you are right

#

it's just a one time thing

prisma wave
#

in theory

#

it's not that hard to make a wsl terminal tho it should be added automatically

#

it's possible you'll have to make a new ssh key for wsl haha so just follow the previous steps again

pastel imp
#

this works right?

prisma wave
prisma wave
pastel imp
#

wait but do I even have access to files outside the WSL env?

#

cause rn I can't cd into my home path

prisma wave
#

yes

#

but it's mounted differently

#

it's under /mnt/c or something

pastel imp
#

yeah it's similar to that

#

but why does bash and curl not work at all tf

prisma wave
#

"not work"?

pastel imp
#

not found

prisma wave
#

in WSL?

#

are you sure you're in wsl

pastel imp
#

Yes

oblique heath
#

can you run sh

#

actually run ls -alh /usr/bin/sh

pastel imp
oblique heath
#

wtf

#

my wsl has that

#

idk what your pc is cooking

pastel imp
#

dies

#

pc is cooked*

#

the irony of the name of the pc

prisma wave
#

what the hell have you done

pastel imp
#

installed WSL

#

and restarted

#

that's about it

oblique heath
#

how are you running wsl

#

for me, i just have to open cmd and run wsl

pastel imp
oblique heath
#

ah i have never used that

#

try it my way

pastel imp
#

just tried

#

same thing

oblique heath
#

wack

prisma wave
#

dont you need to install a distro too

#

i dont remember what wsl is like nowadays

pastel imp
#

installed ubuntu

prisma wave
#

🤔

#

bizarre

pastel imp
#

reinstalling it

#

honestly, will try to fix it tmr

#

its late

#

better do it tmr before I throw my pc out the window

#

🙂

pastel imp
#

okay so installed it with wsl install, and it looks good

#

seems to work

#

(ignore msg)

#

but like

#

when I open a new terminal and type wsl

#

it looks different

#

and works different

#

looks hella diff

frigid badge
#

that’s probably plain wsl and not the ubuntu one

wind patio
#

what looks hella diff? thats just a different bashrc/profile

pastel imp
#

The "plain" one can't find bash or anything else

cinder flare
#

i mean what even is a "plain wsl" lol, you need some kind of linux kernel

pastel imp
pastel imp
#

and the other doesnt

cinder flare
#

i mean did you just not have a distro installed lol

#

and that was like the default bash shim

pastel imp
#

I have no idea

#

I did wsl install in powershell, it worked (first image)

#

then when I tried to enter wsl again

#

it went into the "bad" one

brazen ether
#

$25-40 😭

oblique heath
brazen ether
oblique heath
#

fr

wind patio
#

nextjs + ts? its almost like.. nexts

ocean quartz
#

Tbh very unfortunate to have js in the name, they have moved to ts a long time ago :')

prisma wave
#

ts pmo ong 💔

#

.js

abstract osprey
eager fern
#

Welp thats old haha

pastel imp
#

back to this, any ideas? I already put the public key in github...

half harness
#

If you don't see a prompt where you can type "yes," then try to run ssh -T git@github.com and see what you get

#

or unless there's more context to this

pastel imp
#

now I am confused

pastel imp
#

already added it to github...

half harness
#

something is misconfigured somewhere

crude cloud
#

this is very commonly known in the field as a "skill issue"

pastel imp
crude cloud
#

samesies!

pastel imp
#

(forgot to answer)

#

it's hella weird

#

hmm any chances wsl isn't using the key from my .ssh?

half harness
#

try ssh -v -T git@github.com

#

the -v flag enables verbosity

half harness
pastel imp
#

it was not using the ssh keys from the "mounted"

half harness
#

tbh I'd just copy over the keys

pastel imp
#

I had to access the linux files which had diff. ssh keys

#

eh

#

whatever

half harness
#

but your ssh key was in the "normal" drive

#

🥴

pastel imp
#

and I was in the "normal" drive

#

(aka mounted)

#

and thought it was using that one

#

but it wasnt

wind patio
#

well the WSL is kind of "its own OS", so it makes sense that ssh is not using the key from Windows

#

same idea if you would ssh into X from Y and try to ssh from X into Z using key from Y

prisma wave
half harness
#

🥲

pastel imp
#

cries

desert horizon
#

I was just looking at the DeluxeMenus source to figure out how it registers/handles commands... and this gives me a migraine

#

Why the toLowerCase and trim on a string you could already have lowercase?

agile galleon
#

dafaq

desert horizon
#

Anyways, was looking for how it registers menu commands, because I believe I found a spigot bug/limitation?

#

Like, I've set an item in ItemsAdder to execute a command and according to LoneDev is IA simply performing Player#performCommand() in such a situation.
However, Commands registered by DeluxeMenus return a command syntax error (The one you get for incomplete commands)... So maybe it's actually more a Paper/Brigadier issue?

agile galleon
#

Yeah no I remember that issue a while back

desert horizon
#

Maybe it's due to DM doing reflection to access the CommandMap?

#

Paper exposes it for use, so maybe this messes with things (i.e. doesn't register it in the actual map but a copy?)

#

No expert on this obviously

agile galleon
#

I fixed it by essentially "chatting" the command for the player

#

With Player#chat and then prefixing the command with a /

#

Which pretty much does the same but somewhy works with DM

desert horizon
#

Probs because it goes through a whole different thing

#

Like the entire chat/message processing

agile galleon
#

probably ya

desert horizon
#

Where performCommand skips some necessary steps

#

I now wonder if that also happens on Spigot or only on paper

pastel imp
prisma wave
#

it's slightly hilarious that microsoft refuses to use C# for anything

pastel imp
#

yeah xD

#

Go being made by google is also funny

solar cradle
#

Dang there’s barely any people in here

lavish notch
#

Elitist ofc

lavish notch
#

Anyone here able to explain to me what an Invariant is in the context if a graph / data structures and algorithms Uni course?

For the life me, I cannot work out why my lecturer spent 40 mins speaking pure academic non-sense about it as all I can understand from Google is it's a variable with a constraint.

potent nest
#

it can be easier to explain for a specific case than just super generally, e.g. a loop invariant is a property that is true before and after every iteration of the loop, for objects an invariant basically describes what a valid state of the object is, ...

lavish notch
#

Is my understanding correct there?

potent nest
#

yeah kind of

lavish notch
#

Now to work out why the hell my lecturer spent 40 mins explaining this... as it's just pure academic speak he did.

wind patio
#

well, probably gonna repeat what @ SirYwell said, but iirc "invariant" is just a rule or a property that always stays true during an algorithm.

for ex. with a selection sort:

    public static void selectionSort(int[] arr) {
        int n = arr.length;
        for (int i = 0; i < n - 1; i++) {
            int minIndex = i;
            for (int j = i + 1; j < n; j++) {
                if (arr[j] < arr[minIndex]) {
                    minIndex = j;
                }
            }

            int temp = arr[minIndex];
            arr[minIndex] = arr[i];
            arr[i] = temp;

            System.out.println("After iteration " + (i + 1) + ": " + Arrays.toString(arr));
        }
    }

    public static void main(String[] args) {
        int[] numbers = {64, 25, 12, 22, 11};
        System.out.println("Original: " + Arrays.toString(numbers));
        selectionSort(numbers);
        System.out.println("Sorted: " + Arrays.toString(numbers));
    }
Original: [64, 25, 12, 22, 11]
After iteration 1: [11, 25, 12, 22, 64]
After iteration 2: [11, 12, 25, 22, 64]
After iteration 3: [11, 12, 22, 25, 64]
After iteration 4: [11, 12, 22, 25, 64]
Sorted: [11, 12, 22, 25, 64]

The invariant here is that the first i + 1 elements are always sorted at every step.

#

or a different example:

        int n = 5;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += i;
            System.out.println("After adding " + i + ", sum = " + sum);
        }
        System.out.println("Final sum: " + sum);

The invariant here is: sum always contains the sum of numbers from 1 to i.

lavish notch
#

Cheers.

steel heart
# lavish notch To me, it just seems Invariant is a fancy linguistical term for 'x should always...

Usually conditions come in the form of pre and post conditions that hold true or false, that is some property holds either before program P or after program P. Invariants as ywell said are properties that are always true basically, but its a bit abstract since there are different kinds of invariants, like loop invariants, type invariants or in terms of concurrent execution we talk about invariants as being always true until we acquire some lock and during acquisition time that invariant can be false, though more generally we don't have to involve conditions, but instead for example certain relations that are guaranteed to hold.

prisma wave
#

I love hoare logic

steel heart
#

oh my god

#

amount of pain figuring out loop invariants is just insanity though

prisma wave
#

it’s fun I think

#

Difficult but fun

steel heart
#

😭

#

ye fairs

prisma wave
#

We used dafny in a class last semester and that was really cool

#

Very satisfying

steel heart
#

damn that looks so interesting

prisma wave
#

It’s pretty fun to tinker with

pastel imp
#

@desert horizon that a plugin?