#dev-general
1 messages ยท Page 364 of 1
xD
kotlin should have java/kotlin interop like holyc c/asm interop
that'd be cool
and probably useless
but still cool
The kotlin compiler isn't much smarter than javac, the language just has more features in its spec
^
u can basically just type asm in the middle of ur c
lmao
a gift from the gods
No semicolons, smart casting, decent type inference, compile time constants, the list goes on
Delegated inheritance
lol
Extension and expression function mapping
we should rewrite the linux kernel in holy c
that would be much better
Yeah ik
Those are more of language features
type inference exists in Java as well
The compiler wraps them into utility classes and changes the calls
compile time constants are also handled by javac as well afaik
also kotlin jar size is bigger ๐ but that shouldnt be taken account of lol
final and static primitives
yeah again that's the language, not the compiler
same as kotlin consts
I doubt the compiler does much more on its own than javac
And it doesn't need to
because jvm
are the unsigned primitives really unsigned or just disguised as normal primitives (in kotlin)
mhm
Also, kotlinc can compile to three different formats
The same language, three formats
Also, instanceOf pattern matching exists in java as well
does anyone use js and native
No, it just exists
thought so
having more targets doesn't make it smarter
^
xD
kotis
maybe it does make people hard
it makes bardy hard thats for sure
Mhm
lmao
mushroom
mushroom
mushroom
mush
room
no balls
mushlong
mushort
yea it got no balls
big balls
xD
probably a little microscopic bug
Small pp?
Lmao
idk
Microscopic*
this is some... weird chat
uhm
wtf did I just watch?
You turn my floppy disk into a hard drive...
Are you linux? Because we can mkdirs.
I'll always have cache for you
ind if I run a sniffer to see if your ports are open? ;)
Come to my 127.0.0.1 and Iโll give you sudo access.
Are you CoffeeScript? Because I am looking to drink you out.
My main method is 'public love iLoveYou().'
Want to see my secret plug-in?
Are you a GitHub repository? Because I want to fork you.
You can unzip my files anytime...
Hey, bb, want me to get winrar in here so we can unzip our files ;)
Will you be mybb?
who remembers this
Im confused
lmaooo xD
lol
was this the guy who asked for more pickup lines and asked if these are good enough?
Oh he told that you didnt make it?
yea lol
oh lol
i've seen these before
there was a thread on spigot
it had some of these
years ago
Oh lmao
uve used them in practice havent u pig
yeah the guy was googling developer pickup lines
because his crush was a developer
or something like that
why is that a resource?
there was another pickup line though
smash or pass papi expansion ๐ฅฒ
"Are you a diamond pickaxe? Because Iโm harder than obsidian"
something about wanting to "insert my usb stick into you"
can't remember the exact line
actually heard that one used irl sadly
Im wondering who he picked up with that...
LMAO
:smiling_face_with_3_tears: please
That aint a pickup line, thats a "~~friend ~~ fuck request"
yeah that's like the raw format of it
it was a pickup line
I just can't remember it
xD
wait that's from Glare? lmao
it wasn't actually used to legitimately get a girl
it was just a conversation full of computer related innuendos
its on the papi repo blitz
yea I understand
๐ฅฒ
yeah lmaooo
Is there a way to change the pulling branch in a pr?
If i made a papi expansion, where would i put it (so its public)?
and 69 level
lmao
since i dont think spigot would allow non-plugins
ecloud dkim
i have zoom open so my browser is slow ๐ซ
if ur making an expansion for a plugin just put it inside the jar (if its ur plugin)
Also you can put them on spigot. There's loads of other resources other than plugins. Including expansions. but you can just get cube to put it on the ecloud
or make you an account
cube?
๐
funnycube
Registration is currently locked. If you feel it is necessary to create an account, please join our discord and get in touch with us.
oop
@half harness :p
rip
my CPU 
like me
you mean ? right
1.19 sheesh
it has 8 threads though
no
laptop im guessing?
you need to define T tho
its a I-5, but its pretty nice for a laptop
i5 what gen?
1035G1
cool
that's pretty good
yeah
public <T> T getT(T obj) { return obj; }
```something like this
yes
mine?
generics
no u
yes
do you guys think it's worth it for me to wait for zen 3 laptops to come out and get one of those, or get an intel 11th gen laptop with iris xe graphics
afaik
you pass in some variable with some type T, and it returns the same type (and it's defined in the method header)
K, V 
zen 3
ArrayList<Void>
Void lol
its not
this is literally the whole "Void" class
/*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.lang;
/**
* The {@code Void} class is an uninstantiable placeholder class to hold a
* reference to the {@code Class} object representing the Java keyword
* void.
*
* @author unascribed
* @since JDK1.1
*/
public final
class Void {
/**
* The {@code Class} object representing the pseudo-type corresponding to
* the keyword {@code void}.
*/
@SuppressWarnings("unchecked")
public static final Class<Void> TYPE = (Class<Void>) Class.getPrimitiveClass("void");
/*
* The Void class cannot be instantiated.
*/
private Void() {}
}
lol
why would u
lol
you cant use reflection to access it lol
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
public class JavaTests {
private static Void ELEMENT;
static {
try {
final Constructor<Void> CONSTRUCTOR = Void.class.getDeclaredConstructor();
ELEMENT = CONSTRUCTOR.newInstance();
} catch (final NoSuchMethodException
| IllegalAccessException
| InstantiationException
| InvocationTargetException e) {
e.printStackTrace();
}
}
public static void main(final String[] args) {
final List<Void> voidList = new ArrayList<>();
voidList.add(ELEMENT);
}
}
java.lang.IllegalAccessException: Class com.github.pulsebeat02.minecraftmedialibrary.test.java.JavaTests can not access a member of class java.lang.Void with modifiers "private"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
at java.lang.reflect.Constructor.newInstance(Constructor.java:413)
at com.github.pulsebeat02.minecraftmedialibrary.test.java.JavaTests.<clinit>(JavaTests.java:28)
whaaaaaaaaaaaaaaaaaaaat
you'd need to set it to be accessible first
ooooo
oh wait
lol
Depending on the version this may or may not work
i forgot that
lol
oh shit
it works for java 8
lmao
though for higher versions
when they enforced encapsulation
i would be worried
java 8 ftw
||im still confused||
still works with unsafe definitely
jshell> unsafe.allocateInstance(Void.class)
$6 ==> java.lang.Void@3e6fa38a```
oh lmao
ya know
algorythm graph thingies
ya know
imagine using discord's default layout
compact gang
"decent type inference" F# has type inference for pretty much everything
hint hint
[JavaPlugin^ this]
``` iirc
Me neither
Yes, ^ is the symbol to attach meta to an object
ive been busy setting up macos in kvm
i mean
nothing
nope
im not using qemu
not at all
macos?
we are all law abiding citizens here officer
i am not happy that i bought a processor with an iGPU cause i can pass it thru
that isnt happening
because i am not emulating a mac
Oh and java has type inference too. You're describing language features not a "smarter compiler*
what
i am not happy that i bought a processor with an iGPU cause i can pass it thru
that isnt happening
you can you can pass it thru
you say you're not happy about it
but then you say it isn't happening
so you are happy about it?
what language is that
horrible language
is that even a lang
man
i only know one phrase from another language, japanese
ore wa ochinchin ga daisuki nandayo
welsh ๐คข
and it's not even in japenese chars
sadge
weeb
Omae wa mou shindeiru. Nani?
i bet bm agrees with me tho
@old wyvern I think that actually makes sense
wdym?
oh xD
Agrees with what
shut it sheep shagger
shut it
yeah that's not a good translation

What does it actually mean?
because I really, really love pee pee
lol
๐ณ
speak english
no
wales contributes nothing to society
chinchin is like childish slang for penis in japanese
Apart from being inbred
man
I see
ore wa is a masculine introduction, like a manly way of introducing yourself
genocide
yes
and I believe the nandayo is what introduces the "because", but I don't actually know japanese
so yeah
he's no simon
he's more than simon could ever be
ore wa piggeh pigletto, Hito ใ !, Watashi o osoreru
simon peyton jones u cretin
one of your chars didn't translate
Simon Peyton-Jones
xD
Which?
yours
"The pioneer"?
no
when you see a monad
the japanese one
oh
sorry when I described ore wa
wtf is that picture
Probably doesnt mean anything, was trying for an anime like introduction xD
but imagine you're saying it with batman voice
it's Simon when he sees something with monadic properties, or in other words, a monad
Man can't get a good picture of himself
whos simon
simon
did he create haskell
simon is the god of monads
xD
Mostly
Churchill College's annual Computer Science lecture.
In this talk Simon discusses Haskellโs birth and evolution, including some of the research and engineering challenges he faced in design and implementation. Focusing particularly on the ideas that have turned out, in retrospect, to be most important and influential, as well as sketching some...
wisest man on earth
truely
fixed him
oh god
thanks dkim
thanks dkim
that play button really adds a lot
oh no
np
np
simon went to cambridge ๐ฉ
sadge
shoulda gone to icl
the same uni that EVIL Alan Turing went to ๐ซ
lol
cambridge does have one of the oldest CS departments in the world
but man
why would u go to the south east
and not go to london
thats just dumb
there is nothing else in the south east
Since when is cambridge in the south east
uh
was thinking same
it's like central east
meh england is just north or london
It's further north than london lol
"south east"
north or london
u nerd
south east
Cursed
Even more cursed
cambridge is in the south east
south east is south of norwich and east of sheffield
ok sorry mr "i live in an irrelevant place called wales"
shut
classic donald trump
wtf lmao
what the actual fuck
XD
๐
don't
xD
please don't
wales deserves to be misspelled
okay unglund
wails
lol
no we don't ๐
"the commonwealth"

stole america's language
nerds
gn
pfffft
because welsh people aren't smart enough to be independent
๐
I wake up and first thing i see is this ..
I'm going back to sleep
scotland Independence tho ๐คฃ
k lets not get into politics man
๐
it will get you in your sleep
dw
why not
^
go on
go on
cymru am byth
nag ydw
those are made up words
welsh is older than english
speak an actual language

slepqlqnif qpalqlslwq asowoysyt
who got invaded by the romans first, hm?
are we talking iterations of english too?
'iterations' pfft
Why does the UK still has royalty? Didn't y'all learn from the French that you have to cut their heads off?
bretonic
because welsh looks like a very first form of english, just jumbled up letters
yes
we're working on it
welsh became more english-like when we were invaded
sadge
Unfortunately our royals don't starve us so we don't really have an excuse for a revolution
good
welsh cakes wtf are them? what ur mom bakes when ur 5?
hello son were gonna make some cakes today, get the flour!
welsh cakes are like scones but better
highly debatable
they can't be better if they have welsh in the name
Not to get political but
good song ngl
Tell me whyyy
tell me whyyy
๐คจ
?
what
disgraceful behaviour @prisma wave
๐
sir what is ur internet protocol address
lol
can't be asked to add this one to bungee
WTF
poor wiki
Saves me a lot of effort
1 click to host docker image
make your own docker image with your own config ๐ง
James gosling roll
plugins {
kotlin("jvm") version "1.4.31"
}
group = "me.senseiju"
version = "0.0.1"
repositories {
mavenCentral()
}
subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
dependencies {
implementation(kotlin("stdlib-jdk8"))
}
}
Cannot resolve external dependency org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.31 because no repositories are defined.
the repo is there
move repo block into subprojects block
same thing :/
plugins {
kotlin("jvm") version "1.4.31"
}
group = "me.senseiju"
version = "0.0.1"
subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
}
}
move it out
Cannot resolve external dependency org.jetbrains.kotlin:kotlin-stdlib:1.4.31 because no repositories are defined.
yes
iirc u need the repo in both subprojects and base
what happens if u use allprojects instead of subprojects
allprojects
good choice
does it matter much except for that
no
gucci
You got net.minecraft.servered?
๐
it got deleted
from the bot
why is your teacher so mean
lmao
and what are they teaching you abt in general
If this cunt knows there's a semi colon missing why doesn't it just add it itself!
this would not be a problem in kotlin!
stfu
sorry
When the framework forces you not to make mistakes and be a dumbass
@onyx loom hop on I need more hulp
or Ivan if you got time
i can hop on sure
yes
let top_index = -1
let top_val = -1
let cur_index = 0
replicateM 8 $ do
input_line <- getLine
let mountainh = read input_line :: Int
let myIf top_index = if top_val < mountainh
then cur_index
else top_index
let myOtherIf top_val = if top_val < mountainh
then mountainh
else top_val
let cur_index = cur_index + 1
return ()
print top_index -- always prints -1
yis
Do you still have the original problem or has it ended
i still have it
At the start of each game turn, you are given the height of the 8 mountains from left to right.
By the end of the game turn, you must fire on the highest mountain by outputting its index (from 0 to 7).
Firing on a mountain will only destroy part of it, reducing its height. Your ship descends after each pass.
ooh where's that problem from
I waiting
booting up ๐
i'm in
so if i can't change the value of my int variables
do i need to use like a class or whatever haskell has instead
It's best to not think of them as "variables", since they can't ever change
sure
is this a situation for one of those fancy pants monads
not that i know what those are
A little bit
You'll need monads to get the user input
The issue you're having is you're thinking about the problem in the wrong way
I can't really put it into words so I'll just describe how I would do it
okay
Are you familiar with map and filter?
yes
i've seen it in luckperms and tried using it once or twice, but i'm definitely not confident in my understanding of it
It's really simple, filter filters out items for a given condition, and map maps the items to a given thingy
map takes a wrapper value, applies a function on the value and returns the another wrapped value
Filter similarly, but keeps only the ones that satisfy a given condition
๐ฎ
so do I have to put the entirety of the user input code inside of a stream
or something
Well no
Its not a stream
But rather you use getLine which returns a a generic IO value
The stream API is strongly based off of FP
You then either use bind on what or use the shorthand in a do block
Basically you are providing it a combined function that should be applied on the input to bring it down to your use case
No no
You dont need a list
Map is more generic
.
Wrapped* btw
i guess where i'm confused right now is
when exactly do i ask for user input
relative to when i'm using map
getLine
like do i get all 8 values first, then pass those into map
or do i ask for each value within the function i call in map
though i guess that second one doesnt make sense
replicateM actually collects all of the values into a list for you
ah so i'd be working with the list returned by replicateM
and i dont want any extra code inside of it itself
So you can do ```hs
inputList <- replicateM 8 $ do
line <- getLine
getLine :: Int
That should give you every input as an int
In a [Int]
where?
Instead of the let binding
inputList <- replicateM 8 (getLine :: IO Int)
Even better
So then you can just find the max element in the list with maximum, and then elemIndex to get the index of that maximum value
Easy
so with this default code
replicateM 8 $ do
input_line <- getLine
let mountainh = read input_line :: Int
return ()
do i change the return statement to (mountainh) to get replicateM to return a list
Return isn't a statement ๐
Mhm
But yeah you can do return mountainh and it should mean replicateM gives an IO [Int]
what's the correct term
return converts the given value to an IO value
i see
It turns a normal value into a monadic value
wot
The constraint
what are the differences between IO [Int] and just an int
That onr allows for both the IO monad and Maybe I think
Maybe even more
Not sure what the constraint ensures
[Int] is a pure list of integers
what does IO mean, and what do the square brackets mean
Square brackets = list
IO T represents a side effect that returns a T when completed
ah so [Int] is the equivalent to an int[] array in java
It's kind of like a Future
A mix of int[] and List<Integer> yeah
i see
So IO String isn't a string, it's an IO action that would give you a String when completed
pretty much yeah
Because user input obviously isn't pure, but we can make it pure with some monad magic
i guess this means i have to figure out the stream api in haskell
It's just the standard library in Haskell
Literally everything in FP is based around map and filter and reduce / fold
(well almost everything)
map (+ 1) [1..10] gives [2..11]
You'll need a $ or () in between the 2 map calls but yes
ah
as a lisp user
lol
even clojure has a similar thing
The ->> macro is much cleaner than chaining map and filters the usual way
((((((no))))))
(defun yes)
oo
how would ->> look for our [3..13] example
defun bceause everyone knows clojure bad and removes the fun
aw
clojure in emacs :)))
emacs is written in lisp
emacs config is done in a lisp
so take that
(->> (range 1 10)
(map #(+ 1 %))
(map #(+ 1 %)))
``` this is the rough equivalent I think
but nobody sane would actually write that
too many parentheses
because it could just be (range 3 12)
not enough parentheses ngl
fair
[1..10]
|> List.map (+1)
|> List.map (+1)
``` just for good measure
is that F#
๐คค
Yes
sexy
very sexy
whats the # here
lambdas
basically it from kotlin
ah k
In this particular case you'd use inc but yeah
yeah
Yup
that's actually nifty
what makes it partial
Because you're not supplying all of the arguments to the + function
You're only supplying the first one, so you get a function as the returned value instead of a number
Not sure assume is the right word
It just returns a new function
Yup
interesting
The fancy term for that is a higher order function
And haskell does this for everything by default
add a b = a + b
The signature of add is Int -> Int -> Int
I.e, it's a function that takes an int and returns a function that takes an int and returns an int
ooo
so that's how you'd sort of get around only being able to have one param per function
it looks good enough because function application is just name arg
would haskell do this automatically for you for any function you write
so foo bar baz => (foo bar) baz
Yep
I never though of it like that, that's pretty cool
still good practice to specify the signatures explicitly I've heard
yeah for anything that isn't very simple I think you're supposed to write the signatures
but inference is still insane
it looks at the way you use your parameter and tries to find a matching type
yeah the inference is crazy
Although when you're new writing the signature sometimes helps you get more descriptive errors
Since if you messed up the function body, it might infer the parameters to something else, moving any error to the call site
Lint warns you if you dont specify type signature explicitly for top level functions
should i have an annotation called "LegacyApi"
I think that's called "Deprecated"
^
nono
its a special annotation where it stores like the removal date
the date it should be added
papi has one similar
i think
what?
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
Its a bit different
but you know
Yeah that's jetbrains annotations
And the deprecated annotation has a variable for "scheduled for removal" or something
it does?
oh
uh wot
it doesnt
lmao
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(value={CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE})
public @interface Deprecated {
}
lmao
just use the ApiStatus one then
no point creating another annotation if one already exists in jetbrains
it says that isnt an annotation and idk why
Or just deprecate + javadocs
java 11
I have that bookmarked
Not the annotation
The Java 11 docs
Ah, since java 9 anyway lol
pain
paper 1.17 had better hurry up
java 8 be gone
about time
java 11 be gone
Shame the timing doesn't sync up with java 17 being released
Since that's the next LTS
And making plugins on java 17 would actually be amazing
Mojang better do, they been preparing for updating the bundled Java version
I wonder what they'll put in jdk 17
with records instanceof pattern matching and switch expressions finally in the release, this could be a well-rounded version for once
Valhalla ๐ฅฒ
COPIUM they will finish it
I will actually die if they do
Valhalla and Loom coming in 6 months time ๐ณ
dont die!
no
was just looking at some things about potion effects, and this person was told to google it, and called it toxic, lol
fr though telling someone to look something up is fine if you can actually find a good and precise explanation for it, but "go test it" is just so stupid
I don't want to test and try to reverse engineer every spigot method with bad documentation
well asking what opaque means is stupid
you can google that
its not got anything to do with even spigot
Check some of StackOverflow's replies, they'll eat you alive
my stackoverflow account was disabled for like 30d because I asked a "bad" question or something, even though I would spend about 30 minutes researching before asking
there was no question about the meaning of opaque before they called the previous answer toxic
?tryandsee ๐ฅฒ
try it and see is justified if you already have something and you're asking if it will work
it's not a very efficient research method if you have a lot of different things
if you have a lot of things, then you need to test a lot of things..
its pretty darn easy to test it with opaque and with non-opaque particles or whatever it may be
you are still more likely to get better insight from others because there is a lot you can miss or do wrong when you just try and guess what it does.
stackoverflow is super strict