#dev-general
1 messages · Page 229 of 1
ikr
Oo
Time to do this puzzle manually
This second one is an oof
Don't ask to ask
<div id="killdaserver">
</div>
<script>
@can('power-kill', $server)
var cbText = document.getElementById("killdaserver");
var confirm = cbText.innerHTML = '<a data-attr="power" data-action="kill">I am sure.</a>';
@endcan
$('#killserver').on('click', function (event) {
if ($(this).hasClass('disabled')) {
return;
}
swal({
icon: 'warning',
title: 'Are you sure you want to stop by force?',
html: 'The forced stop shuts down the server instantly. Running atasks (such as saving player information) does not terminate properly when the server is shut down. Forced stopping can cause data loss on the server.',
showCancelButton: true,
focusConfirm: false,
cancelButtonText: 'Cancel',
confirmButtonColor: '#10c45b',
cancelButtonColor: '#d33',
confirmButtonText: confirm
}).then((result) => {
if (result.value) {
Socket.emit('set status', 'kill');
}
});
});
</script>```
so the inner html doesnt work
is there anyway to parse the html in the javascript?
@old wyvern Can I show you my results in dms and you give me a hint perhaps? 
Did you do the puzzle yet Piggy?
what puzzle?
@tacit cave it probably gets escaped to stop injection
AOC
Why not have the "I am sure" element hidden by default, and then show it when they click?
no i've been busy with exams
wait what?
have the <a blah> present but hidden, and then set display: auto or whatever it is when the click
Rather than changing the button text
sure
well
without the javascript
it works
i wonder why
lol
const x = whatever;
or
const { x } = whatever```?
isnt { } used to import certain parts from a module?
like const { Client } = Discord; > const client = Discord.Client;
@old wyvern >:}
ill get you tmr 
Gonna do the challenge at 1 am so no!
We'll see
Gotta see if it's written anywhere as to how it's rated
Time based from when
Getting a star first is worth 100 points, second is 99, and so on down to 1 point at 100th place.
Oh damn
There are probably more points than that
That might be worth staying up late for
or maybe its per leaderboard
It's not per leaderboard, otherwise we'd all have a lot more points
maybe it dependent on amount of people in the leaderboard?
I was at 12 today morning
24 after gettings 2 stars
uh wait, that still doesnt add up
ah
So it's fair
What is it rn?
I think we're already on local score
ah
Probs best to leave it like this
We need more ppl tho :C
barry the advent manager when?
Piggy, go make a leaderboard for this so Barry handles it 
no
Maybe a temporary Christmas Larry?
looks like cube is dead so guess I better do the giveaways
why do I have less points than frosty lol
Cause I'm the best <o/
tryhards
Attempting to figure out how to use EzPrestige to get this commission done 
Pain.
Spain.
Cocaine
Rain
so true
😂
ye
no u
Hi, how can I retrieve the current vote count with the VoteParty API?
ok firstly you should declare your main function with (defn -main [& args]), -main is a special name and the vector of arguments, & indicates a vararg
Excuse me but I'm French, I can't understand everything
i don't understand how i should use these methods
so i have to use @EventHandler?
yes
listen to the events
^
but he's just copying the constructors
Retrieve the total number of current votes to include it in my scoreboard
then you'd also not listen to the events
Well idk the API, but surely you wouldn't need the events?
just retrieve the count rather than using an event
@prisma wave Help, Shit dont work
what
kekw
Okay
but when i do this, ohhhhhhhhhhh no
get featherboard
just use papi
PlaceHolderAPI ?
What
i have no ideaaaaaaaaaaaaaaaaaaaaaaa
yes
i am mid mental breakdown and i am suffering
There is a documentation for PAPI ?
yes
Ouais
go to the wiki yohan
Ouais x)
Ok :)
Idk what you want me to do but
Ok
explain why it no work
Blame md5
you know what would be a sick project
designing and making a infrastructure like digitalocean etc
hard AF but still very cool and a real challenge
can you allocate different resources to docker containers?
nah but like they have such nice simplicity yet they're so expensive
azure portal for example too is incredibly expensive
Azure is obscenely expensive
at my work we pay loads of money to such services even though if we were to use pure dedi's we'd save so much
and that's purely due to simplicity
that's probably the point though
I wonder how simple you could make it while keeping costs low
which is impossible when starting out ofc
but just imagine you are already a big company
how hard would it be to make a low cost simple system
probably not too hard
buy a few dedis
setup some virtualization shit
make a website
profit?
brb making a repo
;p
an org*
no but like I pay what 60$ a month for quite a bad server when I can get what x5 the specs for the same price
convenience tho
well honestly
it was a pure vps
sure it has the benefits of not losing your data etc due to that it's all scattered etc
but it was pretty barebones
trying to get it as cheap as possible for what I needed
yet if I went to a smaller host I'd pay so much less
but there must be already open-source stuff that uses k8s & docker to make such platforms
like there must be more people thinking like this right
without money in their mind lol
I think that plays a big role in companies like digitalocean & azure (microsoft)
Thinking out loud, scalability as a service could be cool. so you set a budget, provide a docker image, and it spins up x instances depending on budget and demand, and adjusts to compensate
yeah
привет, как мне создать аккаунт на сервисе?
Hi, how can I create an account on the service?
Registration is currently locked. If you feel it is necessary to create an account, please join our discord and get in touch with us.
ecloud
@worldly portal contact @funnycube#0001 on discord. he'll help you out
@obtuse gale
so what would be most convenient way of storing itemstacks in a mysql database 😮
byte[] 
those are two completely different things tho
paper has a toByteArray or w/e method for itemstacks for a reason
gson > json though

