#dev-general
1 messages ยท Page 103 of 1
Ok how hard are these normally KM?
depends
some are really easy
fairly easy
some are pretty tricky
yeah
some are weirdly worded but actually easy
I've never done one before
are we doing it where we have to do a new language or na?
some are just impossible
nah not rn
15 seconds
yeah a few are insanely hard
10
use any language rn
7
what are the limits?
5
limits?
limits?
shortest limits
Thanks
0%
I did very well
very well indeed
how i get a scratch file again bm
ctrl + shift + a
then type scratch
@errant geyser you can test it before you submit
Wait but
KM, is there a way to run the scratch file btw?
yes
OH
ie ignore spaces and things
And then you can just run it?
See I'm smart
oh, didn't know that
yeah at first i thought it was really simple
one id actaully get right ๐ญ
i can do this 1, just need to figure out how 
message = input()
total = 0
for char in message:
if char in "abcdefghijklmopqrstuvwxyz" or char in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
total += 1
print(total)``` done
that's actually really verbose for python
^
usually you can do it in like 3 letters
Nah
mine works for like the first 2 lol
:/
It works
the challenge is smallest code possible tho
Wait
message = input()
total = 0
for char in message:
if char.lower() in "abcdefghijklmopqrstuvwxyz":
total += 1
print(total)``` done
Ugh
okay lunch time
in kotlin it's just ```kotlin
readLine()!!.toCharArray().count { it.isLetter() }
def output(message):
return char for char in message if char.lower() in "abcdefghijklmopqrstuvwxyz"
print(output(input()))
Better?
looks very original
ty
wp wp
Hey no fair
We should do one in Python and watch me still lose
i've barely used python
i tried different ways first but couldnt get it working with .replace(" ", "")
you can use a regex
u sent it to me the other day
i'm not sure there is a regex thing for just alphabetical apart from [a-zA-Z]+
val numbers = readLine()?.split(",s*".toRegex())?.map(String::toInt)?.average() xdxd
thats what u sent
so could .average be changed to .length?
hm
\s is for whitespace
i guess you could remove all whitespace with \s* and then count the characters
i just saw "sum of square numbers" which was the important bit
speedy
i also messed up once and did + instead of +=
you'd probably want to use an external service (as rates can change)
n = int(input())
n_list = []
total = 0
for i in input().split(" "):
n_list.append(int(i))
for x in n_list:
total += x ** x
print(total)
``` how is that 32?
Find an api which gets the latest exchange rates
isn't ** power?
Yeah
and you're set
so you want x * x
๐คฆ
not x ** x which is x^x
Nevermind me
:)
๐
nice
thats what i did, so close
for those wondering when Id use my right hand monitor from earlier btw
next 1?
currently got clash of code on it, and ij on my main
wait code size 230? bm
its just the uppercase/lowecase
gimme a hint on what to do
because my way aint really working i dont think
if its regex im out
REEEE
D|d
i works but the casings fucked
Hehehehhehheheheh it works, kinda
Casing is screwed tho
Like I check if its an upper case letter yet it affects lower case too
1000 chars incoming
F
this is bullshit.
Bruh this site is shit
๐ฆ
@onyx loom not exactly, because forEach can't modify the original String. doing it that way you would want something like kotlin s.map { when(it) { 'O' -> '0' //etc } }.joinToString()
๐
map changes the list
eg ```kotlin
listOf(1, 2, 3).map {
it + 1
}
//will be [2, 3, 4]
it's functional programming
very nice stuff
tytyty
imma stop lol
my brain is expanding with kotlin by the day
ok
i love it
go work on my bedwars plugin
Aj
Ima have to forfeit this one guys, the site keeps rejecting it but it works on my end
you do realise it runs additional checks not just those to prevent what you were doing
share code
never said it couldn't be inefficient and janky
it does extra checks behind the scenes
It wasn't supposed to be, sure
to make sure you've not cheated
heheh
You're going to hate this
import sys
s = input()
if len(s) < 1:
sys.exit()
new_string = []
for char in s:
if char == "O":
new_string.append(0)
elif char == "L":
new_string.append(1)
elif char == "Z":
new_string.append(2)
elif char == "E":
new_string.append(3)
elif char == "A":
new_string.append(4)
elif char == "S":
new_string.append(5)
elif char == "G":
new_string.append(6)
elif char == "T":
new_string.append(7)
elif char == "B":
new_string.append(8)
elif char == "Q":
new_string.append(9)
else:
new_string.append(char)
print("".join(new_string))
dear god
๐
Yep
Probably the check
But it kept saying it replaced lower case e's
ยฏ_(ใ)_/ยฏ
who knows
wait, listener priority lowest, is fired first correct?
MONITOR isn't it?
monitor is last
You don't use monitor
lowest is first
why would monitor be first?
Because you monitor shit?
monitor must be last to see if another plugin has modified the event n shit no?
because higher priority has final say
aaaaa
monitor must be last to see if another plugin has modified the event n shit no?
precisely
me smort
Yeah Kaliber you're not supposed to change anything about the event with MONITOR
Lowest happens first, because its effects have the lowest priority
๐
Boutta shit on mcmmo because it cancells my events and just unregister all of it's listeners
lol

