#dev-general
1 messages ยท Page 91 of 1
ok I didn't find my error
VBS? xd
this was binomial coefficient wasn't it?
VBScript
Yeah, this was my first "language"
nC2
But you can do challenges with VBS? xd
But you can do challenges with VBS? xdIts in the lang list
I don't think so
yes
again?
๐
Well it would be shorter if I didn't have to do the compatibility stuff
lol
shame
56 characters is mine without the junk
I think I broke mine
no wait all good
uh oh
i don't think being idiomatic matters in this lmao
good thing that idiomatic clojure is shortest clojure ๐
well almost
but anyway, I got a nice number now
very nice
Well, I wrote this in Java and Go, but it is both not nearly as short as your solutions
I wish I'd know Kotlin better
go learn
I'm probably learning Go or C first
I mean... I know some Kotlin but without autocompletion...
It does autocomplete I thought
welp
PHP :omegaLUL:
Kotlin Language Assist interrupted
xD
oh my god
<?php $w=str_split(stream_get_line(STDIN,100+1,"\n"));$r=0;foreach($w as$v){if(ord($v)%2==1)$r+=ord($v);}echo("$r\n")?>
boi
oh god
xD
you are not allowed to mock clojure anymore
I'll just go with Go, whatever
this is terrible
Expected: CAN'TNothing
What? xd
well gg
jesus
i gtg
yall are still going? xd
calm down mate
it's been like 10 seconds
excuse me
tfw your tests succeed but you still get 0%
well ok turns out I misunderstood the task
lmao
Rip
but my tests succeeded nonetheless
My tests succeeded too ๐ค
But I got 50%
different tests, I suppose
Is that possible?
yes
I thought they were all the same
what we should have done: ||first n odd numbers|| what we did: ||odd numbers up to n||
No, I did the right thing
are you sure about that
I am
but you limited it to 1000
50% what
we're a bunch of idiots aren't we
Same problem
First n odd numbers, not just up to 1000
we're a bunch of idiots aren't weyup xD
tfw you don't realise that literally every other number is odd
oof
Yugi, should have used list instead
no that's not the problem
the problem is that sorting strings only works for positive numbers
wait
Integer was my first go
but string join is weird then
welp
int cant be reverse sorted
Why can't it be reverse sorted
int can too, just not with that particular method
write your own sorting algorithm :^)
Did you need to sort then sort reverse?
directly reverse sort
christ i need a dictionary for this
Same
I don't get it, tbh
so is it interest of interest of interest and so on?
probably
I don't get it either
Nah got it
I don't get it too
If the price is 200 and the interest rate is 50%, you pay 100 in the first month, 50 in the second, 25 in the third and so on
I think
that plus the initial price
got it
ok I got it wrong apparently lol
Does the interest increase 50% each month?
its amount * (1+(monthly-interest/100))^months-counting
depends if it's compound or simple interest
compound
you can do compound interest by taking the decimal value of the interest and raising it to the power of how many times you want to apply that interest
how do you retrieve player's language of OfflinePlayer ? (I'm using playerOffline.getPlayer() but don't have getPlayerLanguage())
e.g. 1000 x 1.05^2 would be a 5% interest over two months/years
how do you retrieve player's language of OfflinePlayer ? (I'm using playerOffline.getPlayer() but don't have getPlayerLanguage())
you can get players' language?
also Bukkit probably doesn't cache that
you can get it
how getting offline players works is Bukkit saves details about players who have joined before in a file somewhere
@topaz bay help pls D:
Iirc language is sent on player login and it can change at any time
So it isn't cached
I don't imagine the player's language is something they would save
Apart from in memory
yeah
Sxtanna told me to use getPlayerLanguage() provided by bukkit api
you'd be better off storing the language yourself
Yes
for online players that works I think
Player#getPlayerLanguage
but Player implements OfflinePlayer, not the other way around
yep that's why I use OfflinePlayer.getPlayer()
is that even possible?
That will be null if the player is offline
^^^^
But it exists
Really? Lol I don't think I've ever used that.
the player is supposed to be on don't worry
why the actual hell are you using offline player if the player is online @brave minnow ?
man this fucking sucked
This was awful
because it's PAPI provided expansion java class
Papi also works on offline players
Waffle is it wise to ask you that on PAPI ? Why do on expansion we are using OfflinePlayer class ?
Because sometimes you don't really want to have to worry about a player to show the data
For stuff like server tps and whatnot
This is the type of problems Kotlin shines on, there is always a useful functions to solve this easily
I got several exceptions because I forgot the order of parameters for one function
welp
why can't I retrieve playerLanguage() on a Player object ?! >.<
I had this weird bug again where it detects nothing if you have a space at the end of the output line
I'm not playing for the next minutes
what a task
For some reason it fails on task 3 what
digits i think
What? xD
I literally removed everything i could xD
me too
Without the boilerplate the site requires me to write this would be a win ๐ฆ
Oh i actually i think i could have made it smaller damn
If i had replaced the {} with = i would have gotten 91
I have to write ```clj
(ns Solution
(:gen-class))
(defn -main [& a])
well, can't get it lower
I'll take it
xD
Ooh i didn't know that xD
I don't get why the 2nd fails
yup just figure it out a bit after asking sry >.<
to acces (from yaml)
simpleTest:
en_us: "simple test"
I must do myConfigFile.getString("simpleTest.en_us");
no ?
this makes no sense wtf xD
I don't get why the second wants 100
I felt like you were going to finish 1 second after me
It's 80, 80 + 20% is 96
share code
I submitted i have no idea
ok I actually did the same
I thought it didn't always expect an int and that's why it failed me
but apparently I ran into the same issue
second input is 120
what the f
Wut how
time to submit feedback
Where did you the the 84 from? xD
wdym?
0.84
same
left a 1 star on everything
โ ๏ธ
welp
what other games do they have ? o.o
how can I check if a Yaml file is properly loaded ?
Define "properly loaded"
it is loaded
because I'm trying to get something inside of it and I think the file isn't loaded :c
xD
I wonder if it would have worked for me too without all the replaces
hmm
I think so
@prisma wave I want to know if there's something in it that's all
I mean wouldnt you still have to do the replace calls?
contains?
well I got a poblem then '-'
the code I just wrote is the most digusting thing ever
xD
to get something from a Yaml file you use
configFile.getString("nameOfMyParent.nmaeOfMyChild")
to get the text inside nameOfMyChild @prisma wave ?
Ikr
ah the cheating
@brave minnow yes
it's returning me null ...
I hate the reverse ones
got it
what the hell is this
@prisma wave
getting the path of the string (here it is simpleTest.en_us)
String placeholder = configFile.getString(fileCheck[1] + "." + player.getPlayer().getLocale());
This is the yaml config
simpleTest:
en_us: "This is a simple test!"
fr_fr: "C'est un texte simple!"
and I got null in returns
it's mli_default_simpleTest
so mli_{file}_{placeholder}
I printed it in console and it returns with _
Hm
will try with -
fileCheck is right
I am pretty stupid, i can't figure this one out xD
I printed my file path --- fileCheck[1]
plugins\PlaceholderAPI\mli\default.yml --- simpleTest
and got this
Idk why but this one was hard xd Although the solution is pretty simple
tip: ||it's a combination of two simple maths operations||
I haven't even wrote anything can't even figure it xD
@prisma wave added player.getLocale() in third
plugins\PlaceholderAPI\mli\default.yml --- simpleTest --- en_us
(sum+first element)*2
Am i on the right track?
Nop
Don't separate the values
not so specific
They're all the same
Okay this is it: ||sum of the squares||
๐ฎ
Ooh
xD
In these you just have to try everything that comes to mind
Yikes
I'm afk for this round
that one took me a lot longer lol
+ x y pretty weird syntax xD
It's called prefix notation
xD I still wonder how you read that
operator comes first
I wanna try learn that sometimes
then operands
Ooh interesting
It does have some benefits
but looking at that feels weird
for example you can do (< 0 x 50) whereas in other languages you'd have to do x > 0 && x < 50
Another revers ugh
And that's pretty nice yeah, i like Kotlin for that with x in 0..50
It looks weird at first but it turns out that this avoid a lot of the problems you have with infix
for example you don't have to think about precedence anymore
like, at all
it's always explicit
@prisma wave I found whet it comes from ... File is correctly loaded but configFile.load(new File(filePath)); does not work properly
if I do getName() on File it is good but not on FileConfiguration (returns null)
Also how tf did you two figure this one what xD
FizzBuzz?
multiples
it's a classic
@brave minnow send code
@prisma wave https://paste.helpch.at/yiyodipibu.cs
you should not be doing that much in a placeholder
you should load each file once, possibly lazily
but not every time
I will but at the moment I'm testing ^^'
same line issue
idek what FileConfiguration#getName is supposed to do
one can be a multiple of 5 and 7
but try with YamlConfiguration.load
then FooBar
you didn't use N
1..N
I put the example number instead
that would have been it
btw how can I do like I load 3 file => aSimpleFile, anotherFile, lastFile
I insert them into a File[]
How can I load aSimpleFile from the name of it ?
Well, i'll be back in a bit
alrighty
@prisma wave I already have a load
also I mean YamlConfiguration.load(new File(blah))
ayy km is back
yep ๐
can't
because it's underlined red with no fix '-'
;-;
@prisma wave it is -> YamlConfiguration.loadConfiguration(new File(filePath));
lol
I used the split function in a previous round so fortunately I remembered how it works
no
oh
I have no clue
@prisma wave still getName() (supposed to give name of the file) empty and placeholder not working ;-;
oh wait '-'
It's not though
I'm dumb @prisma wave I'm sorry ๐ญ๐ญ
no problem lol
how come?
I'd expect capitalize to make all the characters capitals
not lowercase them all except the first
The function is completely pure, no side effects
It just uses a different definition of capitalisation
that is not a side effect
ah ok lol
wat
oh it is
wdym to lowercase it?
it would lowercase the whole thing right?
oh the input was ABCDEF
shit
im dumb
yeah it is sort of a strange definition
guess I was lucky
didn't check
ohhh collatz
it's not looking good for kotlin i gotta say
idk
Sorry for my code, sometimes everyone is eliminating all newlines, sometimes not
is it integer division ?not neccessarily
is it integer division ?not neccessarily
@old wyvern yes absolutely
you only divide by 2 if it's divisible by 2
well I can't beat python but I can beat the others at least
please don't
is there a way to allow players to put only certains blocks with worldguard?https://www.spigotmc.org/resources/worldguard-extra-flags.4823/
also #general-plugins
@obtuse gale
Btw, what is the difference between #dev-general, #development and #developer-chat?
there would have been a much better way to do this in clojure but unfortunately it's slightly longer
#development is for support, #dev-general is for anything else, #developer-chat is exlusive to the Developer role and basically #dev-general but dead
@spring canyon u in?https://www.codingame.com/clashofcode/clash/1238487570a3bf887a25d8b32c51400ecc2f518
Last round for me
the grammar in this one
it's horiffic
:)
yep I'm gonna leave it at that
How did you get to the result?
but I wouldn't have gotten a better place than this anyway
parsed it to ints first
or
yeah you should
alternatively you could infer you were using a global var
it's definitely a scoping issue
global n =4654464
That's it for me for today, bye
ok cya
ciao man
bye
global doesn't seem to fix it
Who wanna help me fix performance
Im in nial
@old wyvern ty
So just doing
new Aircraft();
aircraft.set...
session.save(aircraft)
Works fine
Aircraft aircraft = session.get(Aircraft.class, addr);
if (aircraft == null) {
Aircraft aircraft = new Aircraft();
aircraft.setAddress(addr);
}
Model modelDao = modelRepository.findByNameIgnoreCaseAndTypeDesignatorIgnoreCase(model, type);
if (modelDao == null) {
modelDao = new Model();
modelDao.setName(model);
modelDao.setTypeDesignator(type.toUpperCase());
session.save(modelDao);
}
aircraft.setModel(modelDao);```
This is where it gets slow when I start checking and relations
Takes over 2 hours (havnt actually had it complete yet) to insert
Whereas just inserting the aircraft is done within a minute or so
i'm no expert but that doesn't look like enough kotlin to me
This kind of java code is my worst nightmare
rip
joys of enterprise programming
ah yeah รท truncates to an int
i was wondering how i can reactivate placeholders when you do /papi reload
wait do you actually have to use that symbol
@prisma wave sry for the ping but bro I really would like to thank you it's all working now and I love you af '-'
Haha no problem lol glad it's working
wanna see the code ? ๐
who here codes in python
someone help me pls: https://paste.helpch.at/exakakomas.cpp
on double x; double y; double z and x y z it cause error call " The method cos(double) is undefined for the type new BukkitRunnable(){} " and " The method sin(double) is undefined for the type new BukkitRunnable(){} " on other line
It's Math.cos and Math.sin
ty
anyone have any recommendations for forum software
Xenforo is really expensive
Nameless is basic
mybb isnโt cutting it
what's wrong with mybb?
are they updated?
have you asked the developers for support, or their community?
there's namelessmc as an alternative
gl finding anything as polished as mybb for free tho
I don't know why, but I've changed the name of a relocation for the shading plugin in my pom.xml, but when the jar is generated it keeps the relocation that was there previously. Which is throwing a ClassNotFoundException when I start my server, because it's looking for the previously shaded name.
I've checked the META-INF folder in the jar and sure enough the old relocation is still in the pom.xml
I've run mvn clean and yet I'm still seeing the wrong thing, anyone know how to resolve that?
@obtuse gale I used to use mybb when I ran a server
I might get Flarum
I'm not a fan of flarum
I think most people see how ugly the default theme is, and don't look any further
why not
Just don't like it compared to more traditional forums (like xenforo & mybb)
iandrew makes really nice mybb themes
thanks for the recommendation!
that is true
Xenforo is overpriced imo
but itโs the only super well made one so they can price it high
but like
$300 to get rid of the Xenforo label
$160 for a liscence
yeah it's pretty expensive
I don't think it's overpriced though
awesome free theme for mybb btw, if you don't want to cash out on iandrew themes - https://community.mybb.com/mods.php?action=view&pid=1037
ooh thank you
is there anyway to add custom pages for mybb
like a voting link page
Or a discord page
yeah, but sorry, it's been so long since I've used mybb
I don't know how off the top of my head
at least I know it is possible
it's fairly easy iirc
it should be
What Bungeecord fork do you guys suggest? I use Waterfall at the moment
pfft Imaging not making ur own
nerds
weak
โ ๏ธ
@runic flume waterfall is fine, use travertine (basically a fork of waterfall to support 1.7) if you want 1.7 support
imagine making your own
Frosty nerd
also @hot hull you should get this: https://plugins.jetbrains.com/plugin/10233-discord-integration
I have that ee
It just times out if you don't work on it and just have IJ opened
So it displays blank
ye
Sec lemme close all the unncesarry shit
^
bruh who are these people
lol
how do you make a private game
We boutta get f'ed hard
this is a speed one tho
o
ive got no clue on this lol
:/
on the bright side I figured out how to make a private one
so we won't get owned by random nerds anymore
look at all these nerds with their 100% score
idfk, my logic was fucked
int even = 0;
int odd = 0;
for (char c : N.toCharArray()) {
if (Integer.valueOf(c) % 2 == 0) {
even += Integer.valueOf(c);
continue;
}
odd += Integer.valueOf(c);
}
I assume I'm missing the entire point
idk that looks right
Yugi is addicted someone help him
sum of odd digits - sum of even digits or something
xD
I think Integer.valueOf gives the ascii code
kotlin toInt() does
so I had to do toString().toInt()
kOtLiN
koTLin
yes
ยฏ_(ใ)_/ยฏ
The completion is so annoying
yeah lol
what does goated mean?
Cause and the error showing, like it sometimes shows and error on something which doesn't even have an error lol
God of all timed?
5
5*
I'm famous
i dont get it
idk what im meant to do lol
You slow ass site
2 sec xD
The input are deceiving
do we have to add the numbers, then return true if odd?
Look at the numbers :))
not as complex as that
like the first 2 numbers
๐ค
if its not that then idk
ignore first number btw
^
thats the only pattern i see
^
oh
Yugi I would have beaten you if I used the same printout as you :p
xD
so i know what to do
but you didnt ๐
yay
welp
i still dont lol
Unfortunatelly :c
%
||% 2 == 0 -> it's an even number||
Your first answer was partially right goat
i know its modulos
im lost lol
||are each numbers even?||
||server world files||
||wha??||
||println(N % 2 == 0)||
๐ฎ
โน๏ธ
next round bois
oh right
i overcomplicated it
yours was almost right lol
Who this?
uh what?
these reverse ones seem hard lol
are we counting the numbers or the letters
hm
yeah
yeah
oh
it's actually very simple
Something easy I assume
^
huh
still no clue
first example was wrong lol
still no clue
||println(ROW.toCharArray().filter { it.isDigit() }.size)|| is the answer
If I knew these methods jesus
shouldve said that before i submitted :)
that presumes i know what .filter even does
lol
lol
as the name suggests lol