wat lol
no
Awesome
xD
k lol
what
k lol
eyup
you do problems
and shit
i did problems yesterday
each problem has 2 parts
and each part is worth 1 star
you need to get at least 50 stars by December 25th if you want to succeed
You think that there is a valid way for fingerprints in plugins
like how forge has fingerprint violation events
that checks if the jar is from some repost or sketchy site
possibly
it uses sha from what i heard
spigot could easily add a signing / hashes thing
yeah
return sequenceOf(identifier, category, value, manager, lockedGuiItem, unlockedGuiItem, equippedGuiItem)
.map { it.hashCode() }
.reduce { total, hash -> 31 * total + hash }```
Would be this a bad way to calculate `hashCode`? xd
just trying new stuff
@prisma wave 
uh
probably not actually
that's just the functional equivalent of a normal hash function, so sure that works
rude
wdym?
so rn I'm confused AF. So I'm doing AdventOfCode and am at day 2 part2.
I have this code: https://paste.helpch.at/felacefifo.cs
And this is the question: https://paste.helpch.at/jatabepate.cpp
And this are the values I have to test for: https://paste.helpch.at/opigafotuj
My result is 805 but it says its not wrong (to high apparently). Can someone spot my mistake because I can't lmao. Did some debugging and seems like it should work just fine
You ignored the fact that the character should only be at either one and not both positions
oh wait
is it
I didn't read the question correctly then lmao
oh lmao. I didn't even noticed the last example
lol
is javascript considered a scripting language for #role-request
I'm pretty sure any language apart from the S word is fine
Thou shall not sin in thy holy land.
@static zealot btw String#char will return the first character
charAt?
okie time to do this advent shit
Noob
New projects window is nice
The VCS tab got changed to Git or whatever VCS you're using
yeah I use git
We’ve started using a new ranking mechanism based on machine learning for Java code completion suggestions.
ok so basically tabnine
I thought it already did use ML
idk
ah so they've got their floobits thing in now
tbh would've thought they'd have tried to add that on the first release for 2020
seemed like a big thing
CodeWithMe
CWM!
The Run/Debug Configurations feature a new UI that groups the most frequently used settings together on one screen and gives you the option to add more parameters if needed.
underlined was already possible in vanilla ij but ok
i'm on day 1 part 2 lol
They fixed Material class killing IDE
k :)))
No idea
Test
because that's what I deal with in papi3
Tf 13?
It's better Piggy, or so people have said
Day 4 challenge is actually interesting
You have to count the trees you hit when go down by 1 line
Typing random stuff won't help you, also everyone has a different input
I didn't type random stuff xD
Just debug
just every time I read the thing I think I have something different to do
ye I'll debug on a smaller scale
Piggy, sorry bb
ok day 3 part 1 is confusing me
it says go 3 right 1 down on an input like this (which is actually much longer)
but it also says go to the very bottom of the input
how do you get to the bottom like that
does it start at the other side when you reach the right side?
pls help
what
how many times?
However many you need
k
kek
shit is literally frozen
I went to type on every line and paste the line a bunch of times
only held control v for a few secs
it's frozen
I mean I waited 30min for IJ to open for me, but I'm still on 2018.3 and my pc is shit so that's understandable
It also keeps fucking up key shortcuts
Piece of shit
Or just if (pos > lenght) pos -= lenght smh.
@quiet depot Where do you change key shortcuts again, I keep forgetting
danke
join the leaderboard noob
bruh I got the answer wrong cause I forgot a space at the end smh
?
Ill do it after my work 
wym use modulo
I'm unbelievably dumb
Been getting the same result each time no matter what I changed, realised I was running part 1 not part 2
The map repeats itself to the right so even if the index goes over bound, (index%width) would point to the right object in path
Number 3 is tricky
BM I thought you were a professional developer
Not a professional advent of coder though
oh nice
idk why my method isn’t working tho
tried 2 ways
multiplied each line length by 1500, that stays true for both attempts
first attempt condensed it all onto one line
got the char every 1500 * 31 + 34
might have been * 30 can’t remember
second attempt was putting it into a 2d array
Hi

I just made a boolean array, checked if the current one is a tree and if so add to the count
then i increment x and y by the specified right and left values
what
its advent of code
ah that thing
yeah
I assume that's your GH
yeah
;(
tomorrow will do, today's gonna be one busy day
the problems will accumulate lmfao
you are going to have like 20 problems to do at the end xD
idk why Matt is slacking :c
kekw
Busy
shame
I got a cool idea for a plugin. I should make a plugin which doesn't allow tools to break, but if they reach 0 durability, you can use the material you desire and place it next to the "broken" tool in a crafting grid to replace like 20% of the durability
or something like that
And broken tools have the same mining level of fists
and same mining speed of fists
Ayy i have something like that
Tinkers
yeah
The basics is pretty easy to do for it
Yeah then i add a broken nbt to the item
yeah
I bet it is possible to make tinkers construct in minecraft spigot
thats actually a sick idea
but its hard
The only sad thing is that you don't have the cool blocks and liquids and stuff
texturepacks/resourcepacks
thats the only thing doe
does model data apply to liquids
or can it only have one texture
rip colors
kekw
It's not a plugin lol
MAIN
@steel heart DOGGO
PLUSEEABET
@steel heart ❤️

kekw
Anyone that solved CoA Day 3 Part 2 and wanna share the code? 
kekw
Sure
Yugi, give em a hint
its just incrementing two variables
no don't lmao I was joking
Let's not go copy pasting, hints allowed tho
I solved part 1... I just need to fix the one that goes 2 down 1 right
Sure
xD
kip odd lines
its fine I'll get it eventually
skip*
isn't part 2 just part 1 with diff numbers?
I just made a method
lmfao
just make a method
then plug it in like 5 times
with different values
and ez answer
yes BM just last one goes 2 down 1 right its not right something down 1 anymore
and I think I messed it up
idk I hadn't looked at the code in the past 8 hours
9
@forest pecan me too
I used two variables in a loop like
for (int i = 0; j = 0; ...)
then in the indexing
you get the modulo
but in this case you actually dont need it for this particular input
you just need to set it at the 3rd index when you reach the last one
We need more people in the leaderboard
I'll try to bargain a deal with our lord and savior cube
In this screencast, we’re going to look at the 3 ways to simplify your code using refactoring in IntelliJ IDEA. Simplifying your code has lots of advantages including improving readability, tackling technical debt, and managing ever changing requirements.
00:00 - Intro
00:38 - Extract & Inline
04:28 - Change Signature
05:33 - Rename
*Author: H...
Epic
Old news
so you imply, you’re 1 of the 7000 who watched?
I watched it for like 2min
Could someone take my input and just tell me what the fuck are the trees suppose to be for each step?
because it seems like all the other steps are working (I assume this since the one that I already got in part 1 returns the correct amount of the trees) so I assume its my last one that's broken
this is my input: https://paste.helpch.at/fajatigota.bash
day 3 part 2 btw
wait a minute
fuck
My new LIB, MAGICCAST I call it. So magic
Anyone know an alternative to jitpack but for private repositories?
brister mitten repo
huh/
MagicCast.registerCast(from, to, provider<from, to>)
A compiler plugin that replaces instanceof with is and casts to as might be quite neat
?
Did I hear maven
this was actually an idea I had for elara, not casting but magic functions for coercion
until i realised it's an awful idea
How come so many people use maven (instead of gradle)?
They haven't been taught the way of life
Because people argues for that you need more files for gradle
and that it's "advanced" and at the end they accomplish nearly the same
If you get all the files from gradle and check the lines it'll still probably be less than a maven single file :kek:
Gradle
dkim... have you not red Piggy's post?
like there's no need to argue when someone tells you Maven is better just give them a link to that post lmao
Who was making that IJ plugin that downloaded all the shit for MC and setup hotswappnig and stuff for you, and di you ever fniish it lol?
Whats the intellij theme that everyone uses again?
Atom One Dark is the best one 
how do I get that theme without the buttons becoming super big
It shouldn't affect your buttons
Which buttons are you talking about?
Install the plugin Material UI
AHHH
my Eyes
the lIGht MODe
and
the stuff
is so big
such as the files on the left
it used to be more compact
same with the problems
I mean just change your settings again
@half harness most people use maven due to misinformation in the community
oh
influential people telling essentially lies
misinformation?
yes, lots of people genuinely believe maven is objectively better than gradle
that's my personal take on it
thx
piggy
hello
wait imma move to #off-topic :^)
also what exactly are "Project configuration files"?
I think
might be build.gradle and stuff actually
I've got no clue, I usually click always add
lol
well i haven't buy deulexchat but i want to know if there are a option to hook or chat through discord?like discord srv
Hey
anyone know a bungeecord server manager
so i can group servers?
so like if i group servers (eg, hub1 hub2 hub3) and i do a command such as /hub it will send me to one of the hub servers depending on the player count
im having fun
ew
org.reflections
best scanner change my mind https://paste.helpch.at/dexeyurive.java
Piggy, can ya yeet the dude spamming his yt vid lol
where
yeah gone
Thanks
This day 5 challenge is difficult, I legit can't figure it out lol
easier than yesterday imo
For me yesterdays was easier, less to think about
@lunar cypress Cause like this si what I have so far :kek:
Starting Row Index: 63
Current Row Index: 94
Current Row Index: 47
Current Row Index: 70
Current Row Index: 105
Current Row Index: 53
Seat Row is '53' and Seat Column is '4' for input 'FBFBBFFRLR'.
Which is completelly wrong
0101100 101
Elaborate
@old wyvern i didn't even notice that and it still works without issues
mhm
uh did you convert em back?
You pretty much have everything you need
lol
huH?
Uh so I'm debugging this, and either my inputs are cucked, or this man has no seat... @old wyvern ||https://paste.helpch.at/farikokamo.bash||
you can
I can't
you have to disable the read only mode
huh I swear there used to be a lock button to make it read only
but maybe this is what you're referring to?
morning sweetheart 



These are plane seat IDs https://paste.helpch.at/esacedimun.bash
There is legit no missing seat, which makes no sense
My seat should be the only missing one between two non missing ones
hey how can i use the EZBlocks api to Change the Amount of player mined blocks
like EZBlocks.setMinedblcoks(p,100)
or dos it have event to call ?
send ur input
you mean live sharing?
._ .
Use floobits 
Who said that?
someone who I won't reveal
^
huh?
It doesn't matter at all if Spigot uses Gradle or Maven
Because if you just look at the artifacts (that you're using in the end) you literally can't tell a difference
At the end of the day all you'll have is a Jar
He's an idiot, maven doodoo
👀

good luck trying to figure out the Pattern yourself
kekw
no
Fefo is mine

Nope
He calls me sweetheart
😊
Nope
he just a fury
never copied 

I'm for you two, sweeties 
Hi. Is it possible to create a placeholder that acts as a clickable link?
@obtuse gale im first 

Peeps, please, no need to fight over this
fefo remember we talked about peen milk 😠
We can all be together 
wtf 😂

@sly sonnet No
Congratulations @obtuse gale and @obtuse gale
Lovely
And efe, you play 1.8 
But those are minor details 
me neither wtf
I only heard of localhost
Heard it's pretty popular
You guys should totally join it
damn
localhost
going pretty hard
Ssame thing
shush

Your dont seem to have the right IDs
It should be continuous
But there is a diff of 10 ids between each of your rows
This is the fixed one, https://paste.helpch.at/esacedimun.bash
It makes sense to be like this no?
hah
(defn parts-valid? [parts]
(filter (fn [part]
(match (first part) ["byr" (<= 1920 (nth part 2) 2002)
"iyr" (<= 2010 (nth part 2) 2020)
"eyr" (<= 2020 (nth part 2) 2030)]))))
``` wow this is nice

