#dev-general
1 messages Β· Page 58 of 1
yeah I gave up tryna have neovim match it, making intellij into a nvim like experience is way more realistic for me than vice versa
figured i'd just suffer with Jira like everyone else, but no we use YouTrack and it's a super nice UI and experience
yea basically same, I just use LazyVim for NeoVim stuff, but I 99.9% of the time just use IJ and IdeaVim
yeah I have all the config and file stuff done via nvim/yazi, which is a surprising amount
god bless Russian wifi
5 hours left π
oh mah gawd lol
I think I fixed it, tho the solution wasn't nice.
Basically, I nuked the project from my Desktop and cloned it from my repository... Good thing I didn't had any major changes.
Tho, only time can tell, if that actually fixed things...
hell yeahhhh
that font is weirdly smooth but i love it
fantasque sans mono!
top ten moments developers didn't know how to read flame graphs
I am reading it correctly arenβt I?
or was that a joke π
It was a joke haha
Brister Mitten joking??
i dunno bro... java.lang.Thread.run seeming pretty chunky right about now
might need to cut it out of our program
like, it's literally Kotlin, I don't need no java.lang in there yk
So much bloated code
For the first time ever
In history
On a more serious note it is kinda funny how thereβs almost zero useful information in the graph when itβs this zoomed out
Wait tf is that?
flame graph
Oh interesting
hooked up intellij profiler to Minecraft plugin
Interesting lol
better than spark reports :>
Mainly to test performance I assume?
yeah, working on physics engine
Nice nice
with intellij ultimate you just add a run configuration via jar application and set path to server jar and working sir to server dir
afaik doesn't support remote profiling tho ):
Oh interesting
That sucks tho
Would be interesting if it does
I think itβd be funny to watch the server that eats our mem, just watching the stats on it
π
you do know spark can do flame graphs, yes?
I didn't know LMFAO π
guess I js never clicked that
unless you mean just producing snapshots and viewing them via smth else
i mean i literally just did all the required homework in my classes and that instilled it pretty well iirc
most of my profs also had like extra exam prep worksheets that were mockups of what the exam was, just with slightly different questions, and that really helped cause you could get comfortable with the format and problem process
If you're given example problems do them, do all the homework, look at past exams if you have access, make sure to read and understand all the relevant topics
if they're struggling with intuition, go over the proofs
my linear algebra book has proof exercises for every topic and that's way more helpful than anything else
Well, practice makes perfect, as usual.
"ChatGPT?"?
Well we used Google back in the day π§ Obviously if you are stuck on something it will help, one way or another.
I didn't really like maths myself but yeah, doing the homework and a little bit extra is all it took to pass the classes. What also helped was looking for real world applications (if applicable) for different topics.
ChatGPT wasn't around when I had to learn that stuff π
I wish more devs would spend 1 week on the geometrically-intuitive side of linear algebra
the amount of times people end up struggling their way through trigonometry when their task is EASILY accomplished by vectors is baffling
I still don't understand why "devs" would study CS
at least here it's far too theoretical
the theoretical part itself is the draw for me
Software engineering is uncommon in europe, and here, CS is valued way more when seeking a job. Specially in luxembourg.
Tbf I don't even know how to properly use it for studying
What people are you referring to rn? Just devs in general or who exactly are we talking about
devs I've seen ask on spigot or in here
someone was using trigonometry to get a point some distance in the direction of a player's view direction π
and countless questions online about how to rotate points
CS as in C Sharp?
Computer Science
for the better
god I really should go back and try to relearn linear algebra. the one college class i had did not instill it onto me very well, i'm still scared of matrices and dot products lmao
i do understand vectors, at least in the context of games π
they're very simple once you do enough with them :D
yeah, my eyes just kind of glazed over for the pure theoretical stuff we were doing in that class, it was all just pure mathematics, no application
need me some practical exercises to truly understand yk
Matrices are pretty chill
yeah but like actual practical applications of them and stuff i don't have much experience with
i know just enough about like vectors to be dangerous lol, but not much more
gotta find some cool blogpost someone made or something that will teach it in a revolutionary new way
the geometric intuition is pretty simple
neutral networks as well ofc
I liked this video https://youtu.be/Ixl3nykKG9M?si=QEdSgmsSAeeMejUI
A complete guide to the mathematics behind neural networks and backpropagation.
In this lecture, I aim to explain the mathematical phenomena, a combination of linear algebra and optimization, that underlie the most important algorithm in data science today: the feed forward neural network.
Through a plethora of examples, geometrical intuitio...
guy does a great job except for where he doesn't explain why derivative of a matrix vector operation is A^T with respect to the vector, which is js a property of how Jacobians are laid out. but that's a very minor thing
if you did highschool calculus you can understand this
he basically reteaches everything you need to know
i love making little hacky things like this just so i dont have to do return true everytime in my command classes
[]args just looks odd
so does no spaces in (sender,command,label,args)
and no empty line after CommandExecutor {
and two empty lines after
}
}
you should probably make it abstract though
and you most likely don't even need Command command and String label params
at least I never really used them
IJ would in my case report this as C-style arrays iirc.
it autogenerated as that
ive never used them either tbh
It's actually correct (with the exception of needing a space before args), it should be @NotNull String @NotNull [] args
You're declaring that the string array is not null @NotNull [] and that each element of the array is also not null @NotNull String
Similar to @NotNull List<@NotNull String>
ive not styled my code to have spaces inbetween each parameter, should i do that?
aswell its not my code that the nonnull annotation came from, its the 1.21.5 version of CommandExecutor thats doing that
nah, that'd be String args[], String []args is the normal kind of declaration but it's still really fugly lol
like im not 100% that ive learnt all the best ways to actually present my code yet and its been awhile since ive actually coded something
also something i keep doing is remaking certain bits of code to how i wouldve done it before, feels like im making some sort of progress in how i actually make my code
There are multiple styles you can choose from, you could follow google's guideline, I personally dislike a few things about it though so I mostly mix things up
nullability annotations were a mistake
So true
something im thinking about rn is for custom items to have an mutable creator class for said custom items, then for the base version with nothing that will change have an immutable version that i can retrieve if i need to reference anything from that item type
since currently i just have 1 class which means that in theory they could be changed afterwards which i dont really want
immutable item class for representing its attributes thatll always be unique for that item.
mutable item class for defining the immutable attributes before its thrown into a hashmap for referencing later.
another mutable item class that uses the immutable version of the item and allowing for defining stuff on an individual item basis such as custom enchants, leather armor colors, etc
basically very similar to how itemmeta works
tf first time seeing this
good to know
Wait till you find out about @NotNull String @NotNull ... args
Lol
First annotation is for the first parameter and the second for the rest or smth like this?
no, that's the same as @NotNull String @NotNull [] args
a better example to explain is @Nullable String @NotNull [] args, a non-null array of nullable (String) elements, so something like @Nullable String @NotNull ... args is just that
my biggest gripe with intellij's static analysis is when I have a @NullMarked class/package/module, and inside that class I have a Map<K, V>, whenever I do Map#get, because the return type is V, it (rightfully) infers it's a @NonNull V when it might not be >:(
I know intellij has some "external annotations" setting or something where you can tell the static analyser to treat certain classes or methods with annotations you can configure, like Contract and such, I need to look into that
java -> kotlin
@NotNull String @NotNull [] args -> val args: Array<String>
@Nullable String @NotNull [] args -> val args: Array<String?>
@NotNull String @Nullable [] args -> val args: Array<String>?
@Nullable String @Nullable [] args -> val args: Array<String?>?
god i love kotlin
someday i'll gain power at my job and force us to write new stuff in kotlin
and life will be good
grok convert this project to kotlin
I wish to never see what that grok-created abomination can end up as
I'm hella curious but also terrified 
just how many racist comments will it contain
Can you annotate it as Map<K, @Nullable V> or is that not what you mean?
well, yeah you can, but that is not technically right
i am not storing nullable Vs
but Map.get returns null if there is no mapping
is the point
Oh I see
That's where this would be nice
get -> @NotNull V | Exception
getOrNull -> @Nullable V
Though what would count as nullable var arg but not null values? method(<no argument = null>), method("Hi", "There")?
or simply Optional<V>
Cool stuff @prisma wave
ty!!
the union one is cooler i think but it was probably a bit too complicated to showcase hehe
no that'd be an empty array, you need to explicitly pass a null array like method((String[]) null)
that simply means "the array itself can be null, but if it isn't the elements mustn't be"
I think the List equivalent would be like @NonNull List<@Nullable String> or something?
Also, since we speak of nullable and nonnull annotations, anyone else has used jspecify for their project?
I've been using them here and there in personal projects, it's nothing revolutionary or mind-blowing, we've had nullability annotations before, DefaultQualifier and such
they are overhyped lol
it's just an annotation
the one thing I appreciate is nullability annotations that are only TYPE_USE and not TYPE_USE | METHOD | FIELD | PARAMETER | ..., so they do not duplicate in javadocs like jetbrains annotations
I mean. I do like the @NullMarked annotation, allowing me to have everything automatically marked as @NonNull unless explicitly marked as nullable
yeah but that's not new
checkerqual has DefaultQualifier
and other annotations also have NonNullByDefault
Question here is, if those annotations are supported by IDEs like IJ and recognized properly
And one thing I wonder about NullMarked (Can't recall if I actually send such a question to the people behind it) is, if I mark a class as NullMarked and then f.e. have public @Nullable String method(String value), would this automatically make it have value be considered nonnull, or would it inherit from the Nullable annotation applied to the return type? 
the value is still non null, Nullable is applying to the return type, not the method
I believe you can @NullUnmarked the method, but that means "no explicit nullability" (like without any nullability annotations at all), not "all nullable"
One annotation I would like to have (not sure if CheckerFramework has it) is one that makes IJ shut up avout a "return value of method is unused" for methods of a Builder class
Also, wasn't there one annotation lib that had stuff like @PossiblyNullValue or smth to mark entries of lists, arrays, etc as possibly-null?
thats just @Nullable isnt it
@ThereIsAChanceThatThisValueMayOrNotBeNull
but yeah, exactly my thought lol
I mean it would only make sense to me that you would use @PossiblyNullValue to indicate that this should not be null, but in some sort edge-case it may, but personally I would just use @Nullable, either way you would need to handle it
you would hate Zig π
Perhaps a @ChanceOfNull(0.25) to indicate a 25% chance of it being null? and then the IDE warns you 25% of the time
wasn't really talking about IDE warnings, more like for another dev or smt
a comment would suffice too, but as I said, I personally would just use @Nullable
yeah anything more specific is of questionable usage
if you still have to null check then you might as well use Nullable
There's also @UnknownNullability which is more or less what you're talking about
lmao
isn't exactly this the point of contracts?
like @Contract("!null->!null, null -> null"), etc.
oh yeah that too
I still don't get the Contract annotation tbh
this means "not null argument implies not null result, null argument implies null result"
see for example
@Contract("!null,_ -> param1; null,!null -> param2, null,null -> fail")
public static <T> @NonNull T
requireNonNullElse(final @Nullable T value, final T fallback) {
if (value != null) {
return value;
} else if (fallback != null) {
return fallback;
} else {
throw new NullPointerException();
}
}
cc andre ig
hm, i suppose i wouldn't necessarily mark fallback as nonnull
but it's basically useless if it is null ig
annotation elitist will also mark with pure = true lol
oh god why do code blocks look like pure garbage on mobile
They used to have highlighting on mobile and it was actually prettier than on desktop, now it doesn't anymore no idea why
Also now there is a copy button 
that's been around for quite a while lol
Fractional Permissions but for nullability π
@SchrodingersNull
ItemsAdder plans to implement a new file structure to improve things...
And since I didn't want to spend time updating all my existing furniture to the new format (It's 192 chairs and 12 tables alone) did I instead spent time making a python script to automatically generate the YAML content based on the available wood and wool types.
Later also added automatic lang file creation because why would I want to write 200+ individual entries by hand?
I feel surprisingly happy about this tho tbh
Also, lol
Discord detects the URL as "potential harmful download" xD
Probs due to the .py ending
Neat
Ye
first message is the dead channel I didnt know about
only real og's are here
lmao, I am not an OG but im here now!
its where we can plan to overthrow the #off-topic
So true
I support that idea let's do it
we can overthrow off topic but we still have to stay on topic
so i java propose we python start plotting typescript the revolution php like this
setup a 2gb 2008 laptop as a server running in the other room π₯ someone put red sharpie all over the screen, thank god for SSH
what kind of workplace are you in π
my house XD
found old laptops that where gonna be taken to recycling, so i did that....
didn't measure here but for 1000 object pile it's ~30MSPT (so 20 tps)
im aiming for another 2-5x performance improvement :)
ah well
the MSPT impact on main thread is like 4
it's all async
but the physics simulation takes 30 Ms per tick
So, I've been working on a library plugin for a bit alongside my actual project, every time I need something that I think could be useful for other projects too, I add it to the library, and I wanted to ask the other developers here if there were any tools you need/want? either consistently or just here and there, maybe something you haven't made yourself whether it's because it's too hard, lack of time, or just laziness (I don't judge, been there myself lmao).
So far I've got:
A system for saving code in specific entities to be executed on right click.
Helpers for saving data to Entities and ItemStacks
Line renderers, both using particles and block displays.
JSON file management for human readable save data
Byte file management for saving whole class instances that can't be serialized to JSON
Structure helper, for structure copy pastes, movement, or in my case multiblock recognition.
Some common RNG and miscellaneous helper functions
Any suggestions?
Entity component system, a system for custom itemstack components, abilities / skill systems
Some sort of "value modifier" system for things like custom attributes, damage events etc
They're all things I've done at work and they're all things I wished exist before
Since posting it I have actually added a system identical to the entity right click one, but for damage instead haha
thank you so much for the suggestions!
Would you be willing to expand on the first 2?
Tools for debugging / messing with PDC
An entity component system (ECS) basically consists of a system where entities have "components"
And you have "systems" that use those components and do something with them
Instead of, for example, an entity consisting of a type, id, location, health data etc, an entity just holds "components" like a HealthComponent, PositionComponent etc
Then systems (HealthSystem, for example) are the ones actually ticking logic for those given components
You can have an entity with all sorts of logic that's invincible because it doesn't have any health to begin with
Click handling can just be a component
Entityβcomponentβsystem (ECS) is a software architectural pattern mostly used in video game development for the representation of game world objects. An ECS comprises entities composed from components of data, with systems which operate on the components.
ECS follows the principle of composition over inheritance, meaning that every entity is...
For custom item components, the idea is that items already have the data component system, but those components are inflexible because you can't register new ones (as they have to be synchronized to the client)
Instead, your plugin could manage components for server-side use, like, for example, tracking backpack data, right-click rewards, custom food etc
Here's a code snippet from work
As for abilities and "value modifiers", it gets really complex, really fast
ah, I see!
thanks for the explainer ^^
Wouldn't it be pretty simple for the itemstack components to be stored in their PDCs?
Though I'm assuming it only seems like that from a surface level
they would but you'd benefit from some sort of pdc codec system
codef? Sorry, self taught so if this is industry standard termonology then it hasn't come up in any of previous jobs
Codec my bad
I believe I already have that come to think of it...
The byte file management system, but just save the output to an itemstack's PDC as a byte array instead of to a file
IIRC byte arrays are a supported data type in PDC
They are but is it really the best way to store data?
unsure, would have to look into it for sure
You could have it as a default / fallback but sometimes if all I care about is a string, I might have some overhead
From my understanding you just made an attempt at recreating kryo
it's definetely convenient, but people don't download libraries for the library developer's conveniency lmao
what's kryo?
Java binary serialization and cloning: fast, efficient, automatic - EsotericSoftware/kryo
but... isn't this in java by default ;-;
I'd have to assume this exists because of an issue with the normal java serialization
If I'm using external helper libraries I might as well use the purpose built ones
ok, yeah, kryo seems to be about 2-3 times faster than base java serialization according to my benchmarks
however, it also seems a lot stricter in what can be serialized, for example I can't serialize UUIDs
Anyways, I'mma head to bed, gn folks π
You have to register classes to kryo or configure it to be self-registering
I use kryo at work and it serializes uuids just fine
Worst-case scenario just pass a custom serializer
I already tried that, the error on UUIDs is thrown on registration
that's true though
ah, found the problem!
The automatic serializer didn't correctly choose the default UUIDSerializer when registering UUID, so the fix was to change kryo.register(UUID.class); into kryo.register(UUID.class, new DefaultSerializers.UUIDSerializer());
made my tree structure 30x faster by making it stored as a flat array
did not think it would have this big of an impact
30x sounds odd
no recursion and much better cache coherence
flattened its data as well
which were AABBs
gonna do further testing ofc but it looks correct so far
(specifically, 30x faster insertion)
hm? how did you benchmark it?
insert time for 200k bounding boxes
after enough warmups to where times didn't deviate
this is for a clean tree
so no interleaved removals which would impact its cache locality negatively
but that's not my usecase so I don't really care
I do recall having to do this in a past project at uni
or heard it in a lecture
idk anymore
it's for a dynamic AABB tree with a volume hueristic + local rotation
Box2d's slide deck basically
yeah its a cool optimization :)
you should look into proper microbenchmarking with jmh
i am assuming this is in java, yes?
yeah 30x does sound weird though
I recall it being faster
but not THAT faster
idk the O notation anymore though
I've already done that a large amount with other parts
I don't really care
and that's not the purpose of JMH
I'm testing this in the prod environment
I'll double check to make sure everything is correct, I agree it is weird
it's the same O
yes
I used JMH heavily when optimizing my constraint solver
but here I'm testing things where the time to complete drops literal seconds
w functionally identical algorithms
faster doesn't mean it went from O(log n) to O(n) or similar
Big O notation tells you how fast or slow a program or algorithm gets as the input gets larger
Nope it's about right
I'm getting 10-40x faster
40x when N is higher as overhead goes down
microbenchmarking is not the purpose of the Java Microbenchmarking Harness?
in which you can do parameterization of the environment for how the microbenchmark runs to compare different sizes of inputs?
JMH is useful for when it's difficult to isolate the code you're using or you need to set up a way to test it with realistic loads and you can't test it with realistic loads easily with an existing setup
- it handles timing stuff well
but this isn't necessarily needed if what you're testing is already easily measurable in your environment
difficult to isolate the code you're using
I wholeheartedly disagree
I'd say it shines when you are able to isolate the piece you are benchmarking
it is a __micro__benchmarking tool after all, to benchmark individual aspects and elements of a class or method
@Param my beloved
otherwise you just get a ton of noise
this is what I meant
I meant that if you're in prod and your code is not isolated there, you should isolate it and test it with JMH
yes, which is a great way to test something as basic as a data structure
since JMH let's you do each dummy data setup properly
yeah but I don't have a reason to do this
apparently nothing, just a waste of time
constraint solving required complex data gen which is why I used JMH
I couldn't test it well on a server
but this isn't the same
also multi threading reasons
and GC and other stuff
but mostly the data gen part
also multi-second benchmarks don't require complex timing
if you're testing anything <10ms you should definitely use JMH no matter what
I am aware of what O is, hence why I questioned the O, those 30x results could've happened only due to low input
testing production loads is what matters, which is what I'm doing :>
microbenchmarking is a tool in the toolkit
so you did many things and one part of that was flattening an array
I flattened all the data of a tree
mb I grouped those together because it the same concept of replacing a field access with an array access
but along the way yeah that ofc reduces memory allocations and such
so there's also impact of that
btw y'all were right Abt the performance thing not being accurate, it's a much less crazy improvement in reality; I had made a tiny mistake in the cost function causing it to create a linked list instead of a tree, giving a superficially correct output but not being actually useful
mistake was 2 missing characters π
sad
trying out Claude code properly
to build a testing framework for a battle feature
its made some dumb mistakes at times... and the main thing I've noticed is it's easy to start simply not testing its work
but for menial shit that's not too complicated, along with a very healthy amount of code review, it is good enough
I'm not really letting it make any architecture decisions
Recently used lovable to prototype something and I was amazed tbh, it did it almost first try.
I personally love it itβs just handy
I use it all the time itβs great for writing documentation doing small and even semi large things
Terrible at code optimization
I also find that it's kind of like very slow for refactora
I don't really use any AI agents to build code
I prefer autocomplete AI
Copilot is ass, I myself use supermaven which has been abandoned but still works
I've heard good of windsurf? or whatever it is
maybe just because I use vim motions and intellij and have defent typing speed but it's wayyy slower at for example changing the usage of something at a bunch of places
I find this to be much more annoying ngl
its a negligible speedup for me when it does work
and it oftentimes gets things wrong
the time impact of AI auto complete required checking if what it gives you is correct + reaction time delay if you're not waiting for it, or a delay either way if you are waiting for it, + potential modifications. all of this for me is usually much slower than just typing it myself
btw have you tried copilot on VSCode?
it suggests things in other lines or in general places where your cursor currently isn't
really useful for refactoring and stuff
since you change one thing and then it recognizes all the other things that needs to be changed along with it
i have not;
I've seen this feature though
I don't know how I'd feel about it
but I do imagine it's a lot better than just auto complete
I've gotten quite good at vim macros and editing so I would say in general this usually isn't my bottleneck
but for example I need a Kotlin DSL for the battle testing code (the only reasonable way to do something like this since the test scenarios are quite complicated) and I absolutely was not going to write that myself when it's mostly bs code
still took a lot of hand holding and Claude doing dumb shit but I've made a fair bit of progress with it, i can confidently say it was better having AI do it and doing review than doing it myself
my passion shit like the physics engine and Comet is what I wouldn't bother trying AI with since it's usually genuinely complicated to do and needs to be done properly... but something like a testing framework for a battle sim does not really need the same level type of critical thinking
oh yeah definitely
I probably wouldn't trust AI for that stuff
but rather more for tedious stuff
although
iirc copilot supports using claude as well, so I wonder how it compares vs asking claude manually
mmmmmmmm vim
I gotta learn that someday
especially for command line - still using nano (and I don't know how to use any of its features either :p)
lots of code review :)
I'm ngl I'm hoping to move away from work that's less interesting to me in the future so on one hand it's cool but on the other I want to be doing stuff where LLMs are less applicable π
I just vim motions in Intellij and Neovim for text editing, it's just really nice on my hands
I'm ngl
AI is too stupid to design the testing framework
its implementation isn't actually useful because it doesn't use enough of the real code... which it could have easily done since I had already done the prep to make it completely independent of being actually ran in a server
been working on my packet optimizer, have gotten a decent result of 6.5x less bandwidth for 30 Comet fire effects while retaining similar visual quality
it works by taking in the data about a display entity over its lifetime, some tolerances for scale, color, etc, and then trying to find minimum number of data that needs to be sent over the server to fit those requirements
open source as Mengshe on my gh, still very bad and very memory-churny code but it's been a cool start
this already works way better than my last attempt at this problem, with weeks less of work
so what, you trade network bandwidth for increased memory usage and for like 80% accurate representation of the original?
Honestly Iβd rather have lower memory usage compared to lower networking, not fully sure good use cases for it.
Sounds like a interesting project tho.
Only thought would be if youβre sending 1000s of packets per tick to the user, but even still they should be able to handle it
?
its just marginally higher memory usage?
it can be 100% accurate in some cases, for example if the transformations are well modeled linearly
Still, I have actual gamemodes that use 50~ GB of memory each.
And use most of that still lol
like there's no way storing position and transformation data for an entity over some ticks is really a big issue
Not saying we arenβt leaking stuff, ye
- object pooling anyway
memory usage is not really an issue
and either way it's always solvable
6-7x less packet data is quite significant, I don't understand your point about the memory tradeoff, it's not really a real issue
the actual tradeoff is being able to things simulate ahead of time
Yeah ig
that sounds like something is going wrong ngl
Tbf one of them had 512 dedicated to it back in the day
Just because it had to store so much stuff in memory 24/7 with like
1-3k unique on that server alone
that still sounds sus
what does "6-7 times less" exactly mean here?
do you mean 1/6th / 1/7th ?
because obviously it can't be n - n*7 lol
.
thats what "6-7x less" means yes
it differs between the effects I tested, some are inherently easier to optimize than others
for example lots of color changes necessitates a lot of metadata updates
I use a βE threshold to reduce # of these updates but ofc some is still unavoidable
the optimizer currently works by finding the 100% optimal way to place the teleportation updates to fit the position constraints, and then works off that solution to solve the rest. despite it not being the global optimum it has given really good results
that's stupid
and for the fire particle specifically it finds it in microseconds, tho I haven't optimized it much yet
same way people say "2x less" to mean 1/2
I feel like it makes sense
it doesn't, it's stupid
:|
people are stupid then
feels like something most languages would say
it's a stupid expression
ik Russian and Spanish do
wait until you find out how the french counting system works lmao
they start whipping out multiples of 20s and shit lol
tbf it's not like they think of it like that
yeah but i mean that's how like all the numbers are named after 20s lol
kotlin value classes are cool....
have found good use for them in high performance data structures
i have a lot of cases where i thnk of things more as pointers (indices into an array in reality) to store them efficiently in an array, but that means it's quite simple to mix up the value at a location and its index (since they're both of the same type)
however with value classes you can really easily wrap a primitive and bam, it'll be a different type at compile-time and cost you nothing in performance at runtime
fun find(i: UnionIdx): UnionIdx {
var idx = i
var idx2 = idx
while (idx.value != arr[idx.value]) {
idx = UnionIdx(arr[idx.value])
}
var t: Int
while (idx2 != idx) {
t = arr[idx2.value]
arr[idx2.value] = idx.value
idx2 = UnionIdx(t)
}
return idx
}
@JvmInline
value class UnionIdx(val value: Int)
example of my usecase
here arr is an Int2Int collection so i have to get its value there, but overall it still improves the overall safety
(no this is not the same as type aliases, the point of this is specifically for them to not be thought of as the same type)
wha
how have I never seen value classes before
valhalla shadowing
since these are like
they can only hold 1 field
so they are nowhere near as useful as what Valhalla aims to bring
and ofc jvm is still gonna box you with these if you're using generics
but they can be very useful in some specific cases
and yes for clarification, these act exactly as primitives here; there is no memory allocations being done despite the kotlin constructor calls, they are compiled down into static methods that return a normal jvm int
no boxing necessary for type safety!
Yeah it works just like in Scala
god i can't wait for valhalla to do this in pure java
yes
I really really hope we get like
flat arrays of value objects
I will be majorly disappointed if that part doesn't work well
they said this would happen
but they also said that it would be the JIT's decision on when to do it
they said like "there's gonna be no 'flat' keyword, JIT is smarter than programmers about this" and then proceeded to compare it to restrict from C
and uh
I'm ngl to you man the JVM is not that smart
so hopefully it doesn't require jumping through ridiculous hoops for it to flatten value arrays
Not sure who they is, but generally leaving the decision to the JVM just makes it easier to e.g. support multiple platforms
Itβs smarter than 99.9% of the programmers
And if you find a missing optimization opportunity, you can just contribute an improvement
this is not what i mean
it rarely "misses" and optimization opportunity
it's that developers often do things on accident that make it impossible
also, i do not want to contribute to the JVM
or jvm can't know certain things about a situation, and it's not like you can hand the JVM a list of statements for it to use in its proofs
"this will only be accessed from a single thread, i pinky promise!"
threading is basically the one place where the jvm is allowed to assume that it's only accessed from one thread in certain circumstances :p
i explained that badly, i was referencing a specific example of smth in my codebase but yes that's true, since CPUs do do that
but my point is that it's not a JVM thing
it's that developers must write their code in such a way that the JVM can optimize it
which may be impossible or extremely difficult at times
due to the fact that the JVM cannot know all the things that are true in any given situation, while the developer might have additional information
yeah that's just general limitations of computing
hopefully i don't have to work with java for much of my life π
i do not expect that to be the case if i go into physics like i plan to
python
Julia π€
i dunno
i'm gonna try gpu programming for another physics sim
i think i would do something in computational physics
so still a whole lot of programming
Julia is okay-ish from what I've heard
but it probably lacks proper tooling like so many languages
multi threading is awesome
for my physics engine i need to diff the world around bodies, which means a lot of block access; i looked at how FAWE handles async access, implemented that, added multithreading... 0.6mspt to check and compare the states of 16000-27000 blocks
this is crazy fast
it still could get more optimized but probably gonna leave it there
What newsletter service do you guys recommend that's easy to integrate with a custom website? Tbh I only need a way to send emails to users with latest offers. I've tried kit.com, seems nice, but for some reason I don't receive the confirmation email for my subscription -.-
mailgun?
maybe one that's cheaper? idk how many users I'll have, but 100 mails/day is a bit too little and I don't feel like paying $15 for it.
100/day is too little?
it's the only one i know about sorry haha
but 100/day seems like a lot to me
wait I read it as sending mails to 100 users, is it individual mails sent to however many subscribers you have?
i think so
that doesn't sound right, I think it is number of recipients you can send emails to. If you have 200 subscribers maybe 100 will receive the mail today and the other 100 will be scheduled for tomorrow?
@eager fern you have websites, what do you use?
sendgrid to send emails
iβve always used sendgrid
I use sendgrid cuz I got it for free with github education years and years ago
yeah it sucks but I pretty much never have to log into it since I just use their smtp server not their api
Is hacktoberfest giving t-shirts again? π±
Damn it
It does look nice, although last tshirt we had (2023?) Was hella nice too
ah I can't remember the last shirt I got
definitely not 2023 I don't think
I think I've got 2019, 2021, and 2022 or something
This is the one I meant
(Mild use)
Probably already out of stock π
I'd assume so yeah
suffering
lol
Honestly should've expected it...
But at the same time do I not see participating in it again tbh
Not really, after 2y of stupid virtual badges
Ngl, I don't like the look.
Yeah, the Holopin stuff is so stupid
I have yet to find a person who proudly shares their holopins...
At least with stickers you have something to slap onto your laptop or other surfaces... But these pins are useless in pretty much any possible way.
Ye fr
Only good thing is the tree planting... But looking at the HF page, I can't see any mention that even that is still a thing
This also reminds me of Modtoberfest lol
kinda want a variant for plugin development tbh
It is
I got a free tree when I claimed the tshirt
But they require me to create an account in tree nation
And I really don't like the sound of that
I do have a tree planted and recently got a mail about its birthday... lol
lol
Hey Folks, has anyone ever worked with Minecraft's Translation Keys in Bukkit/Spigot? (I know Paper/Adventure has better translation support - I'm looking to avoid those as a requirement/compiling with it)
Mojang has some items that utilise translation keys directly on items with NBT like so:
"minecraft:item_name": '{"translate":"block.minecraft.ominous_banner"}'
I'm looking for help correctly parsing the translation key in Inventory Titles as it just appears to display the JSON as a string rather than parsing it.
I dont think spigot supports components in titles and will only accept string, atleast that was the case a while ago
Yeah, that's what I've read from googling about the place - it's kinda annoying. I am just considering to say fuck it, and force english translation for gui title.
itβs probably possible with nms for what itβs worth
the lengths people will go to to avoid using paper api
It's more I want something that works on Spigot for the idiots that still use Spigot. π₯²
for the 10% ?
i mean, if it was up to me today i wouldn't bother, it's too much effort to maintain compatibility with a platform that barely gets any use, especially today after Paper is no longer syncing with Spigot's changes, they are effectively two separate platforms, like neoforge and fabric
but if you wanna go for it, i'm not gonna stop you
You do make a fair point.
Wait why is it a requirement to not use MM?
Actually, it's way less
In latest versions
Spigot is a dying ship
MM?
The only reason I see devs not getting rid of it is because there is no better alternative for selling plugins
because spigot has no component support
source?
BBB and polymart kinda mhee
my source is kenny's secret graph
Last time I checked it, it was using mini's?
Idk who was it
But it wasn't kenny's
I don't suppose anyone knows off the top of their head what version of Paper added support for Component in Titles?
https://jd.papermc.io/paper/1.21.8/org/bukkit/Bukkit.html#createInventory(org.bukkit.inventory.InventoryHolder,int,net.kyori.adventure.text.Component)
declaration: package: org.bukkit, class: Bukkit
since components were added to the api in 1.16 iirc
Does Paper impose Java limitations on their server jars? I'm attempting to boot Paper 1.14.4 on Java 17+ and am getting a error message saying to use a maximum of Java 13.
I could have sworn Paper 1.8 runs on Java 17 happily and doesn't have similar limitations seen here with 1.14.4.
Yeah, wtf.
agree to the eula D:
The 'wtf' was to Paper 1.8 working with Java 17 (well Java 21 in my case) and not Paper 1.14.4.
oh
there was a time where spigot was overly restrictive
try java -DPaper.IgnoreJavaVersion=true ...
Β―_(γ)_/Β―
paper later changed it to allow loading with that flag
not sure which version though
Oh, do you know if Spigot has the same issue? I guess I'll check.
pretty sure spigot is more restrictive there
Give me a sec and I'll download spigot to confirm.
sounds like a powershell issue lmao, maybe put "" arround the flag
yeah I was confused on why that error was showing
Okay, yeah. fml.
Like this?
java -"DPaper.IgnoreJavaVersion=true" -Xmx5G -jar .\paper-1.14.4-245.jar
Or do you mean the value of the flag?
that was just a wild guess, see the stackoverflow post for the apparently correct solution
I don't really know what I'm looking at there to be honest but here is command prompt instead:
ig it wasn't added in 1.14
It has me wondering how other plugin developers are navigating this with Java 17+ requirements... maybe they are just ignoring this 'issue'?
As I've seen some other plugins on Spigot mention "Java 17+" as a requirement.
plugins compiling to 17+ won't run on these old mc versions anyway because of outdated asm dependencies
well, the server runs fine on newer versions typically, but plugins compiled against newer versions cause problems due to the bytecode rewriting stuff
I mean in my instance, the plugins function fine since they aren't doing any crazy shit - it's a shop plugin I'm working on.
As it works on 1.8 and 1.21 just fine - just not 1.14.4 I guess due to this Java limitation.
the server will still try to rewrite it I guess
1.8 probably doesn't have any rewriting
not sure
mainly that for spigot I guess
sometimes to avoid some breaking changes
e.g. bukkit has its own Function or Consumer interface or something like that and it got replaced?
there were also times when Bukkit.getOnlinePlayers() returned an array I think
that means you're old btw
That's past middle age
F.
I don't make the rules
Well this is fun. Done some checks and my plugin is incompatible with 1.13 to 1.16 due to these versions having a maximum Java version supported lower than Java 17. 
Itβs okay nobody uses those versions anymore
I wish.
It's ShopGUI+ which is old af and has oldies still using versions as old as 1.8 because somehow Factions still has people playing.
You can still support 1.8 and 1.16.5+
The only one with a named label is 1.16.5 lol
Well yeah, 1.8 to 1.12 has no issues with Java 17+. It's just annoying as there will be atleast one bugger who leaves a 1-star review bewcause of it.
Hmm, no bstats? Then we could know for sure how many people would be impacted, sad
I got no bstats or similar sadly other than some skewed stats from an addon that was published in recent years.
Well still, general playerbase-wise, essentially nobody is using those versions anyways
I would love it if MC was a 'versionless' game where everyone was forced on the newest version - would make life so much easier. π
Unrelated but is the BStats 'Server Location' data broken? All location stats are showing 'no data to display' for me.
you should try joining that same server with a minecraft client π you'll find that it does indeed not "run on java 17 happily"
I know you have to turn off the native transport feature but it does work.
I personally hate it
Hdll?
Oh lol
this vs File(tmp, "hello.txt")
it's less familiar which makes it a little worse automatically
wait I feel like this would be neat tho π
i think in an individual case it makes sense too
A plain reason of why I don't like it is that just looking at that I would have no idea it would return a File
oh that's true
i don't think that's very fair
unless you have type annotations turned off
Typo
Yeah but it's not as readable, I would rather have something like file(temp, "hello.txt")
its a tradeoff between just a few characters of concisity and having to remember 1 more little thing
not the type information (ide shows it) but perhaps being unsure of what the function does immediately
donβt get me wrong, Iβm a die hard kotlin lover
but there does come a point where it becomes slightly more inconvenient to read
thatβs probably crossing the line
I don't understand the hate with that :(
subjective
it isn't clear at all what foo / bar means apart from regular division
if your brain has to accommodate for "oh, actually, it isn't what / is for" then it is confusing to read
although to be fair, / is also the symbol used as path separators (well, I guess windows uses \ but it allows / too)
but yeah I can see how if the variable naming isn't clear, then it can be confusing
otherwise, it'd be like ```kt
val file = directory / "file.txt"
// vs
val file = directory.resolve("file.txt")
but python, for example, does this already: https://docs.python.org/3/library/pathlib.html#operators
imo as long as it's clear what's being done (e.g. not val result = initial / next) then it shouldn't really be that unreadable
and ruby as well it seems
I was not expecting to find this many languages lol
I don't think that's confusing, it's just a different "name" for a function
like after you read it for the first time, it's pretty idiomatic
and it's not as though it's an uncontextualized "foo / bar"
its in the context of IO code
I dislike operator overloading when the operation doesn't make sense in the context or it looks ugly... and true this isn't at all "division" but it is a separator and that still makes sense to me personally
I'm ngl tho I wish Kotlin += *= ... could be expressions
so that you could do like m1 *= m2 *= v2
and it would mutate instead of creating a new object like * implies
and technically I couldnjust make * be a non pure multiplication overload but THAT absolutely oozes confusion
the alternative is named infix functions tho.. which is an option
Personally I don't really like it. I feel like this is just pointless and you are not gaining anything by using it.
and also several people already said it's confusing
I think its fairly obvious, but there are quite a few books about code clarity. The code should be simple, straightforward and readable.
If you are working alone and on a small scale project, sure, quirks like that maybe make sense, but not if you are working with a big team and on a huge codebase (imo)
this is also a good point about clarity.
also I feel like if those two lines
val tmp = "/tmp".toPath()
val file = ...
are close by it makes sense, but if one is on the line 23 and other on 89 it's not as obvious
yeah we'll just have to disagree, I, as many, find it difficult to read even within context, especially on a team where you have to read hundreds of thousands of lines of code written by other people, I would want it to be very explicit and clear what everything means, writing potentially more confusing code where the mental strain to remember what division means is higher seems like a risk than a reward
you also say "it's just a different name for a function", but that's the problem, it is not a name at all, it is whatever name you give it within the domain of what it does
anyway you're not going to change your perspective but if you want to write hard to read code then more power to you
You could see it as a name, but I'd argue that it'd be just as bad path.dividedBy("file.txt")
precisely
That's how path / "file.txt" reads
also dkim, saying C++ does it is probably an argument against it
stdout bitshift left string
/hj
alright now this is a reach π
this is valid though
ngl I think if you deal more with math then you're more likely to like operator overloading
because it's a field where people make up new notation constantly if it's sufficiently helpful for the task at hand, oftentimes just to be less verbose
I like operator overloading, I just think it needs to make sense as the operator not as a "cool" syntax sugar to a function
realistically, what is gained in this case? I mean overloading / for path
exactly
I don't think I'd actually do this
listOf("element") + listOf("element2") is a great example of an operator overloading that makes sense
it's cool that you can, but like uncle Ben said great power something something
any time operator overloading saves you parenthesis spam (math) that's awesome tho
I mean yeah it might look cleaner/nicer, but imo clarity is more important
it can certainly be easily misused so it's easier to forbid it in a large team's rule set than it is to lay down rules as to how and why it should be done
inb4 the result is listOf("elementelement2")
that's some javascript level shit
that's just how e.g. vector addition works!
Heh... true
||sorry for ping π||
learning zig... this is so much faster than java
my first ever time spending more than a few minutes
the equivalent java program i wrote in 20 min, this took me 4 hours
didn't optimize the java version but in reality the code is honestly quite similar
then again this is a physics sim so it's not like i was using much of java's features anyway
so it's basically free performance by using a lower level language
have you tried "RUST" (it's memory safe btw)
if you don't use much of java's features there shouldn't be much of a performance difference
I'm not sure I care enough to optimize it and test it thoroughly
actually just for that reason I will next week
I mean, at the end this is a public thing no?
doubt anyone would use a zig or whatever lib/plugin
this isn't for minecraft
unless i rewrite my physics engine in zig
which i probably won't
i'm planning to be a computational physics major and i've been wanting to write a sim in a more low level way for a while
after college applications finish i'm gonna start working properly on (probably) a fluid sim and then test out different methods for solving PDE's there (regular numeric vs using neural networks) and both for performance and for learning purposes, i want to write it in a language like Zig or C
oh
oh that's hella cool then
thought this was mc related
naur not directly
@potent nest i'm probably just bad at Zig, but yeah optimized java version is only ~10% slower
there isn't much reason why it would be significantly worse
java has lots of little tiny overheads
but i guess those do turn out to be just tiny
again tho i'm like, very bad at Zig
so this is not a fair comparison
eh, not sure what these overheads would be
worse cache locality
not really
very slightly
even if they're all created together, the object headers still make it worse
damn Java is so fast
but in contrast the GC is allowed to compact fragmented objects to improve cache locality :p
i dont know how much of an impact this has in the real world
cause cache lines aren't that big
what are the chances that some data you wanted together got fragmented, then put back together
i mean like yes that happens but i can't imagine that making a big difference
I mean it's not just L1 cache
oh true
yeah ig with smth as simple as this sim it probably all compiles down to very similar assembly
less memory usage still a win but yeah wow that's not as big of a difference as i thought it would be
like i understood beforehand that it shouldn't be that big a deal, but still
zig comptime stuff is NUTTY
alg.math("a * b * c") is parsed at compiletime
meaning that there's no overhead with this
really just so much cool shit you can do with this
mfw unsafe D:
I donβt understand this last example at all
Why is it multiples of 5
oh
Wait Iβm stupid
Sorry!
I'm gonna write the same thing as a learning exercise
well that was easy:
const E = try parser.parse("x * y + z");
std.debug.print("Result: {d}\n", .{E.eval(.{
.x = 5,
.y = 5,
.z = 1,
})});
didn't add matrix and vectors and stuff
but those are trivial to add
comptime is AWESOME!
the AST is generated completely at compiletime
and there's no overhead with dynamic field access or anything because all the identifiers are known at compiletime
wow
Blimey, even
pogers, even
wait yo that's actually sick
i remember they released the mappings a while back but they were basically useless cause of legal concerns right? like we still used yarn mappings and stuff for fabric iirc
mojang mappings exist
I think fabric has legal concerns, but paper doesn't care for a long time already
oh yeah you're right, paper started doing mojang mappings a few releases ago right?
i remember they remap plugin jar files on first startup
still nice though! and great to see that paper is already ready to go, as per usual
md_5 is gonna have a fun time xD
this might be a relatively weird question, but is anyone using vscode for java dev?
I am having a weird issue with plugins
The one from Redhat works pretty much perfectly (though missing some refactoring stuff)
https://marketplace.visualstudio.com/items?itemName=redhat.java
The one from Oracle just fucks everything up
https://marketplace.visualstudio.com/items?itemName=Oracle.oracle-java
the redhat one is based on eclipse, the oracle one is based on netbeans. That answers basically every question
have you worn wigs?
will you wear wigs?
common netbeans L
but seriously how do I move from IDEA to VSCode, VSCode is missing so much stuff I can't bruh
I mean you're probably doing something wrong
but seriously how do I move from IDEA to VSCode
You lower your expectations
eh I mean, IDEA is basically for java, where vscsode is trying to be for everything
license is running out
why can't you use the community edition?
I do web dev (react with TS) on IJ with no issues at all, IJ can do a lot more than just Java
the intellij family can do a wholeeee lot of languages very well but that's a separate conversation
well, technically I could
honestly I haven't looked at the differences between ultimate and community
Biggest ones are probably things you don't use, like DB integration
used it briefly, a nice to have, but I guess not mandatory
wait whatever happend to Fleet? is it still relevant or, rather, becoming relevant?
having used both ultimate and community editions, currently using CE on the daily, i can't think of anything i'm missing personally
iirc it's basically just vscode copy, but from JB
there was one thing but i can't remember
Fleet is getting the google treatment
must not be important enough to be remembered
I remember all the hype around it but it kind of died out
when will you wear wigs?
I guess there are quite a few differences, question is which ones do I care about lol
https://www.jetbrains.com/products/compare/?product=idea&product=idea-ce
sucks community doesn't support Spring
honestly just paying the 170 a year is cheap for the products you get
kind of saving money rn and it's not like I need it that much for personal use
I have all products pack on my work laptop, but that has a cloud license or whatever, so I can't use it on my pc
Fy WebStorm exists too for webdev π
I only have rider and webstorm on work, but all products for personal
I've only used PhpStorm, since I pretty much only use Laravel lol
a little less than 15 euro a month is cheap for it all
well it sucked
Only good thing about Fleet was it's simplistic UI
Didn't really find any real benefit between using WebStorm or just using IJ
which they are kinda bringing to IJ with their new islands theme
All of the functionality in WebStorm is available in IntelliJ IDEA Ultimate, either out of the box or via free plugins. There's no need to purchase licenses for both IntelliJ IDEA Ultimate and WebStorm unless you like having a dedicated tool for each language. Then WebStorm may be the right choice for focused JavaScript development.
Yeah that
basically WebStorm is stripped down version of IDEA (Ultimate? not sure about community)
It has some small extra builtin stuff, but I mostly the same yes. I only used it cause it did use less resources due to being only focused on web dev
What small extra stuff?
But nowadays, specially since I am actively working on hangar, I use Intellij since hangar's backend is in java anyways
I couldn't find a single one
eh been a while but I remember that some plugins were automatically installed or smt
Automatically installing plugins is hardly a reason to pay :')
But nowadays I use Intellij for everything as stated here
it's just sad that intellij kinda sucks lately
performance has been worse, more bugs, etc.
specially with the 2025 edition
I thought it was just skill issue on my part but apparently a lot people are reporting having issues with IJ
haven't noticed anything tbh
can't say it happens to me
Same
and i use intellij on 3 different environments
I haven't had any issues since the latest update though
so, we shall see
but I do wish it was less resource intensive
But well, the IDEA engine is old as shit I assume
post the pc specs
less resource intensive is mainly a comment for my laptop, but it's not really a big issue
the issue is (or well... was? maybe?) bugs and issues.
But fy, laptop is an Lenovo 7i Aura Edition 16GB ram, I7U 256V Lunar Lake and desktop has a 7900XTX, 32GB ddr5, R7 7800X3D
seems fine
don't you get a perpetual license? so you just wouldn't get updates?
and if you have/had the student pack, you get like a 40% discount on buying them outright for a few years iirc, so that could be pretty nice!
uh I'm not sure tbh, I read the terms or whatever and fairly certain it meant I was not covered
do you still have your college email
oh weird, i swear you just had a perpetual license for whatever versions you were paying for, so you can just use them forever and not update
As of November 2, 2015, JetBrains ceased the sale of perpetual licenses for IDEs and .NET tools. However, you're eligible for a perpetual fallback license with an annual subscription or after completing 12 months of on-time payments with a monthly subscription. Licenses bought before November 2, 2015, remain valid indefinitely.
ah I see, you didn't have 12 months of subscription?
I suppose so yeah
the emails are deactivated after a year or so after you graduate
so sadly no
π
yep
I remember my GH account primary email was my university one
I'm glad I didn't realize too late to switch lol
OSS license, or beg boss to make a deal with jetbrains π₯²
or switch to community edition
well I used the one I had at my previous workplace since it was tied to an account
and I could login on my personal computer
and now the new workplace has a license server that is only accessible under a vpn
ah that sucks
well, honestly, I just use ultimate cause I have it for free
I'd otherwise use Community, the difference is not big
student pack?
I have only used the "Code with me" thingy like once or twice in my life xD
yes
i have my school email permanently
so i could theoretically have the student pack forever ig lol
th, lucky
Used it once at work to go over some code and explain but then we were like "why tf are we doing this" and called and shared screen instead lol
(forgor to reply to the message, was talking about code with me)
on a completely different note, has anyone ever done a component library (specifically for vue)?
Code with me is something you touch once because it's cool and never again lmao
Yeah lmao
nobody wants a google docs ide
only time I used it was during a project at uni, we were using PlantUML and for some reason only the PC hosting showed the graph so we hooked his PC to the projector and used mine to code lmao
π
it would be nice if it was faster and easier to setup (not saying it's difficult, but some people are very not used to it)
I kind of like it tbh
but yeah, not something that you use often
unrelated but i literally hate my college class rn
my professor covered python in a single lecture
react in a single lecture, shell scripting in a single lec
so uh, I assume no one did?
and now there's a midterm π
that's typical tbh
my professor of prog2 covered RiskV, C and Java in 3 lectures lol
you still think you fucked? xD
Yes lmao
yeah, I think so too
exactly
lets hope pray that we get jobs like matt
the legend got a job in a block game
@ocean quartz where r u working bruv
where are you working
ic
fy lots of math and physics
but you also get lots of math if you go into CS
MCCI
in other words, matt works for NoxCrew
afonso have you done internships?
oh yeah, in your actual job chances are you don't use math at all, but for some reason a CS degree requires 20 stages of cancerous math
yep
wellllll, according to my university, yes
in reality no
calculus 1/2, probability & statistics, yadayada
I had physics too, was probability the easiest class ever lol
At my university, instead of having an internship, they have a full intensive 7 week full blown project that mimics the process of working at a company, with design phase, implementation, etc.
so no, I officially did not do an internship
Ic
I have done several workshops at Amazon (AWS) though
yeah same here actually lol (maybe not exactly the same), though we also did have interships
Yeah
and got an internship offer there actually, but couldn't take it due to other reasons