BM, you got advantage cause you know all these methods smh
nerd
well its actually ur disadvantage
only bc kotlin
as u dont know them
Also, was I the only one the mistake the l for a 1 in test 2 case 1 ?
yes
That's the thing that was throwing me off
no
yeah I think so
i made that mistake as well
is yugi here?
oshit
yea i got back
Electricity went out in the first 30 seconds
guys i just found myself on quora
rip
mood
get in here
C:
nice
let me guess
I've no idea what the method for this is again...
you had to truncate doubles
no
You have to only get 1 decimal
chars().sum()
wut
String format
it's average()?
smh
how do you get the ascii value lol
cast to an int
o
cast it to int
It's that, but how do I only get 1 decimal?
string formatting
||String.format("%.1f",val)||

i tried this lol
val charArray = s.toCharArray()
charArray.forEach {
x + it as Int
}
println(x/charArray.size)```
not going well
+= ?
dont do int division?
lol what
I'm annoyed
||s.chars().average().asDouble.toString().format("%.1f")|| is probably right
time to find out
avenge me
lol
not even testing
xD
HA
share code
ยฏ_(ใ)_/ยฏ
Lemme get some chips
kk
k ready
ez win
start
?
start
bM
start the game?
what
I will lose this
bruh my wifi died
????????????????????????
?
that dont make sense
it does?
Your program must calculate the sum of even digits in a number N.
smh
lol Kali
Code size: 3
โน๏ธ
my optimisation is at a point where I replace (filter even?) with (remove odd?)
gotta save that char
xD
but as always, not beating python
Maybe we should ban python for the shortest ones
possibly
nah it's fine
If I really wanted to win I could use python too
import java.util.* is for Scanner iirc
ye
I was trynna cheeze it with only having this import java.*;
guys ive done massive code optimizations with only 3 chars yet u guys are still tryna figure out how to do this
cmon, its not hard
bruh i'm so close to python
idk why my thing isnt working lol
im getting a stringindexoutofboundsexception
Failure
Found: 314
Expected: 26```
Look at my code nerds
lovely
Is there anything I could've even compressed more?
frosty, why
im tryna get mine to work lol
I think using streams might actually be shorter
goddamn it
it looks so disgusting on 1 line reeee