Wow BM make it public
They removed global emotes Matt
2YEAPf8B
Sad times
Lmao
Yea saw that coming
Hmm? When? (nvm)
That's not what I meant
I was talking about sharing the info of the emote only
destructuring 
are you using core.match?
ah, looks very similar to case though
(fn [[key value]]
(case key
"byr" (<= 1920 value 2002)
"iyr" (<= 2010 value 2020)
"eyr" (<= 2020 value 2030)))```
😐
Bruh
Would've been nice to know that existed when I was dying to figure out how to make the when
case is like switch, cond is like if-else if-else and condp is for really funky people
sounds scary
condp is very scary
Anyone know exactly what files are in a sources.jar?
I still don't really know how to use it
the... source code
Generally no
also gradle uses src/java so does that also get included?
yes
javadoc is stored in the javadoc jar, fittingly
ah epic fail
https://www.github.com/knightzmc/advent-of-code-2020/tree/master/part4.clj
Clojure review pls
And yes it's hideous
horrendous
Thanks 😊
There should be a namespace declaration
Oh I didn't think that was necessary for single files
it technically isn't
Async is awesome
And you shouldn't use use, but rather do it this way:
(ns part4
(:require [clojure.string :refer [index-of split replace]]))```
(if you don't want a namespace, you can also do the same with the require function)
why's split there twice?
const scheduler = server.schedule({ seconds: 2 });
await server.next(); //Waits 2 seconds
server.summon('zombie', { x: 1, y: 2, z: 3 });
await server.next();
server.broadcast('Two seconds ago, a zombie was summoned at 1 2 3!');
because i mistyped
Also that code example is with a plugin I'm making for Spigot
yep
I like str/split and things
Also, you don't need java interop for substrings, clojure wraps it with subs
that's in the core namespace even
Ah alright
(defn parse-passport [string]
(->> (split string #"\s+")
(map #(split % #":"))
(into {})))```then I would clearly separate the parsing from the rest
Ideally you want to work on data where you don't need to care about its format anymore
this is just an example of how you could parse each input string to a map
The result of the first form is put in the second form as the last element, which in turn is put in the third form as the last element, etc...
Makes sense, so yeah it just avoids lots of nesting?
(into {} (map #(split % #":") (split string #"\s+"))) equivalent to this
yeah just a convenience thing
Awesome
in this case I would probably even do it without the macro
but with 3+ layers it can get nasty
(into a b) is just (reduce conj a b)
And conj on maps takes a two element vector representing key and value as an argument
happy to help
Johnny, I'll show u inputs tommorrow, not on pc
refreshing to look at some clojure, doing this in C can be a pain
I would say the opposite lol
Is there anything similar to classes or a combination of data types of some sort in clojure?
Most of the problems are easier to solve imperatively imo
or is that handled as lists as well?
Not that I know of because dynamic typing (?)
I'm probably wrong though, but I've not seen anything to do with types
yo
I see
i wann try clojure
I'm probably too used to functional problem solving now
So I have to disagree there lol
Good point
they are easy to solve
Ill give that a shot tonight
IJ suppourts Clojure with a plugin right?
Yeah Cursive I think
Alrighty
Although I use VSC since a fully fledged IDE isn't so important
hmm
Most of the time when you want to make a type you do so to represent some kind of data. For that you only use built in clojure data structures, mainly maps and vectors
For more sophisticated types/behaviour there are also ways, yes
o
For example, there are protocols, which are kind of like interfaces, but you can implement them for existing types as well
You can proxy classes, interfaces and protocols
there's deftype and defrecord, although you should rarely ever use them
and for interop purposes you can generate classes, enable ahead of time compilation of your namespaces and so on and so forth
Clojure also has polymorphism, but it's much broader than the virtual dispatch that Java supports natively
The only situation where you may want to resort to writing a Java class is stuff like I/O streams maybe, just because you end up having more control over how it will be represented in the end
Wouldn't it be better to just write it in Java for that though?
most clojure libraries for I/O and stuff are built on top of other Java libraries anyway, so I'm not sure when this situation would occur
I was just hypothetically speaking, there may be other cases of course
There's a good list of resources here, ranging from quick introductions to very detailed explanations in all different forms and shapes https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f
I see. Thanks
@lunar cypress how could i do an "is integer" function for strings? normally you'd do parseInt + try/catch, is there a better way for clojure?
int? obviously doesn't work for strings
I've used the try-catch way before, yeah
(defn parse-int [s]
(try
(Integer/valueOf s)
(catch NumberFormatException _ nil)))```
works quite well with if-let and or as well
@lunar cypress is there a macro that allows you to do something like ```clojure
(filter (and valid? parts-valid?) passport-parts)
rather than ```clojure
(filter (fn [part] (and (valid? part) (parts-valid? part)) passport-parts)
You're looking for every-pred
ah yes
much nicer
thanks
(defn is-int? [s] (try
(do (Integer/parseInt s) true)
(catch NumberFormatException _ false)))
``` is anything wrong with this? apparently the `do` is redundant, but I can't think of another way of doing it
yes, the do is redundant
and there's nothing wrong with it per se, but I would probably return the result or nil directly
because there isn't really a reason not to
well for the test i only need to check if it is an int
the value is irrelevant
i guess i can just nil? the return value
you don't need to, as nil is falsey
That's my point, there would be no additional effort to turning the function into try-parse or something, you would end up with less code even
yeah you're right
Been playing around with this lately in my free time. https://github.com/jantic/DeOldify
It allows you to turn old black and white videos / pictures into colorized stuff.
@hot hull 5 pt 2 when?
lol
bruh
wasn't that hard
for part 2 I ended up using a Map<String, Pair<Pattern, Predicate<MatchResult>>> :))))))))
What for?
you don't want to know 
Fefo, are you even in the leaderboard?
Join our leaderboard bish @obtuse gale
send thingu