I got annoyed yesterday with my expansion
That seems like a bad idea Frosty
class loaders can f off
So I just decided to unregister all events on PlayerQuitEvent.
good luck server owners finding that
Like jesus fuck

ignoreCancelled = false?
any more clashes or nah?
It's default as false Niall
the clash
clash of clans
@prisma wave Any suggestions as to how I'm supposed to approach this if another plugin is being a bitch?
I don't have the braincells
is mcmmo os?
Yes
just modify the source then. problem solved ๐
Using the 1.8.8 version and it's effort to find the right source
what exactly is the problem?
@prisma wave Any suggestions as to how I'm supposed to approach this if another plugin is being a bitch?
@hot hull
Unregister its listener
But I kinda need it
hm
ITs their fault
No just unregister it completely
you might need it tho
Delete the jar from plugins folder
hack into Github and delete the repo
Imma check what the fuck they're doing first
๐
We regret to inform you that the CEO of niallib has redirected our funds
NiallLib Lib will not longer be produced
LMAO
NO
wait.
wtf
๐ญ
We regret to inform you that the CEO of niallib has redirected our funds
where the funds going now
to niallLib again in 2 months?
KaLIBer
KaLib
Kalib sounds better
Mother f**rs
@EventHandler(priority = EventPriority.LOWEST,ignoreCancelled = true)
public void onPlayerInteractLowest(PlayerInteractEvent event)
{

Anyone know a good currency exchange convertor thingy api/lib/whatever lol
I tried this https://github.com/Ritaja/java-exchange-rates But it gives a org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
but.....
how
i think the libs broken lol
hasnt been updated in 3 years
ah nvm
I just found an issue on the github
eeee
[16:11:55 INFO]: Plugin: mcMMO, Priority: LOWEST
[16:11:55 INFO]: Plugin: DistrictCore, Priority: LOWEST
[16:11:55 INFO]: Plugin: DistrictHarvesterHoes, Priority: LOWEST
[16:11:55 INFO]: Plugin: DistrictHarvesterHoes, Priority: LOWEST
[16:11:55 INFO]: Plugin: Essentials, Priority: LOW
[16:11:55 INFO]: Plugin: DistrictCore, Priority: NORMAL
[16:11:55 INFO]: Plugin: DistrictCore, Priority: NORMAL
[16:11:55 INFO]: Plugin: DistrictCore, Priority: NORMAL
[16:11:55 INFO]: Plugin: DistrictCore, Priority: NORMAL
[16:11:55 INFO]: Plugin: Essentials, Priority: NORMAL
[16:11:55 INFO]: Plugin: SilkSpawners, Priority: HIGHEST
[16:11:55 INFO]: Plugin: mcMMO, Priority: MONITOR
[16:11:55 INFO]: Plugin: ViaVersion, Priority: MONITOR
na, something they were grabbing the currencies or something shutdown, and instead of putting that anywhere they just replied to someones issue
Today is the day I seek help from #dev-general
Okay, here's the thing...
const imap = {
user: "user@gmail.com",
password: "hotdogs123",
host: "imap.gmail.com",
port: 993, // imap port
tls: true,// use secure connection
tlsOptions: { rejectUnauthorized: false }
};
notifier(imap)
.on('mail', mail => console.log(mail))
.start();
// Loop
const n = notifier(imap);
n.on('end', () => n.start()) // session closed
.on('mail', mail => console.log(mail.from[0].address, mail.subject))
.start();
I am using this code (source: https://github.com/jcreigno/nodejs-mail-notifier) to receive new emails. Now I would like to perform a certain action when I receive a new email from a specific email. How should I do that?
I'm going to make a very embarrassing attempt to demonstrate what I'm going for... ๐
if mail.address('important@news.com') {
console.log('New important mail!')
}
I'm using NodeJS
if(mail.address == 'blah')?
i tried this
if mail.from[0].address === "important@news.com" {
console.log('New important mail!"
}
but it says mail not defined
that's not remotely the correct syntax
on('mail', mail => {
if(mail.address === 'blah') {
console.log('hello')
}
})
if not, stringify mail or something and find out what it is
i'll google how to stringify something
JSON.stringify
it's literally JSON.stringify(mail) lol
great
const n = notifier(imap);
n.on('end', () => n.start()) // session closed
.on('mail', mail => {
if(mail.from[0].address === 'putsmail@putsmail.litmus.com') {
console.log('New mail arrived!')
}
})
.start();
initially i thought this was going to be my first python project
but since i had to do this fast because of something (important mails) i decided to do this on the language i can understand (but not code)
heheh
evening
night
it removes spaces from both ends
ah okay
Kotlins String.trim() does the same I think
it just has a extension function with the predicate
I stole a pen from work and its now the only pen I have
๐ฑ
amateur
Lol
Ok look
Its not that I threw all my pens away
I didn't have any pens before
Does anyone know a IntelliJ plugin where you can teletype ?
Teletype?
Write together like so I can see what my friend is typing and he can see what I am typing
live coding i believe is the term
thx
Im pretty sure theyre adding this
They are
https://floobits.com/help/plugins/intellij
check that too. Im not sure which is better
Soon
I use Floobits for it
Works pretty well
The other person doesnt even need to be in IJ
I find it a gimmick anyway
Unless you both use the same code styles and structures, it'll just end up a mess
That's what style guides are for
Yeah but it's useful for organisations, and it's nice to casually collab with someone for a project, which is why I used Floobits in the first place
floobits doesnt exist when searching plugins
I have it installed ยฏ\_(ใ)_/ยฏ
Yeah style guides are all well and good but different people usually use different structures and things
floobits is eh
problems arise when you're both working towards the same thing in a project, as you'll inevitably end up editing the same file, which floobits will scream at you for
isnt this on IJs roadmap?
it is
i wrote a guide https://wiki.helpch.at/piggys-barn/how-to-run-your-minecraft-server-s-in-intellij (completely unrelated to the current topic, but I wanted to share)
didnt you write a guide on this on the spigot forums?
bit different
ah
@ocean quartz kotlin reflection is honestly fucking evil
I just increased the performance of korm by (not a joke) 500%
By using Java reflection instead of kotlin reflection
Took it from an average of 5ms to <1 on a 100 run average
top is gson bottom is korm
why is kotlin reflection so slow?
Because everything has to populated at runtime
Anyone knows how to fix this issue? https://github.com/PlaceholderAPI/PlaceholderAPI/issues/321
Everything about classes is already known to the JVM
But kotlin has to gather all of that information
fields and methods have to be wrapped in kcallables
@grim karma #placeholder-api
38 upvotes on r/badcode ._.
You mean u/TeamTraitor?
I was about to say that
so yeah, r/badcode
You know, that is posted by an invidual
But the u/TeamTraitor has 38 votes, get it?
well yeah
users dont have votes
the post has 38
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
Put simply, Guice alleviates the need for factories and the use of new in your Java code.
Dependency Injection framework
do people use it for plugins?
I guess so
I mean like, how much would it benefit just a general preson making a plugin
I mean like Ive been trying to improve it
Guice is one of those things, which improves it, but it's overkill in most cases :p
You're a 4head
My time with guice was good
"my time" as in past ๐ค
Niall's retired to take pictures of clouds or smth
Iโve been trying to squeeze as much as possible out of guice
use child injectors if you want that
they're godly
I made a 2mb framework around them, that should tell you how useful they are
i lied
it's 10mb
oh woops that includes binaries
What is Size, if itโs not on disk?
seems like I greatly overestimated my core size lol
In memory
memory impact should be relatively low
I meant your earlier screencap
oh uh
it's probably some sort of redundancy built into windows
like a high level of raid
Well it definitely is redundant
made a gradle installation guide as a prelude to my gradle tutorial/argument https://wiki.helpch.at/piggys-barn/java/gradle
Why do I not wanna click any links an admin posts now
lol
Cool ๐
๐
Im parsing a large json (27mb) or something into memory.. and shapefiles which can be even larger is this good?
Reading from file each time is extremely slow
1.5 seconds to find the correct row in json
Well actually- the shapefile is less in memory as I store floats and not doubles
Oh god.. trying to make Whack-a-Mole game timing system on dm the whole time just to realize that spigot only accept 20 ticks as 1s...
What else would it be 

@topaz bay ur weird
allman better
said literally no one ever
yeah that looks about right @obtuse gale
I hate people who put their toilet roll that way round lol
same
allman better
@hot hull whatever you're on, I want some of it
yeah ik ๐ฆ
sxtanna and sxtanna
allman is actually a majority
In fact, allman and K&R are the two most popular
by a lot
which are the other formats?
they don't matter lol
There are tons
They are language specific though
Some* are
In computer programming, an indentation style is a convention governing the indentation of blocks of code to convey program structure. This article largely addresses the free-form languages, such as C and its descendants, but can be (and often is) applied to most other program...
the other ones are weird
oh well https://google.github.io/styleguide/javaguide.html (not the same thing ik)
As long as no one use Haskell i'm fine with it
I was about to say that lmao
wtf is that
worse than @hot hull's commas on the 2nd line
while (x == y)
{
something();
somethingelse();
}
finalthing();``` this is hideous
literally disgusting
is that gnu?
Whitesmiths
Also @topaz bay nice, holy shit, that's a huge difference (talking about the ping from yesterday, sorry i was already asleep)
How bout you heck out Gaby
gnu is similar
Braces are used even when the block is empty or contains a single statement
Interesting
@ocean quartz RIGHT
Gonna be a nice little update
Ngl Korm's syntax is pretty nice
Its pretty much json without quotes
Simplified Json, easier to read
And without the 100% need for commas
What program do I use to count the amount of lines of code in a project?
Statistics
^ Indeed
Yes
Imagine it actually working ;c
?
Link
it does
Nvm got it
For me it doesn't, probs cause I'm using an ancient version
Just search for Statists on on IJ lol
Where are they showed
View > Statistic
ur fonts weird
Its.... jetbrains mono
imagine using a monospaced font for non-code
Imagine not
Polyspaced font ftw
Which channel is the support channel
Depends
Hi, I try to replace with javascript "(F)" with "" but only the F get replaced xd....
Code:
text.replaceAll("(F)", "") Can somebody help me?
Also text.replaceAll("()", "") doesn`t work
replaceAll is regex
what should I use instead of it?
@ocean quartz
Went from taking 300+ milliseconds
to 0.4 milliseconds
Actually no, thats microseconds
300 to 4 milliseconds
Actually insane how slow kotlin reflection is
Its not like its hard to get a license?
They responded in literally less than 24 hours
Didnt even know they did open sourced ones
Did you add an additonal notes
Nope
This literal singular call to objectInstance
takes 3 fucking hundred milliseconds
That is so beyond unacceptable
And now extractFrom takes no time at all
๐
https://i.imgur.com/MRSSLXr.png aww this doesn't work
It kicks for illegal char in chat
Strip it before they send it
Tell Matt to add it if it doesn't exist ๐ฎ
How would you do that even
What's useful with making your own event Frosty?
Valid point

@prisma wave I'm dumb as hell, how do you make your own thing like https://img.bristermitten.me/ 
i swear if its literally just like
upload files into the directory

It's literally that yeah, you point the subdomain to a directory and put images in it
Pretty much yeah
get a bit of software (eg sharex) to upload files via SFTP or something
and have nginx or another web server serve files in the directory
ez
Fr
now we know the answer
Damn it you had me excited then Gaby thinking Python settled the longest standing debate ever
Then I saw the semi colon
Disappointment
semicolons are optional in JS
KM
If he left that without it I would've been so excited, only to have my dreams crushed
Getting let down gently is the way to go
@quiet depot sorry for the ping, do you think I could fit the unlootable loot rooms from the Opus into your build? You know the ones where you put the two carpets on the roof and then you can put 2 locked large boxes on them with a half wall in front?
I suggest you spend 2 hours making a thing to programmatically add .java to all the calls
Rather than spending 10 minutes doing it by hand
Oh no, I'm not changing that
I'm completely rewriting all reflection to use java
java reflection*
not java code
It... it was already heavily using java reflection xD
imagine not using frigga reflection
KM
Change your name to FM
Then I can make fun of you for being a radio frequency or whatever
It... it was already heavily using java reflection xD
Oh ๐
With her own code
her?
Yeah, she's a her
Nah, she wont care
What's she gonna do, type at me?
Yup
Ikr
She'll just have to get over it ๐
First of all bitch
My code is immaculate
How dare you
But also yeah, I don't really care if people call me she or her
Allman is not immaculate
Allman -> ๐คข
My pfp -> ๐ค
You couldn't possibly snif blast a poor dog could you?snif
So they will be a terrorist?
yet
Sorry man, dogs gotta die
ight I'm off guys, my tired brain goes places it really shouldn't.
It's not guaranteed Zod
Anyone know how to force a window to open on a specific window (if for example it's opening off of display?)
Windows key, shift, arrow keys
Just for that ima need a protection deal for the dog
after World Downloading a world, for some reason the boss bar is still there
how do I remove that?
Theres like a 60/40 he's a terrorist
Is it 60 or 40 that's he's a terrorist?
That's a bear
Too high of a chance
Damn it Zod
You got what you wanted
Now leave the dog alone
snif
Theres a lot more of that if you dont agree zod
Ok I really should go now before I make this weird
KILL IT
Dog may live
Yay
Thanks
Screw you Sx, allman bad
You know magicians have a smokescreen thing that they vanish into?
Internet equivalent
Surprise alien invasion
Bye
Watch the official music video for "It's Raining Men" by The Weather Girls
Listen to The Weather Girls: https://TheWeatherGirls.lnk.to/listenYD
Subscribe to the official The Weather Girls' Youtube channel: https://TheWeatherGirls.lnk.to/subscribeYD
Follow The Weather Girls:
...
I'm not sure what to think of that Sx tbh
wrong.
It is scientifically proven. My opinion is always better.
That's true
Allman is very popular, and objectively better
allman is objectively bad
^
Ok everyone, start the circlejerk
Looks like shit, reads like shit
It looks worse to me
Thats not an argument
What's the argument for it then?
Except thats objectively wrong
The brace on the next line aligns with the closing brace of the current block
Making traversing them much more readable
The function already does that
For you
And the extra line between it and the statement allows for clear chunks of code, rather than bunched up messes
The function does not already do that
fun {
}
}```
We all have our own coding styles, and they're all ok. Except Sx is a 4head so obviously his is wrong. Oh and dont forget to start the Kotlin and Gradle circlejerk guys
https://i.imgur.com/pguNdty.png
IDE even makes lines
You have no right to an opinion when you have an image background on your code
Smh
Not to mention, youre breaking several style guides
RIGHT THERE
And you have the nerve to complain about allman
I copied from a site smh
Just wait until mine and BMs audio visual molestation machine is ready Sx
Dont back up your opinion with shit code
You have no right to an opinion when your mustache looks like you're 12 :^)
Its gonna be great
That's a sexy man
Aint even got anything to say lmaoo
?
Snapchat trying to make money as a failing platform
Looks pretty normal to me
I mean yeah
Is this like... your first time opening snapchat?
This year yeah
Thats another yikes
Hey, I have no reason to use it
I'm not interesting enough for anyone to ask for any form of contact/social media, so I just use discord + reddit for looking through stuff and chatting with friends
Zod is right
I can text without it
Why would I use it over this for friends? Me and my friends never actually text each other Zod, idk why. We use Steam, GoG, or this
Man if I want nudes I'll just get the picture that doesn't fade in 3 seconds smh
WHAT
Your simp ass out here looking at temporary pics
You're joking right
No, I'm just that much of a chad ๐
Tbf it's annoying snapchat deletes messages quickly, tho not for Zods situation
Not a single soul on this planet sends pictures that timeout
Now you're just making wild assumptions
Theres also a setting for chat where the messages only delete after 24 hours
- you can save chat messages
@topaz bay ur gay
Why do I care
cus its illegal to be gay
Ori out here lookin to get slapped
?
Oh I said something to Niall yesterday and he responded with "2 blocked messages" lol
ยฏ_(ใ)_/ยฏ
well someone's mad 
I don't determine my opinions from the opinions of others
I don't stay petty and bitching about shit that happened a week ago
but here we are
F
Someone is rather chatty
I'm pretty sure I detect a pinch of salt in that Sx
That someone is not a lil bitch who's too scared to challenge your thoughts 
In what?
Hey do you guys like chicken?
No
only on good days
Vegetarian
Gross
You use allman Sx, you cant have an opinion on my meat eating status
Yes. Those 100% relate.
What's wrong with being vegetarian?
vegetarians are cool people
It doesnt have to make sense Sx, we're internet acquaintances
i wasn't even born then 
It doesn't shock me, I'm just wondering what lead you to be such a shitty person
How... does that make me a shitty person
You don't see how shitting on someone's life style wouldn't make you a shitty person?
I mean we were doing the same thing to his coding style
It's.... sarcasm...
You're bad at it.
Thank you.
You're welcome.
Thank you.
You're welcome.
Ok I cant tell whether this is just passive aggressive or salty
the way you speak to people and act towards others 99% of the time is also pretty shitty but we won't get into that one 
but im blocked so it doesn't matter what my opinions are, as they're someone elses 
Congrats on getting it this time ๐
F
Honestly one of the greatest inventions
Do you have some kind of discord grammarly thing you built in Kotlin
?
Rather than the default red lines
No?
Hey yako just looked in request-paid, how did you get to working for those guys?
Connections
Originally for JackSucksAtLife because the Systems admin reached out to me after seeing my github & website
With that, I met some talented people that already worked there and they contacted me to help them out which got me in with other yters
furiously scribbling notes
tldr; connections are important for anything in life
yes much ^
After the first run in with a big dog, I pretty much am "famous" in the server development community when owners look for someone to hire
After the first big job, you have leverage and a status boost that will get your career started
Famous
I thought it'd never happen, but it eventually does for everyone who puts in the effort
You're welcome.
Thank you.
Oh god not again
You're welcome.
"famous" = Has status that others look for in an employee
Well I got my first like, actually worth it commission today after I started working for a server network, so I hope that's the start of something better but probably not lol
nice boost
Sx and Zod I feel like you guys have history
commission for network? is that like freelance longterm?
when I am employed I just track hours
Yeah pretty much
Ah.
I have no idea who that person is
what
I was replying to @errant geyser
Absolutely fucking not
ahaha
Hard pass
