#dev-general
1 messages · Page 136 of 1
Dude, I'm on 2018.3 
Maybe it was trying to tell me about the bug in the placeholders 😂
IJ does sometimes not open for me and get stuck sometimes, but its pretty rare
im on 2020.1.1
Yeah I reverted and all the problems stopped.
ah
nice screenshot
^
why the fuck it sideways
What is this 2010 :kek:
That’s how tf I take photos
fuckin wierdo
The motion doesn’t look as weird irl
Like cos my phones in my hands on my desk so I just tilltrd it up slightly
Also
Only 7 months ago this was...
not enough clojure 
Oh god that cast
not enough clojure
@prisma wave NO
lots of ClassCastExceptions because no static typing 😬
¯_(ツ)_/¯
yeah sure you can make plugins with clojure but it's terrible
lol
on the topic, how would you apply map to each list created by partition?
Could you give an example?
like ((1 2 3) (4 5 6)) => ((1 4 9) (16 25 36))
justed nested maps I'd say
(map (partial map square) (partition 3 nums))
Pc being slow, will send code in a sec
basically, i'm trying to solve this https://projecteuler.net/problem=8 - I've partitioned the list, now trying to use reduce to get the product of all the elements
A website dedicated to the fascinating world of mathematics and programming
but of the partitioned elements
not the actual elements
it's quite difficult to do functionally lol
Well partitioning alone won't get you far will it?
Since 3 adjacent numbers in 123456 could be 123 or 234 or 345...
not just 123 and 456
I'm using a step of 1
which seems to achieve that
splits it into 123, 234, 345, etc
ah all right
🤢
Yeah I tend to forget that it has that param
shush you
Pretty nice
it is
God I love: IntelliJ is not responding
so yeah, from there I imagined I could just do like (map #(reduce * %) (partition blah)))
i cant say ive ever had that frosty
yeah right but that doesn't give you the digits
i must be missing out by the sounds of it 
I'm not sure tbh. The process makes sense in my head, I think I've just implemented it wrong
lemme send some code
(defn -main [& args]
(let [arg-list (map #(Character/getNumericValue %) (apply concat args))]
(let [max-prod (map #(reduce * %) (partition 13 1 arg-list))]
(println max-prod))))```
however the outputted sequence has loads of zeros
make it kotlin, then find on an online converter website to clojure 
just a side note: you can have multiple bindings in one let
What do you expect as the output? currently it should be a flat sequence of numbers
it is
many of which will be zero since any multiplication with 0 = 0
...
oh yeah
lmao
I am quite possibly an idiot
ok second question, why does max do nothing? it doesn't seem to change the value of the output at all
(let [max-prod (max (map #(reduce * %) (partition 13 1 arg-list)))]
How are you liking clojure?
Or apply, output will be the same. But reduce is safer because it doesn't unwrap the entire thing (which can be problematic for large sequences)
depends
I mean you can try such things quite easily with the time macro (although you won't necessarily get meaningful results because of jit and jvm warmup and so on)
I would prefer reduce in that case because it is more expressive here imo
I see
Btw if you are looking how to actually return the digits, not just the product, you may want to look at max-key
Well the question was for the product, but that might be useful in future
How are you liking clojure?
i would also like to know this answer
you get used to it
I'm starting to figure out what it all means and it's actually quite elegant
everything is a list
I still prefer postfix (?) syntax rn, since it reads more naturally list.map instead of (map list) and isn't backwards
Everything is a fucking bracket mate
but it makes sense
function calling is just a list with the function name and arguments

that is not surprising
lemme try convert that to kotlin
1400 brackets
I doubt that you'd have a lot less parens in java
brackets 🙂
function calling is just a list with the function name and arguments
Wait what?
38 according to IJ
to call a function, it's just a list
(function-name function-args)
thats dumb
thats a list?
even dumber
if its a list it should be 1, 2, 3 not 1 2 3
bruh
just with [1, 2, 3] (although only for annotations)
so each statement in a function is a separate argument to it?
if you want to put commas there you can
yeah I think so
fun main(args: Array<String>) {
val argList = args.joinToString("").map(Character::getNumericValue)
val maxProduct = argList.partition(13, 1)
.map {
it.reduce { a, b -> a * b }
}.max()
println(maxProduct)
}
``` I'm pretty sure that's the same code in kotlin
I don't think such a partition function exists
You'd probably use iterate or something
windowed might work
ah yeah that looks like the equivalent
yeah that works
fun main(args: Array<String>) {
val argList = args.joinToString("").map(Character::getNumericValue)
val maxProduct = argList.windowed(13, 1)
.map {
it.reduce { a, b -> a * b }
}.max()
println(maxProduct)
}
kinda gross though
I bet you'd need more parens in Java than in clojure
Why is ur name Clojure @prisma wave
Never heard of it 
it's the future of programming
another jvm language
yes
it's the future of programming
mfw lisp has existed for decades but hasn't seen any commercial recognition like other languages
shit's 14 years older than C
I bet you'd need more parens in Java than in clojure
@lunar cypress
You lose?
dont give him ideas 😬
Show me
r/clojurememes >:)
I'm trying to implement it in java right now, just getting Stream#partition is painful
hold on
(defn max-13-adj [& args]
(let [arg-list (map #(Character/getNumericValue %) (apply concat args))]
(let [max-prod (reduce max (map #(reduce * %) (partition 13 1 arg-list)))]
(println max-prod))))```
38 parens
can be reduced
probably
reduce it
Now read that code
doing this functionally in java is painful
I already want to tear my hair out
just trying to implement partition
that just sounds like java anyway 🙂
true lol
(let [arg-list (map #(Character/getNumericValue %) (apply concat *command-line-args*))
max-prod (reduce max (map #(reduce * %) (partition 13 1 arg-list)))]
(println max-prod))
imperatively it wouldn't be so bad
public static void main(String[] args)
{
var argList = String.join("", args)
.chars()
.map(Character::getNumericValue)
.boxed()
.collect(toList());
int max = 0;
for (int i = 0; i < argList.size() - 13; i++)
{
var partition = argList.subList(i, i + 13);
var product = partition.stream().mapToInt(Integer::intValue)
.reduce((a, b) -> a * b)
.orElse(0);
if (product > max)
{
max = product;
}
}
System.out.println(max);
}``` here's an implementation of the same thing in Java
semi-functionally
yeah but if your imperative code ends up being much more complex the argument is kinda pointless
I just fucked my project lol - I moved directory and then moved it back and that was enough to break everything
> Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). The current version is Gradle 6.1 and I had to remark the sources file lol
how would one update gradle wrapper
I mean the point is - yes, overall clojure uses a higher rate of parens than Java or others since it doesn't treat anything special (you use everything like a function). But individually, those parens are just placed differently and in absolute terms you will most likely still have less of them because clojure code tends to be much much smaller than java code
using kotlin gradle dsl thing btw as well
@lunar cypress An idiomatic equivalent of 3 nested for loops would be something like range right?
eg if I wanted to loop between 1 and 20 3 times
Therefore, clojure good kotlin bad
Whats happened to you senpai?
I have seen the light
doseq if you want to do it for side effects
for if you want list comprehension
just multiplication
Kotlin will always be the light 😭
alright
basically I wanna find the 3 numbers that multiply to make a certain number. would some sort of filter be a good idea?
im disappointed
You could indeed use for for this
he converts everyone to kotlin, now hes converting to clojure 😭
Time to switch to clojure?
yes
smh
times are changing
Every time I look at it, I want to spoon my eyes out, so I'm good thanks 
same
ye but now is fr
im not going to clojure
But I really mean it for clojure
sorry
I promise you i'll get at least 1 person to use it
I'm playing with something cool rn
is it clojure?
It's Java :kek:
😦
I'm not about to convert 60 classes sorry..
java bad kotlin good clojure bad
no

¯\_(ツ)_/¯
Java bad
Now to figure out where the issue is lmao
recursive type
Do you know why Clojure is bad?
Clojure is relatively new. There are not a lot of online educational resources as there are for Java, much less free ones.
You could say the same thing for Lua, CoffeeScript and other new languages.
Clojure is based on Lisp, one of the list p...
great video
@lunar cypress so 3 nested fors? or should I be flattening them into a list or something?
no, for is much more powerful
(let [r (range 200)]
(first
(for [x r y r z r
:let [prod (* x y z)]
:when (= num prod)]
[x y z])
It basically does the nesting for you
In the bindings vector you can nest over an arbitrary amount of sequences
In this case, r is an infinite sequence of all positive integers
@remote goblet ezClaps
java.lang.StackOverflowError: null
wait actually this doesn'T work with infinite sequences lmao
otherwise the inner most will never finish
but with some bound it will behave like nesting 3 layers
How would one find the issue that's causing this?
look for types that recursively reference themselves or each other
Any easy way of debugging it?
https://www.youtube.com/watch?v=kTu6f_epqf8
@obtuse gale lmao this is a bunch of nonsense
Do you know why Clojure is bad?
Clojure is relatively new. There are not a lot of online educational resources as there are for Java, much less free ones.
You could say the same thing for Lua, CoffeeScript and other new languages.
Clojure is based on Lisp, one of the list p...
the person who wrote this has no idea what they're talking about
0:29
its shared state immutability is intended to support concurrency but hasn't had a large track record without major errors
tf is he talking about
Any easy way of debugging it?
0:29
@old wyvern that's simply not true. It may be true for Common Lisp, but definitely not for clojure
anyone who has ever interacted with the Clojure community knows this

Over half of the arguments are purely economic anyway
They sometimes even contradict each other
that's simply not true. It may be true for Common Lisp, but definitely not for clojure
@lunar cypress
jk
Tough talk for a fella within crusading distance
They sometimes even contradict each other
like acknowledging that it runs on the JVM and therefore inherits the entire ecosystem but then going on with "it is horrible in terms of code libraries"
what does crusading distance mean?
Whats the cost difference between initializing say a double[2] vs a Point { double x, double y }
inline class 😎
although i think that only works for 1 parameter
wait
wrong language
just use clojure
@lunar cypress for will return a list/sequence right?
no
i am still a kotlin user
but I have accepted that clojure is objectively better
You said kotlin bad 😢
Can you spot the error 
your error is not using clojure
that resolution
Aj, it's a zoomed in photo of VSC, fuck u want
smh
(defn -main [& _]
(let [r (range 1 200)]
(println (filter #(= 1000 %) (reduce + (for [x r y r z r
:let [prod (+ (* x x) (* y y))]
:when (= (* z z) prod)]
[x y z]))))))``` why is this not working 😦
class clojure.lang.PersistentVector cannot be cast to class java.lang.Number
because its not kotlin
Lol
I hope its just a phase
Formatting
All of you are bad, there is no one language to rule them all
the good thing about clojure is that you have an excuse for writing arrow code
rust 🙂
@lunar cypress
forwill return a list/sequence right?
@prisma wave yeah, lazy sequence
right
so any idea what's going wrong?
the for would return a list of vector [x y z] right?
so perhaps I just need to use map?
Get back to you when I'm done with my pizza
😆
Johny, debugging this is a bitch, but I'm getting close to finding the culprite 
isn't there some sort of debug logging?
that prints exactly what it's serializing or something
Do you know what class you are deserializing?
return Bukkit.getUnsafe().loadAdvancement(id, json) != null;
This is the whore that's causing the issue
Time to figure out why
I see
(I've legit just followed the method calls debugging each one :p)
Atleast they've described it properly lmao
I shouldn't have picked extra cheese man
@prisma wave what exactly is your goal? You get the exception because + is called on the vectors in the sequence
Execution failed for task ':dokka'.
> Guice provision errors:```
when trying to generate dokka
```gradle
dokka {
outputFormat = 'javadoc'
outputDirectory = "$projectDir/docs"
subProjects = ["bukkit", "bungee", "common"]
configuration {
sourceLink {
url = "https://github.com/Jaimss/mcutils"
}
// spigot
externalDocumentationLink {
url = new URL("https://hub.spigotmc.org/javadocs/spigot/")
packageListUrl = new URL("https://hub.spigotmc.org/javadocs/spigot/package-list/")
}
}
}```
yeah dokka is a pain
also using javadoc format will produce documentation as if what you're writing is Java code rather than Kotlin code
try using html
or markdown might work too I think
or if you're not using Kotlin, use the javadoc plugin
Anyone got any clue of what the next method replacing this is?
Bukkit#getUnsafe()#loadAdvancement(id, json)
is this another one of those @Deprecated Bukkit methods that just haven't been documented to say what their replacement is?
Yup
what's it's usage?
It loads an advancement from a file
yeah no clue sorry
fucking md_5 man
does this guy not know what @deprecated (the javadoc tag used for saying why something is deprecated) is for?
It's funny cause, everytime I call that method it's a stackoverflow 
I get that it's in the unsafe category, but damn
Interesting
@steel heart to the rescue 
@jovial warren there's no @since in the entire bukkit / spigot code ..
In all honesty Gaby, are you even surprised lmaO
Nah
@distant sun true
I mean, it's md_5, what do you expect?
this is the same guy who'd be happy to sell the Spigot project if he was given enough money
the same guy who if he didn't have to have it open-source, wouldn't
Bruh
he literally doesn't let anyone contribute
like that's why it took so long for 1.16 to come out
because he was working on his own, and went to bed at the end of the day
and because he doesn't really care all that much
this is the same guy who'd be happy to sell the Spigot project if he was given enough money
Source?
sauce*
^
@lunar cypress sorry for late response. I'm trying to find pythagorean triplets for which a + b + c = 1000 for this https://projecteuler.net/problem=9
So for this code, I need to calculate a ^ 2 + b ^ 2 and compare it to c ^ 2
then with all the values where a^2 + b^2 = c^2, I need to check a + b + c = 1000 (which I'm attempting to do with (reduce +) (since the for should return something like ((3 4 5) (5 12 13))
obviously something has gone horribly wrong, I'm just not quite sure where. Any idea?
A website dedicated to the fascinating world of mathematics and programming
Still waiting for that fundme so we can gather 1mil, and the paper team would document world gen 
@lunar cypress nvm, fixed it I think
hot
Nice 
@prisma wave I think I actually implemented that once too
you probably did it a lot better than me lol
imagine frosty
(defn -main [& _]
(let [r (range 1 450)]
(println (reduce * (first (filter (fn [triplet] (= (reduce + triplet) 1000)) (for [a r b r c r
:let [prod (+ (* a a) (* b b))]
:when (= (* c c) prod)]
[a b c])))))))
😎
Wait no confused it with this
Given a positive integer n, find the smallest number of squared integers which sum to n.
For example, given n = 13, return 2 since 13 = 3² + 2² = 9 + 4.
Given n = 27, return 3 since 27 = 3² + 3² + 3² = 9 + 9 + 9.
disgusting
Nah that was a daily coding problem
ah ok
any way I can clean up mine?
apart from just spacing it a bit better
it could probably be less than 450 too
My eyes burn looking at that
you're just not worthy
ur not worthy
Shut up, go buy spigot and make it not shit
that means dont write it in clojure either
damn it
lol
you read my mind
kotlin allowed 
hm
altho kotlin looks spicy 
that seems like a good compromise
Kotlin mc server wen
But honestly, imagine if it was rewritten in kotlin
(with a actually non shit api)
which is great
anyone in for a ideathon?
and you can't move
Yugi, what's that?
ive got a kotlin prototype with a few friends, closdd source though
🤔
but is it hardcoded to your UUID because you can't be bothered to do authentication?
i don't think so
clash of code 😮
Basically we have to ideate and design something for a integrated payments thing
they give us access to their sample APIs
😦
sec, wait for my buildtools to finish
I'm running on like 1gb of ram rn
sec, let me have a piss
Languages: false 
and turn my pc on
I like the sound of that
First round is ideation lol
Hell nah Yugi
😆
although the actual thing you have to design sounds pretty boring
That cat
Yea, but just thinking about doing it for the resume 😪
is the cutest thing you've ever seen Frosty?
For minecraft?
Im confused? xD
What exactly do you want me to make
Even if I do try to make a something like that, its going to be almost impossible to compete with what spigot has established rn
Not the point
The point is having a large ass well thought out project, which you can use in your resume
(Even if the resume is being used outside of MC)
ok what we doing boys
People who Hire ussually have no idea about this shit
they jsut care about the results
Kali, still loading 
jesus christ
So if I make something good but no one uses it, its still a failed attempt
Fast autism nodding Kali, that's what we're doing
why dont u just download the paper jar from their website 
Yes, but on my resume thats still nothing + to add except an extra project
If the user is looking at your skills, he'll still see api design/code style
UX?
User Experience
😐
I mean yea, anyone can copy from stack overflow
@hot hull
What does that have to do with this? xD
just copy code throughout ur coding experience 
10 years of copying from stack overflow 
I mean if the user doesn't look at your previous project closely, how will they know your experience
Even if they give you a project to make, you can still just copy like 90% of it from other sources
As I said, they will look into projects, but most likely not into the actual mode, its better if you have something they can readily use
People who hire you are most probably NOT developers
They have no idea
Well then just have a bunch of projects which look nice but don't do shit lmao
@prisma wave what's your result?
just to see if I got this correct before I suggest changes
Ok i'm ready Kali
whats on the agenda then
31875000
clash
ok great got that too
👍
so there are a couple of improvements you can make
idk how to create a private
smh
i will do?
go for it

You scroll down Kali
man why is ur pfp so stretches
so for instance, there is no need to have a layer for c, since that can be calculated from a and b
WAIT WHAT
ahahaha
ARE U OK
i'll make a new one
@hot hull LKEAVE
You litle scam
im in
😏
additionally, since a < b (or b < a, doesn't matter since the order doesn't), the range for for b can be capped at a
johnny u joining?
@lunar cypress I did consider that, just wasn't sure how to implement it lol
start bm
ok
next round maybe
aight
👍
Time to not use kotlin 
whats a harshad number
your filter can be made part of the for bindings as well, and the for can return (* a b c) directly
(for [a (range)
b (range a)
:let [c (Math/sqrt (+ (* a a) (* b b)))]
:when (== 1000 (+ a b c))]
(int (* a b c)))
```here's my solution
A Harshad number is an integer that is divisible by the sum of its own digits.
For example, 1729 is a Harshad number because 1 + 7 + 2 + 9 = 19 and 1729 = 19 × 91.```
ye just googled
it literally said it
important to note is the == there. That's basically "compare numbers disregarding type difference"
(wouldn't work otherwise, since sqrt returns a double)
I see
This stupid ass tab completion holy shit
nice
Although I guess you could just say 1000.0
either is fine I guess
This solution probably won't work for any number because of precision issues but with a better sqrt function this should be no issue either
My solution is great
Positively the most pythonlike python I've written in a while
BM is there a way around this? https://discordapp.com/channels/164280494874165248/695431668944732270/735807405945913344
@prisma wave its happening
I have a weird test case
@topaz bay what's happening
My life is 100x better now
ofc
Holy hell
Im rewriting the download code
Wouldnt 1540 be true?
for the ecloud?
mhmm
o-O
"failed to downloading"
lol
Did u nick that from PDM?
that looks very familar
But yes, the general structure is from PDM
WHAT
LOL
what's wrong with mine?
lol
Y u need a map kali?
Yours is janky
Also what code did you get for 0%?
how so?
/shrug
ohk
You download to a byte array, and then write to the file
I'm to dumb to solve this
Frosty
When you should just be doing a straight up system transfer
Do it in python
oh yeah good point
ez
Your way can have both memory, and computation restraints
Whereas channel transfer legit go straight from the source to the file
zero allocation on some systems
katsu, I've never used python 
yeah I'll change that
katsu share code
Mine's not the smartest but it works 100%
probably an integer division thing
I see what I did wrong
you should probably have been using %
:/
again 
Atleast I wasn't last 
☹️

shouldve put the code that i had
another???
Show us it
Yes KM
splendid
i put it to an array and thats about it 
CLASH
Programming languages allowed: Bash, C, C#, C++, Clojure, D, Dart, F#, Go, Groovy, Haskell, Java, Javascript, Kotlin, Lua, ObjectiveC, OCaml, Pascal, Perl, PHP, Python3, Ruby, Rust, Scala, Swift, TypeScript, VB.NET
🍉
which did you disable?
Didnt disable anything
oh lol
😂
Clojure 
you could've just selected none and it would allow all
cya kiddos
yep
if you tick none of them
I had java + kotlin from the other hcc day
ah yes
o u disabled the character count thing
😦
so whoever gets least wins mode
this is an interesting one
ive no clue
lmao
UYUGI
XD
what is it
This boi already got it smh
That is the most shit
im so confused what its asking
bruh litrally look at output
HOW YUGI
nvm it's easy
||REMINDER||
😐
||REMAINDER*||
damn u km xD
:)
zyy
nice
Why does this jolly person have developer in their name
i was so confused lmao
👀
This autocomplete is nice btw
because hes developer !!!
Just you left Frosty
😂
Didn't Cube rename him cos his name starts with !
its just a operator boi
java bad
Why does this jolly person have developer in their name
@old wyvern because someone set my nickname as that
java very bad
ah
if i got it, its easy
😦
What was the answer?
did u not know what it was asking?
it was just modulo
I see
N2 % N1
literally second % first
shouldve opened the spoilerrs smh
Fockin cheaters
join frost
I know what's it's asking, but not sure how to make it 
don't take my code as inspiration for this one
lmao
a bit rusty in clash of code currently
it doesn't even compile 😦
@prisma wave do you just never remove from the downloads in progress map?
uh what 😕
Oh what 80%
Oh
was last testcase
fair enough
Way to go website, splendid
Capital I frost
I know, but wHy
The tester just compares directly I guess
Ciao
Have fun
Usually " ".join(myList) would work but I'm getting some idiotic error
Checks?
I aint doin any
For the invalid I was just doing a length check
But that didn't work because of -
And at the same time you can't just add individual chars
Because of -
Wtf?
print(" ".join(output))
ohk that was weird
got it
||https://bin.katsumag.me/P9e4Melx.pl|| what did you all get?
im soo confused. it says it expected nothing but when I give it nothing it expects 3 5 7
The last test case has invalid input
Still counts
God I love that NFE when the number is a negative lmao
fuck I forgot theres a time limit
Nice one Kali
Yugi, look at my code
thank
Holy balls
send frost
Frosty what is that
I just pressed back to home
@prisma wave I got a higher score than u. Recorded.
using finals in clash of code 
So do I ;p
That works pretty well...
Shut up, not my fault this autocorrect is retarded so I gotta wait for it resolve a changed line before I can test
Why do you have auto correct?
phone? 
I mean method completion smh
Just use python
no dont do that
I don't do well under speed
Kali did you do either of these?
wot
Did you try and complete either or did u say naaaaaaah
@errant geyser I left halfway through the game, I have an excuse
nah
😦
64 * n
xd
That was easy
yup
theres like only 4 numbers with zeroes in them bois
6 8 0 9
wait for me
I know this one, pretty nice ngl
Kotlin!!!!
Better help me now senpai
Ah fuck you
katsu you have a NPE
you used !!
U used to be my snif snif senpai
Gaby that is
Creative and I'm ashamed I didn't think of it
jk m8
@errant geyser why JAVA
i wanted someone to share code so i could see what i did wrong
i did share
share yours
sad for you
you are just stupid dw
^
Looks lovely
test on the rng expansion 
I had to turn my nic on and off at least 6 times to get this to work
anyone know how to see what the test's inputs are?
ive passed the first one, but idrk where im going wrong on the 2nd
me too
@topaz bay Is array intialization costly
thanks for games 👍
E.g double[] {x, y} vs Point2D
And dont say "readability"
import sys
urlbar = input()
if ("http://" in urlbar or "https://" in urlbar):
print(urlbar)
sys.exit()
if ("." in urlbar):
print("http://" + urlbar)
else:
print("ftp://" + urlbar)
``` kali u coulda just done this boi
And dont say "readability"
oh wait
Actually that one doesn't
This is what I had
o nvm u did print
If it already had either of those 3 in it, print it as is
thats what i did 😐
U had your if statement with the . above everything else tho
So if I had https://www.someting.com, I'd end up with https://https://www.something.com
U were close enough

time to update to ij 2020.1.4
very
?tryandsee
idiot sx
I didnt @ you bitch
I DONT CARE
Actually this doesnt even follow the contract
Should work?


