#dev-general
1 messages Β· Page 224 of 1
better
Interfaces in kotlin btw?
what about them?
Are they advantageous as in java ?
um
Everything is in fields anyways
well yeah lol
lol
ooo x2 multi
lemme just
Firstly, it's a compiler hack. The Java compiler isn't intended to be used like that and so it can cause compiliation errors, or worse:
I was working with a project using Lombok recently and method references for a lombok generated method were causing some pretty difficult to debug runtime errors.
Secondly, it requires an IDE plugin. You have to properly configure your build tools and IDE to avoid hundreds of errors, and installing an IDE plugin + setting up annotation processing takes time, especially if you're inexperienced.
Generated code also doesn't show up in Javadocs, so unless users have source code available it's going to look like nothing is accessible
If Lombok's code generation does something unintended, it can be difficult to debug, and usually requires you to remove the annotations and do a certain impl manually anyway. However, once you get used to this it's very discouraging to do, so it's easy to rewrite an entire class just to make it work with Lombok
There's also an extra degree of complexity with Lombok. Java is supposed to be explicit, and transparent. If you don't notice an annotation at the top of a class, it's easy to wonder where a method is coming from, or why a field is never initialized.
It also can be harder to work with. Again recently, IntelliJ couldn't find usages of a constructor, because as far as it was concerned, there was no constructor - Lombok generated it - meaning I had to find every usage of the class and search for a constructor which wasted a lot of time.
A final, slightly petty point: Lombok'ed bytecode doesn't match the source code (obviously), but it means a pretty annoying IJ warning (look at BungeeCord source for example)
Lombok may seem good in the short term, but it comes with a heavy price. Favour IDE generated boilerplate, or consider using a language like Groovy or Kotlin if you really dislike boilerplate.
:))
Firstly, it's a compiler hack. The Java compiler isn't intended to be used like that and so it can cause compiliation errors, or worse:
I was working with a project using Lombok recently and method references for a lombok generated method were causing some pretty difficult to debug runtime errors.Secondly, it requires an IDE plugin. You have to properly configure your build tools and IDE to avoid hundreds of errors, and installing an IDE plugin + setting up annotation processing takes time, especially if you're inexperienced.
Generated code also doesn't show up in Javadocs, so unless users have source code available it's going to look like nothing is accessible
If Lombok's code generation does something unintended, it can be difficult to debug, and usually requires you to remove the annotations and do a certain impl manually anyway. However, once you get used to this it's very discouraging to do, so it's easy to rewrite an entire class just to make it work with Lombok
There's also an extra degree of complexity with Lombok. Java is supposed to be explicit, and transparent. If you don't notice an annotation at the top of a class, it's easy to wonder where a method is coming from, or why a field is never initialized.
It also can be harder to work with. Again recently, IntelliJ couldn't find usages of a constructor, because as far as it was concerned, there was no constructor - Lombok generated it - meaning I had to find every usage of the class and search for a constructor which wasted a lot of time.
A final, slightly petty point: Lombok'ed bytecode doesn't match the source code (obviously), but it means a pretty annoying IJ warning (look at BungeeCord source for example)
Lombok may seem good in the short term, but it comes with a heavy price. Favour IDE generated boilerplate, or consider using a language like Groovy or Kotlin if you really dislike boilerplate.
ye lombok is a hacky whacky janky solution to a non-existing problem
Firstly, it's a compiler hack. The Java compiler isn't intended to be used like that and so it can cause compiliation errors, or worse:
I was working with a project using Lombok recently and method references for a lombok generated method were causing some pretty difficult to debug runtime errors.
Secondly, it requires an IDE plugin. You have to properly configure your build tools and IDE to avoid hundreds of errors, and installing an IDE plugin + setting up annotation processing takes time, especially if you're inexperienced.
Generated code also doesn't show up in Javadocs, so unless users have source code available it's going to look like nothing is accessible
If Lombok's code generation does something unintended, it can be difficult to debug, and usually requires you to remove the annotations and do a certain impl manually anyway. However, once you get used to this it's very discouraging to do, so it's easy to rewrite an entire class just to make it work with Lombok
There's also an extra degree of complexity with Lombok. Java is supposed to be explicit, and transparent. If you don't notice an annotation at the top of a class, it's easy to wonder where a method is coming from, or why a field is never initialized.
It also can be harder to work with. Again recently, IntelliJ couldn't find usages of a constructor, because as far as it was concerned, there was no constructor - Lombok generated it - meaning I had to find every usage of the class and search for a constructor which wasted a lot of time.
A final, slightly petty point: Lombok'ed bytecode doesn't match the source code (obviously), but it means a pretty annoying IJ warning (look at BungeeCord source for example)
Lombok may seem good in the short term, but it comes with a heavy price. Favour IDE generated boilerplate, or consider using a language like Groovy or Kotlin if you really dislike boilerplate.
eggspee
Doesn't work like that though


Oo ur pfp is a fish not a head
yea
It's a Stunfisk
each time I look at that picture I see something different
magic
i'm not sure i am allowed to say
I have a Galarian Lemmo
some unkind things were said
DM?
He did say he was applying to some servers actually
;p
eh
mhm
not as much as just a normal job
no
irl*
Joe Biden has announced that Sxtanna will be on his cabinet as Minecraft Secretary
This is the future the left want.
He left us for sleepy Joe!
Watches over the christian servers
of course
how does discord's @here work? Does it ping everyone that is online?
why does it ping if I'm invisible
π¦
oh
shit
why I asked here and not in #off-topic xD
because discord doesn't care about your status, probably just if you're connected or not
ye they should add a check for that but whatever. ty for answering
eh it makes sense for u to be pinged when ur invisible
because ur still technically online
I mean it makes sense to ping offline too, the point of pinging is to let people know about something, even offline
ye but that's why @Everyone exists
wasn't there a way to block those pings per server tho?
oh there is. I never saw it til now xD
here to ping online people. everyone to ping everyone and offline people
anyone wanan work on a project with me
What project?
yes

The project to finish all projects
its called The What Project
How may I help you Fefo?
seems like your keyboard is broken? xD
@mental trench found this on someone's log in the LP discord lol
ok and?
haha
is cool ig
any of yall can lnik ur spigot acounts?
how i fix this error:
has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Lower the compile level when building a .jar
I see RUST is making practical effects on the INDUSTRY... But at what cost?
Bm got the nitro I see xd
All thanks to Mr conclure 
finally team fortress guy is able to speak
Indeed you have not
I meant the guy in your pfp π
Oh that's what u meant
sexy
Kotlin Multiplatform Mobile or Flutter?
Flutter seems to be "full stack" whereas kotlin is just logic
mhm
Me neither but I wanna try one
Flutter is a lib, and kotlin would in general be a language
not sure how to compare them
Id say give flutter a try, easy chance to learn dart as well
Although
If it was a game, I guess UI wouldn't be needed as much
But yeah I think I'll try flutter
Dart is ridiculously easy as far as I know
No gimmicks, just statically typed JavaScript with a few other things
typescript is typed 
How bout no.
Ok
nah
Pff... Easy... Ever heard of the enhanced for loop? Java 5 is great!
he also recommended the hardcover π
the price would also make me cry
oof
the meme needs more jpeg
JPEG
add a kangarko watermark and it'll be perfect
Can anyone see the issue with this loop? For some reason, it's returning one short: https://hastebin.com/dacaluluki.kotlin
jesus fuck
this is a lot of text
there
Hmm LobbySwitcherGUI.this., .this, what, why, how?
yes Matt yes. xD

How does that even work?
Btw not throwing shade at your code, this is a legit question
but that's static tho Yugi?
no frost
it isn't
wut
loving the reaction xD
You have to use <ClassName>.this to access the outer instance inside anonymous classes and inner classes
simply this will refer to the anonymous class' instance
Ah, ew anyhow
Guys... it's not my codee. I paid for a plugin and the dev then fucked off with issue. So I'm not trying to fix it; with little to no java knowledge.
Wait, is this decompiled code?
That would explain a lot of things there
You probably won't get far with decompiled code, a lot of things will be messed up
It works, to an extent. As I said, it's not displaying the correct number of items in the GUI. Suppose to be 6 but it's showing 5
Just add another item 
Ha, They suppose to be added dynamically, so as servers start, it alters it. Hence the loop
MINUS cost. If they consider RUST for javascript compilers. the INDUSTRY should CONSIDER taking RUST as a replacement for javascript as a whole.
Hmm, question, what sounds better:
Having permissions for specific things like:
plugin.format.legacy.bold, plugin.format.markdown.bold
Or just lumping them together plugin.format.bold?
Use the one that best suits your requirements π
I mean there is no requirements, just asking a question based on what the users would prefer
Specific, but have a parent permissiom which groups the entire thing
As someone who is not a user, I prefer the first
Mine was useful
Was referring to Niall
A parent perm would be nice if possible Matt
Well I mean- A and B both have the same effect? I'd just do C
Someone bonk this man
You might want to only allow markdown for PROFESSIONAL users
True. the PROFESSIONAL users would probably like that extra permission control
I love this capitalisation of KEY POINTS to express your view.
Was thinking maybe like:
plugin.chat
.legacy
.format
.bold
.italic
.strikethrough
.underline
.magic
.color
Was trying to format this xD
But I mean, is there any difference between LEGACY bold and another bold? They both achieve the same thing right? I could see maybe if it was standard colours/hex
Difference is **bold** vs &lbold
even better
plugin.chat
.legacy
.format
.bold
.italic
.strikethrough
.underline
.magic
.color
Hell yeah
so this has me a bit confused and i was wondering if anyone knew why this is the case, basically
if (event.getModifiedType() == PotionEffectType.SLOW){
System.out.println("player would get slow");
} else {
System.out.println("effect isnt " + PotionEffectType.SLOW + ", its " + event.getModifiedType().toString());
}
I have this code that follows after an EntityPotionEffectEvent, where I compare the changed potion effect type to a PotionEffectType enum value. I was always under the impression that enums should be compared using ==, not .equals()
Turns out, if I try to compare the two using == the output when getting a slow is "effect isnt PotionEffectType[2, SLOW], its PotionEffectType[2, SLOW]", so the two enums aren't the same. But if I use .equals() the expected output "player would get slow" shows up. How does this work?
It's an abstract class
oh allright
clash of code?
11pm what u smoking
10:27 pm what you smoking
agreed
00:29 you guys are high
also if its 23 pm what is 23 am?
do you use a 48 hours / day format?
Likely the entity doesn't exist at the time you are trying to spectate it
that sounds like it
OLD
No
=paste
Please use a paste service to share configs, errors, code and long logs.
β’ HelpChat Paste
oh my lord
A lot of issues just to make a 6x7 connect-4 
that doesn't work, mind you
it works trust me
now im going to do the same
but with chess
or even better
roblox
fornite
a[s[ag[ag
I think if every particle in the observable universe were a byte of storage you couldn't store that
its possible
everythings possible if u try hard enough
doubt that
It tries to, but unfortunately can't
yep
Hello, can help me ?
how to set knockback for a damage ?
Apply a velocity to the damaged entity
can give me example code ? i test it and not worked
Show me what you did
@hot hull Ok
pls wait for opening idea
@hot hull
@EventHandler
public void onHit(EntityDamageByEntityEvent e) {
Player target = (Player) e.getEntity();
Player damager = (Player) e.getDamager();
target.setVelocity(damager.getLocation().getDirection().normalize());
}
You're setting the same velocity, multiply it by like 2
target.setVelocity(damager.getLocation().getDirection().normalize().multiply(2));
its work ^^^ ?
Well have you tried it?
i tested it
and not working
pls wait for test by multply 2
@hot hull Wroked
Thx
lol
I'm at school
Weak
bruh I was literally in a class of 2 people I couldn't exactly whip out a laptop
Weak I tell you
ill play if you can find some more people and you want an easy win
I can play now
I'm having a really hard time getting this JArduino working on my board
I was trying if I can hook Minecraft into it
anyone free for some CoC? xD https://www.codingame.com/clashofcode/clash/1479291c75f335db2d50ba169cdbaf33ebb4951
how the hell would I make a 2d map in kotlin? xD
bcz I'm dumb and can't find another solution to this problem
what's the problem
oh it's a coc
0h frosty π₯°
Fefo, I'm taken, otherwise I'd be down π
Blitz, gimme a bit, PC is a slow war machine today
Just submit
@old wyvern, @distant sun, @prisma wave, @obtuse gale
@ocean quartz π
@onyx loom
you got 2:50
can't π¦
@surreal quarry
would love to
Sleeping
ooh this gon be fun
oh god
almost done I think xD
nvm
I fucked up
wait a second
I fucked up
bad
oh nvm
fuck mee
I added 2 instead of 4
kali u ok?
you need to print the number that is in the middle right?
The middle value out of the three numbers yes
no?
Yes Kali..
one of the tests was 3 1 2
yes and it printed 2
say mean pls
Is this what I think it is ??
kotlin
what's that?
Mobile syntax highlighting
oh
π
they made it different for kotlin?
or is it same for java and kotlin
but just on phone?
const test = require("something");```
```java
String test = new String("str)";```
:((
iβll join in a sec if youβre still playing
new String 
hot
Foff
π₯²
What lib should I use? Firmata or JArduino?
brb
are you saying your method looks better
hell nah
println(message.replace("[^A-Za-z]".toRegex(), "").length)
class Solution {
private static final String ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
String message = in.nextLine().replace(" ", "");
for (char c : message.toCharArray()) {
if (!ALPHABET.contains(String.valueOf(c).toUpperCase())) {
message = message.replace(String.valueOf(c), "");
}
}
System.out.println(message.length());
}
}``` lol
It's not about code cleanness, it's about sp33d
this was reverse mode no?
Yea, still speed
i mean you still came in first but
yes
I don't worry about clean code here
I got bored
i just woke up and was being stupid. i was trying to invoke length as a method for a while there
clash of clojure
Whos this WickyPlays?
invite me immediately
My PC lags so the mouse is twitchy so I accidentally opened IJ :c
Hi. Despite my previous request I'm not seeing an invite to any "clash of code" games. Please do so immediately.
Thanks!
75% what
oh right weve started
gotta play all those test cases BM
yes
not meth
its fully a miracle how i passed maths
im so bad at it
n(n + 1) / 2
BM playing?
ok what the fuck?
oh
uh what
Modes: Fastest, Reverse
Why no shortest?
fizzbuzz right?
fuzz bee or smth @surreal quarry ?
yea
yes
Shortest sucks matt
i cant remember what to do tho 
Shortest are the best ones
mult of 5 is foo, mult of 7 is bar, 5 and 7 is foobar
ye ty
gg
I understood the question but
didn't get the answer right
and I ain't got time to test it xd
That's pretty easy
nvm
Since it'll trigger multiple times 4head
Oh ew why the hell did you make it like this
bcz they don't need optimization or anything like that
but whatever
someone try this and tell me why it's not working
val N = input.nextInt()
for (i in 1..N) {
if (i%5==0 && i%7==0) println("FooBar")
if (i%5==0 && i%7!=0) println("Foo")
if (i%5!=0 && i%7==0) println("Bar")
if (i%5!= && i%7!=0) println(i)
}```
val N = input.nextInt()
for (i in 1..N) {
if (i % 5 == 0 && i % 7 == 0) println("FooBar")
else if (i % 5 == 0) println("Foo")
else if (i % 7 == 0) println("Bar")
else println(i)
}
This would've worked
its the same fucking shit.
Look at this geek
if (i % 35 == 0) {
lmfao
@onyx loom u good?
when smh
testing now
foobar!!
fizzbuzz!!
fizzbuzz!!!
lol
can u not have 2 conditions in a when?
like x == 0 || x == 1 -> blah
and fuck you frosty
Add shortest and i'll join
π₯²
forgot to add a 0
lol
That's why you should properly space shit
but in reality I am
you idiot
lol
thats why you should run all test cases
hm
i was struggling with trying to do FooBar, but then i just yoinked james solution of i % 35 == 0 xd
That works yeah
u sure?
i did i % 5 == 0 && i % 7 == 0 and it wasnt doing anything
Kali stop slacking
SHUSH
James share code
playing test cases
and failed
nvm
all working seems like
what is that code Jaimss?
wdym
<= 2 ?
yea blitz it was even/odd
ah ok
I mean
i suck at these character things
These are the best ones Kali
75% of the time it works 100% of the time tbh
The Mountain Tops counting was so far the best one
i dont think i was here for that one
ye I just quit that one as well
75%
slow
im slow, cut me some slack π
I forgot the formula fuck
actually no
I remember now
it was the one I confused
before
when bm
gave it
here
omg
frosty
Goddamn it BLITZ
not if ur java
I was doing all the tests ;C
xD
System.out
Same
what is that formula even for
Join 4head
Sum of integers between 1 and n
(1..n).sum()
(reduce + (range 1 n))
Test 2??
How does one truncate a number?
i got it i think
test1 isn't working for me
println(answer.toString().substringBefore('.')) i just did that lmao
well non that are female
@hot hull round to int
I just get UNKNOWN
Well it's 96 but it has to be 100
oh right yea ur smart bm
Lmfao i tried to cheat it and it didn't work
Cheater.
i thought the 4 test cases were all that you needed
if (G.equals('F'))
Nah James
that was my last one ill be back for more later tho
I'm so confused rn
ignoreCase Blitz?
nah
ibcz
I outputed W
G*
and its F
wait nvm
it doesn't work for M either
You do realize you have to printout the opposite weight right?
A single letter : 'F' for Female, 'M' for Male
fuck me
why did they use ''
nvm
input.next returns a String tho
It makes sense?
Y'all finished?
G.startsWith('F') 
no
You need to round to hundreds
fuck it idc
But I don't know how to do that
test 2 is broken
if (!G.equalsIgnoreCase("F") &&! G.equalsIgnoreCase("M")) {
System.out.println("UNKNOWN");
return;
}
this is necessary?
speedrun time
oh nvm i didnt see the print
smh
I guess you could cheat the system using ```java
(int) (number / 100) * 100
Which would round it to 100
but oh well
I just gave up
BM didn't finsih tho
We'll wait for him
@surreal quarry ?
clojure
(defn -main [& args]
(let [G (read-line)
W (Integer/parseInt (read-line))]
(if (= G "M")
(output (int (/ W 1.2)))
(if (= G "F")
(output (int (* 1.2 W)))
(output "UNKNOWN")))))
``` arrow code 
lisp be like
if m
output int (w / 1.2)
if f
output int (w * 1.2)
else output unknown
ez
what
what
wh at
lol
NEVER MIND
Y'all hella dumb it's easy
it is
I typed 4 instead of 3 and was confused what's wrong..
xD

Clojure
yes
at Solution.main(Unknown Source)
π
Can you fuck off with the emojis

Die

I'm playing some cs:go now
Come on last one
nah
https://twitter.com/discord/status/1332006887148183553 if only i could be best friends with myself π
lol
Kali
ig ur a fat neek bm
smh
We've finished you mean
why is it just u lol
Cause noone wanna play
Wdym 10min
well yea, im slow π
It's a contains check, split and a replace space with nothing
bruh i would've got it within 2 minutes if dynamic typing wasn't a thing
used split-at instead of split π₯²
Noob
another
Another what
clash
Not on pc
why not
Cause icba
Still clashin?
How hard would it be to make a Q&A bot? And what would be the cost.
How do format a double (java) with commas? (obviously becomes a string)
213156765.2347696124 => 213,156,765.2347696124
well first you cast it to a string, then you split it from .
well what I would do then is I'd transform it into a charArray and then I'd go from the end to the start
and just have a result where I'd just add the first 3 numbers then I'd add a comma and so on
StackOverflow is a bless
ye
I was reading some posts as well
to find a better solution
just didn't search using the right keywords I guess
Matt you're a bless π

uwu
@ocean quartz didn't ask for rounding smh
I mean you don't have to round, it just shows an example on how to format the numbers to have the comma
Take solutions according to your problems, not according to the person that asked the question
(.format (new DecimalFormat "#,###") amount)
``` π
ikr
lol
this is what pragmatic code looks like
mostly in clash
still haven't found anything to actually do with it
but yeah
starting to get used to it
I'm starting to write a parser/serialiser of generic binary formats based on this https://kaitai.io/
Kaitai Struct is a formal language for binary format specification that can be compiled into parser code
interesting
I've wanted to implement some type of tcp/udp server since forever
but I hate manually writing packet format encoding/decoding
I want something where I can just plug some spec in and it does the job
well, kinda
I want to go a different path with my implementation (mainly because source (text) code generation is pretty pointless with clojure and because it only generates parsers)
I'll keep the struct language though, it's pretty good and so far the only one I've seen that actually supports rather complex specs
that's the plan, I haven't thought it all out yet though, so there may be some dead ends in kaitai that prevent me from doing it
yes
Currently my only issue with clojure is how vague the errors are
that is indeed very annoying
i was debugging in a clash game for like 10 minutes only to realise i'd passed function args the wrong way around
yeah, errors in clojure are not helpful at all
yeah, I guess it'll get easier with experience
I disagree
I disagree with you disagreeing
wtf dude
My soul is in pain from reading that
IntelliJ has frozen 3 times in the past 15 minutes and I'm losing my mind
Omg mine has been freezing all the time
It's freezing specifically when I try to import something from nms packages
For me it tends to freeze when updating indexes, and it does that way too often
for me its just when typing in kotlins string concatenation things
like when im typing in here
"${lags hwne i type in hjere}"
Also Kotlin code completion has been so slow, ever since 1.4
froze again simply selecting a variable
Nicole, I feel you
IJ also lags like hell when doing anything with Material
is java/kotlin a practical language to have like running on a small computer just to control some smart home things based off another element, or is something like python better for that
kotlin native should be fine
wouldn't use the jvm though
python is generally the preferred language for shit like this afaik
yeah thats what ive heard
is it just for performance reasons and speed and stuff or?
yes
and is python worth learning
well i probs wont so
what small computer is it?
idk yet lol
budget?
I need a number lol
Rob a bank
"not high" is not useful at all
whats the price range around these things lol
probs like 150 or smthn
o
Yeah
what r we looking at
The Raspberry Pi 4 Model B is the latest version of the popular credit card sized computer. Just add a keyboard, mouse,Β HDMI display, power supply, micro SD card with installed Linux Distribution and you'll have a fully fledged computer that can run applications from word processors and spreadsheets to games. As the Ra
Piβs are cheap af
o
yeah they're not as cheap as in uk drew
but cheaper than they used to be
a model 3 b would set you back $100 aud
I can get the same one for about 60usd
wait drew you're british right?
hm
Nah Iβm from Texas lmao
or am I thinking of someone else
as far as I know kotlin/native relies on c interop a lot, so unless you know at least basic C I'm not sure it's a good idea
sorry, my bad
All good
Harry probably?
Prob
idk who harry is
yeah so is my best option getting something that can run java or learning python?
I was thinking of the retrohost guy
Β―\_(γ)_/Β―
I am the retro host guy π
learning pythons probably a better longterm solution but its harder lol
Python is incredibly easy
is it?
looks ugly to me lol
I quit retro host though, decided it wasnβt for me and I wanted to make money by actually working for it
And given you have prior programming knowledge, it's even easier
ah
aj don't go straight to the pi tho
what sort of system were you planning on making?
thats what im tryna work out rn
chances are you can achieve whatever you want with arduinos
yeah true
Consider using rust
vouch for Go
Java runs fine on raspberry pi. Not sure about a full fledged IDE.
feel like ive definitely asked this before but
And horrible
class A{
@OneToMany
val things:MutableList<B>
}
class B{
@ManyToOne
val a:A
}
class C(private val bRepo:BRepo){
fun AHHH(b:B){
bRepo.delete(b)
// What happens to the A`s that contained this b in their lists?
}
}
why is kotlin so ugly
i just typed that in discord its probably got some problems with it lol
the annotations might be the wrong way round as well
Have you ever seen py, pig?
??
I dont like the :
Using yaml idendtation instead of curly brackets doesnt bother you at all?
no
._.
aj makes it ugly by not formatting anything
Cc @heady birch hibernate expert
I was gonna say, but then my discord lagged, and I had to go write an exam (aced it), so smh
Oh I didn't know IJ auto detects what folder to put shit in depending on the group id
That's cool
lol
@kindred hatch another site?
Nah, it's optimisemyserver.com, but a site instead of a paste
5 seconds
Uh how often do you think requests for the same obj be made?
Unless the user is a 4head only once
yeye minutes
halp
yikes
shes still goin
Im beginning to think theres a problem
what in the world
wth are you trying to build
something in android studio
time to invalidate caches/restart i guess???
yes
what plogin...
do it anyway
what should i actually do tho lol
rly?
Yes

