#dev-general

1 messages ยท Page 92 of 1

prisma wave
#

ran out of time

obtuse gale
#

oof

#

i couldnt evben get mine working lol

hot hull
#

rip

lunar cypress
#

share

obtuse gale
#

It wont let me share but

#
fun main(args : Array<String>) {
    val input = Scanner(System.`in`)
    val N = input.nextLong()
    val s = N.toString()
    var sum = 0
    for( x in 0..s.length-1){
        val y= s[x].toInt()
        if(y %2 == 0) sum += y
    }
    println(sum)
}
#

Thats what i was trying

lunar cypress
#

.. is end inclusive

onyx loom
#

score: 14%

obtuse gale
#

it was just giving me really high numbers

old wyvern
#

Integer.valueOf(String.valueOf(i)
Integer.valueOf(i+"")
Character.getNumericValue(i)

prisma wave
#

wtf?

#

0?

#

it literally worked when i tested it

onyx loom
#

omg i beat bm

hot hull
#

Oh shit Yugi, I didn't think of the second one

onyx loom
#

haahahah L

old wyvern
#

welp

obtuse gale
#

I beat BM

prisma wave
#

fuck me

onyx loom
#

new link when

onyx loom
#

wew

old wyvern
#

bm join

prisma wave
#

yeah

onyx loom
#

have fun :)

prisma wave
#

is it addition?

hot hull
#

No

#

It's simple, look at the pattern

prisma wave
#

ah yeah I got it

lunar cypress
#

yeah

prisma wave
#

binary or

onyx loom
#

|| (ns Solution
(:gen-class))

; Auto-generated code below aims at helping you parse
; the standard input according to the problem statement.

(defn output [msg] (println msg) (flush))
(defn debug [msg] (binding [out err] (println msg) (flush)))

(defn -main [& args]
(let [T (read-line) T2 (read-line)]
(println (apply str (map #(if (or (= %1 \1) (= %2 \1)) \1 \0) T T2)))))
||
solution here

prisma wave
#

lmao

onyx loom
#

if anyone understands clojure :)))

lunar cypress
#

sure that helps everyone

prisma wave
#

i get the gist

#

i think

obtuse gale
#

does it do tests other than the test cases?

prisma wave
#

no

obtuse gale
#

ok well I just thought i 5000iqd that

#

Turns out i did not

hot hull
#

I'm disguisted but mk

old wyvern
#

I did | first

#

but the result ignored 0 on left

#

so rip

obtuse gale
onyx loom
#

@ocean quartz ?

hot hull
#

Yugi I would've beat you if Java wasn't shit and you didn't have to specifiy chars as '' and could have them without ""/''

prisma wave
#

lmao

lunar cypress
#

It does do random tests for validation, I think

hot hull
#

Ye Johny

old wyvern
#

bruh

#

I had a better soln

hot hull
#

Share code

distant sun
#

Why System.in

#

like why the backticks

onyx loom
#

come join gaby#

prisma wave
#

bc in is a keyword

distant sun
#

ah

lunar cypress
#

^in kotlin

prisma wave
#

it's like calling a variable final

#

you need to use backticks

old wyvern
#

Integer.toBinaryString(Integer.parseInt(T) | Integer.parseInt(T2))
@hot hull

prisma wave
#

1 sec wait for me

hot hull
#

Jesus

old wyvern
#

had to ad the extra zeros

lunar cypress
#

@old wyvern that does not work

prisma wave
#

that will remove leading zeros

lunar cypress
#

yeah because of padding

old wyvern
#

exactly

#

As i said

#

that was my initial attempt

#

xD

hot hull
#

You should share code yugi ๐Ÿ˜‰

old wyvern
#

oh there

lunar cypress
#

it was also my initial attempt

onyx loom
#

aj wtf

lunar cypress
#

but the binary stuff never goes right

obtuse gale
#

I thought i could 5000iq it ok

#

shutup nerd

onyx loom
#

๐Ÿ˜‚

hot hull
#

hAvE yA hEaRd Of SpAcEs smh

old wyvern
#

xD

#

for(int i = 0; i<T.length();i++)res+=((T.charAt(i) == '1' || T2.charAt(i) =='1') ? "1":"0");

onyx loom
#

๐Ÿ‘ next ๐Ÿ‘ game

prisma wave
#

yep i'm ready

#

let's go

lunar cypress
#

@onyx loom you're committed to submitting nonsense results are you lmao

old wyvern
#

join km and john

onyx loom
#

โ˜น๏ธ

old wyvern
#

frost

#

@hot hull

onyx loom
#

IM TRYING MY BEST

hot hull
#

wat

old wyvern
#

you in?

hot hull
#

Soz was getting a drink

old wyvern
#

alrighty

hot hull
#

Oh god the 3d thingy would be useful here lol

onyx loom
#

damn

#

i had this challenge in a college book

#

if i wouldve learnt how to do it in kotlin

#

id be winning

prisma wave
#

mine is a massive hack

onyx loom
#

ok now let me copy it

heady birch
#

What is that

#

Clojure

#

๐Ÿคข

onyx loom
#

yes

lunar cypress
#

those tasks are absolutely shit to do in clojure

heady birch
#

lisp ass syntax

prisma wave
#

clojure is a lisp

lunar cypress
#

wow

prisma wave
#

i think?

lunar cypress
#

who'd've thought

heady birch
#

((((((when )ds) dsfa))fsda))))

lunar cypress
#

yeah keep making fun, noobs

prisma wave
#

((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( return 3 ))))))))))))))))))))))))))))))))))))))))))))

lunar cypress
#

what

old wyvern
#

oof

lunar cypress
#

90%

heady birch
#

Only reason i hate it

lunar cypress
#

is you've never tried it

heady birch
#

is because my eyes pobably cant deal with the (())

prisma wave
#

the last test was 1

lunar cypress
#

oof

old wyvern
#

belbnejbnejbn

#

xD

prisma wave
#

it had to be # instead of ```

#```

#

so kotlin if(N==1) { println("#") return }

#

ez

old wyvern
#

Does cpp have something built in for this?

prisma wave
#

no clue

#

probably

lunar cypress
#

for what?

old wyvern
#

I remember the professor teaching us something about it

#

for what?Ez strng formatting

prisma wave
#

doesn't seem like it

old wyvern
#

im pretty sure tho

onyx loom
#

hmm i was missing a couple lines

#

damn i was so close

old wyvern
#

one sec lemme try to find it

lunar cypress
#

I mean you could do this with hacky string formatting

prisma wave
#

@onyx loom that was right

#

idk why you got it wrong

onyx loom
#

yeah stupid website ๐Ÿ˜ 

old wyvern
#
              << "setw(6):" << std::setw(6) << 42 << '\n'
              << "setw(6), several elements: " << 89 << std::setw(6) << 12 << 34 << '\n';```Something like this
lunar cypress
#

ohhh

hot hull
#

ayy

old wyvern
#

I completely forgot what everything does

prisma wave
#

oh god

old wyvern
#

should probably look it up before exams

lunar cypress
#

yeah that stuff

prisma wave
#

that's hideous

hot hull
obtuse gale
#

I feel i did this a weird way

prisma wave
#

share code

obtuse gale
#

o yea

prisma wave
#

yeah that's very weird

obtuse gale
#

lol

prisma wave
#

wtf is even happening there lmao

#

@ocean quartz you good?

ocean quartz
#

Done i think

prisma wave
#

๐Ÿ‘

onyx loom
#

how come i was last ffs

lunar cypress
#

smh my head

ocean quartz
#

Was failing a bit because it had to be until instead of ..

obtuse gale
#

oh god

onyx loom
#

how have u finished already....

#

i literally just read it

prisma wave
#

because it's literally 1 line in kotlin

#

probably is in java too

obtuse gale
#

๐Ÿ˜ฎ

onyx loom
#

share

prisma wave
#

||println(W == W.reversed())||

obtuse gale
#

oh

lunar cypress
#

bm how tf are you so fast

onyx loom
#

fuck

prisma wave
#

educated guess

onyx loom
#

i didnt quite think it through LMAO

prisma wave
#

String.reversed() should exist so I tried it

#

and yes

#

@onyx loom you need to test it first lmao

onyx loom
#

ecksdee

prisma wave
#

ok i gtg

#

wp guys

obtuse gale
ocean quartz
#

Oh i'm dumb

#

mine is the same as BM's but his is much more simplified

prisma wave
#

๐Ÿ˜Ž

onyx loom
#

he smort

lunar cypress
#

the cool thing about the clojure template is that it's almost always wrong

prisma wave
#

lmao

lunar cypress
#

and I first have to adjust it

old wyvern
#

What have I made

#

oof

lunar cypress
#

for example (read) doesn't read a string like Scanner#next()

old wyvern
#

god

lunar cypress
#

It literally reads it as source code

#

so on strings it thinks it's a symbol

topaz bay
#

Imagine if that clash thing allowed you to use odin

#

:)

prisma wave
#

that would SUCK

lunar cypress
#

did you steal that name btw

old wyvern
#

it would be left unused tho

topaz bay
#

fuck you kid

lunar cypress
#

I saw another language called odin

old wyvern
#

xD

ocean quartz
#

It'd probably lose to python on shortest code as well

lunar cypress
#

rather big one, too

topaz bay
#

I got the name from... Odin...

#

From Asgard..

#

lol...

lunar cypress
#

Yeah but you know what I mean

old wyvern
lunar cypress
#

If I called my language Java people would also ask

#

And saying "I named it after the island" doesn't really answer that

topaz bay
#

Except no one knows this odin language

#

Didnt even know it existed until just now

prisma wave
#

you're a fraud

lunar cypress
#

Ah you're a reference for everything of course

topaz bay
#

What the hell? This looks like Go

ocean quartz
obtuse gale
#

i gtg

topaz bay
#

This looks almost exactly like Go

hot hull
#

Was it just me or was the loop only giving 1 output?

#

I might be dumb rn

lunar cypress
#

last round for me

ocean quartz
#

Was just checking if W was the same as W reversed

old wyvern
#

MW

#

bm

ocean quartz
#

He gone

old wyvern
#

ah alrighty

hot hull
#

Jesus

lunar cypress
#

wtf

distant sun
#

why do you guys clash only when I can't play smh

hot hull
#

I legit have no clue what I'm looking at..

ocean quartz
#

@distant sun When can you play?
We spent all day doing it yesterday

lunar cypress
#

wow I had 2 typos

#

god damn it

old wyvern
#

some of the differences

#

of difference of the somes

#

some

#

xD

obtuse gale
#

Oof its currently 1AM and ive got something due tommorow

#

fuckkkkk

lunar cypress
#

F

#

good luck

#

and bye

hot hull
#

You gotta be shitting me

distant sun
#

@distant sun When can you play?
We spent all day doing it yesterday
@ocean quartz tag me next time smh

hot hull
#

At first I thought you had to not include the 4's since there was so many..

ocean quartz
#

I did xD

distant sun
#

I'm free in like 1h

old wyvern
#

join gab

#

oh ok

ocean quartz
#

Sure thing

distant sun
#

no you didnt lol

old wyvern
#

@lunar cypress join

hot hull
#

sTaRt

ocean quartz
old wyvern
#

xD

#

its explained on top

#

A Syrac suites are every number in the series when you use the following function on any number N:
f(N): even ? N/2 : 3*N+1 till the current syracuse suite is 1

hot hull
#

Yeh nah I'm good

#

I love how it gives a 0 even if the first test pases

old wyvern
#

||String a = "";
while(n!=1){
a+=n+" ";
if(n%2==0)n/=2;
else n=n*3+1;
}
System.out.println(a+"1");||

hot hull
#

That's it for me, pce

#

(for rn)

ocean quartz
#

Me too

old wyvern
#

sam

#

same*

#

ciao

jovial warren
#

when you complain about a domain already being registered and it turns out you're the one who registered it and just kinda forgot about it :/

distant sun
#

lol what

jovial warren
#

basically I was complaining about bardy.me being registered since I get a free .me domain with namecheap as part of my GitHub Student Developer Pack, and obviously I'd already claimed that domain before, and just kinda forgot about it, and until I logged in to my namecheap account I didn't realise that it was mine lol

ocean quartz
#

I lost a domain like that, forgot to renew it then it would take 3 months to go into auction or something like that and it'd cost 180$ wtf

distant sun
#

fuck namecheap for that

#

tbh

ocean quartz
#

Was actually Godaddy in my case

distant sun
#

that too

jovial warren
#

keeps complaining that waterfox isn't a supported browser since waterfox classic uses an older version of firefox for backwards compat

#

even though it works perfectly fine

jovial warren
#

"Company: help-chat" yeah that sounds like you

distant sun
#

ye

old wyvern
#

you playin bard?

#

and gab?

distant sun
#

later

jovial warren
#

I'm in

old wyvern
#

@distant sun

distant sun
#

im in class

old wyvern
#

rip

#

ew

#

rip

#

xD

#

xD

jovial warren
#

yeah I had no idea

old wyvern
#

Im not sure what tests my soln failed for

#

its mathematically valid

jovial warren
#

you give it 4 and you get the sum of 2, 4, 6 and 8, I mean wtf?

old wyvern
#

arithmetic series

#

a=2 d=2

jovial warren
#

maybe I haven't studied that yet

#

that was annoying

old wyvern
#

lol

jovial warren
#

we really need to get some more players here

#

lemme ask if my friend wants to play as well

old wyvern
#

Im thinking about trying linux, any suggestions?

#

Sure

#

Im thinking about trying linux, any suggestions? @jovial warren

jovial warren
#

arch linux will be way too complex for new linux users

old wyvern
#

yea im going for mint

jovial warren
#

never used mint

distant sun
#

nvm I have to go back :))

old wyvern
#

rip

jovial warren
#

somehow my monstrosity does the job lol

#

also my friend said he's currently doing puzzles lol

old wyvern
#

what in the hell is that

jovial warren
#

it's advent of code

old wyvern
#

Day 1: The Tyranny of the Rocket Equation

#

xD

prisma wave
#

@old wyvern I personally quite like Manjaro on KDE. Doesn't require much setup, comes with most things preinstalled, and looks nice enough

old wyvern
#

having a look one sec

hot hull
#

What time is it for y'all americans rn?

true bane
#

Yo

#

does anyone have the docs for the AutoSell API?

prisma wave
#

Gaby does iirc

#

hm

#

or not

hot hull
#

Doesn't the spigot page have them linked?

true bane
#

nope

hot hull
#

?autosellapi

compact perchBOT
#
FAQ Answer:

Here you can find the API to hook into Clip's plugin AutoSell, which was made by vk2gpz - https://www.spigotmc.org/resources/62935/
Please do not contact Clip for help with this particular resource.

true bane
#

cheers

jovial warren
#

ffs

#

also since when did ; work in Python?

prisma wave
#

Since always iirc

#

It's just not advised

#

Same with kotlin, you can use semicolons but they advise you don't

lunar cypress
#

Day 1: The Tyranny of the Rocket Equation
@old wyvern Advent of Code is really nice

#

can recommend

#

although it gets very, very hard

old wyvern
#

I see. Ill give it a try tonight ๐Ÿ™‚

lunar cypress
#

I did half of it last year

#

Then I just couldn't do it anymore, it took me too long

#

In one task you have to calculate a simplified solar system and the point in time when it reaches the same constellation for the first time again

#

that one ended me

#

or was it the orbit of a planet

#

I don't remember

old wyvern
#

o.o

lunar cypress
#

It's always a two part thing. The first part for this one was like "calculate the 1000000. state of the system" and if you solved that naively, the second part would take thousands of years to calculate

#

and I still have not a damn idea

old wyvern
#

xD

#

welp

#

ok it jumped to 500kbps randomly

#

700*

jovial warren
#

TSC just got raided rip

old wyvern
#

wha?

#

@jovial warren

jovial warren
#

just got that

#

so I responded with that

lunar cypress
#

That's not a raid though

#

Those dm bots are just everywhere

jovial warren
#

also I just boosted and got an x6 multiplier

#

time to get to chatting

#

@lunar cypress they announced they were getting raided

prisma wave
#

Quick! Someone talk about kotlin

lunar cypress
#

Dae kotlin good java bad?

prisma wave
#

Unpopular opinion

#

Kotlin good Java bad

#

It's a very underrated language actually

lunar cypress
#

Is it? Please do elaborate

jovial warren
#

yeah Kotlin > Java any day lol

onyx loom
#

kotlin

trim hare
#

If popularity is purely the basis for an opinion, then that doesnโ€™t mean much

onyx loom
#

did u guys know kotlin is good?

ocean quartz
#

I'd say underrated by those who never used it, overrated by those who do xD

prisma wave
#

I would LOVE to elaborate! Kotlin is a high level, statically typed language made by Jetbrains. It most popularly targets the JVM, but also supports JS and Native Code

#

Would you like to hear another paragraph?

trim hare
#

Another tool in the tool belt that has pluses and minuses, but isnโ€™t the second coming

ocean quartz
#

Is Kotlin native faster than JVMs? thonking

onyx loom
#

yes please assertTrue(kotlin.isGood)

prisma wave
#

Is Kotlin native faster than JVMs? thonking
Possibly somewhat. It's mostly made for running kotlin on systems that don't have a JVM

onyx loom
#

so android?

prisma wave
#

Android has a JVM

ocean quartz
#

I mean android is jvm

onyx loom
#

o

prisma wave
#

It uses a different bytecode format though

onyx loom
#

didnt know ๐Ÿ™ƒ

prisma wave
#

Yeah Java is kind of ideal for Android

#

Because WORA

#

iOS can use native code because they know their target devices

onyx loom
#

wora? u are intriguing me

#

please keep talking

prisma wave
#

Write Once, Run Anywhere

onyx loom
#

oh very nice

prisma wave
#

Once of the main Java features

onyx loom
#

now i see

#

this is good information this is filling my big brain

trim hare
#

Pretty much, as long as the architecture supports the JVM

onyx loom
#

look how big it is now

prisma wave
#

Has anyone heard about kotlin coroutines? They are a concurrency model that allows programmers to write multithreaded code that looks sequential

#

That's a huge brain

lunar cypress
#

Woah amazing

trim hare
#

Thatโ€™s not a feature unique to kotlin

prisma wave
#

No it's not

#

But kotlin has it

#

So I will talk about it

ocean quartz
#

Oh yeah BM, you might need to help me out with coroutines at some point

onyx loom
#

so kotlin is good right?

ocean quartz
#

So i can stop using future

prisma wave
#

because as we ALL know: kotlin good Java bad

#

Sure I can try give a hand

onyx loom
#

kotlin good java bad

prisma wave
#

I only actually figured out how they work today

#

I linked a good article in #off-topic which shows quite well how they work

onyx loom
#

link it again

ocean quartz
#

What would you use instead of supplyAsync then thenAcceptAsync?

prisma wave
#

Nothing

#

You write the code as if it's blocking

#

Eg kotlin val user = getUserFromDB(id) user.something()

#

No futures needed

ocean quartz
#

Here is what it does for me with future, I start inserting values to the database async, once it's done it'll send a message

#

Ooh interesting

prisma wave
#

You basically would do that example then

ocean quartz
#

Imma give it a try in a sec then

prisma wave
#

getUserFromDB would be a suspend function that uses the IO dispatcher

lunar cypress
#

There's probably facilities to integrate coroutines with "traditional" async code

prisma wave
#

Probably

lunar cypress
#

I know there is for Flow

prisma wave
#

But mixing concurrency patterns seems like a bad idea

lunar cypress
#

It's not a mix. If you have to communicate to some outside resource how are you going to do that?

prisma wave
#

Oh yeah I see what you mean

#

From what I know a lot of kotlin libraries already support coroutines

lunar cypress
#

You either block in the coroutine (possible, but not really desirable) or you convert it somehow

#

Yeah but I mean there are cases

#

But most of the time you should indeed find yourself a library that already has support

ocean quartz
#

Suspend doesn't block the main tread does it?

prisma wave
#

I'm not sure about that one. I imagine there are libraries that make suspending extension functions for Futures for example

#

No

ocean quartz
#

Nice

lunar cypress
#

But that is only for java interop, you shouldn't create futures in kotlin

prisma wave
#

Absolutely not

#

@ocean quartz suspend means that the function can be paused mid-execution

lunar cypress
#

But yeah if a library gives you a CompletableFuture you may use that

ocean quartz
lunar cypress
#

Suspending is like running everything after it in a callback

#

So while the thing is done, the thread is released for other tasks

ocean quartz
#

When i think about it the accept doesn't make sense to be async

lunar cypress
#

In this case I would probably just block

#

Coroutines are executed on a thread pool, possibly even the fork join pool, which supplyAsync uses too

#

So there isn't really a difference there

#

You can make a custom coroutine context or something of you want proper suspending

prisma wave
#

you shouldn't block that

#

you should have 1 suspending function in the IO dispatcher to do the sql call

#

that would return the measureTimeMillis or whatever

ocean quartz
#

I went specifically with async because it was blocking the main thread for 3 minutes

prisma wave
#

then you call that function as normal, and treat it as if it was blocking

proper patio
#

Java is like cutting butter with a hot knife.

prisma wave
#

Not sure about that one chief

ocean quartz
#

You do it fast and make a mess while doing it?

onyx loom
#

kotlin*

ocean quartz
prisma wave
#

pretty much

ocean quartz
#

Why does it say suspend is redundant?

prisma wave
#

test should be withDispatcher(Dispatchers.IO) though

#

on which function?

ocean quartz
#

On the test function

proper patio
prisma wave
#

hmm

proper patio
#

This is true for everything in life

ocean quartz
#

Where would the withDispatcher(Dispatchers.IO) go?

prisma wave
#

around everything

#
withDispatcher(IO) {
  //everything in here
}```
#

that makes the coroutine be ran off the main thread

#

that's probably why it's saying it's redundant btw

ocean quartz
#

Says there is no function called withDispatcher

#

Maybe i am implementing the wrong coroutines

prisma wave
#

nvm it's withContext

#

my bad

ocean quartz
#

Oh yeah that fixed the suspend stuff

lunar cypress
#

You should be able to directly launch it with that

ocean quartz
#

Let me try it out

lunar cypress
#

Since withContext only works from within a coroutine scope, no?

prisma wave
#

indeed

#

and suspend functions are coroutine contexts

lunar cypress
#

Yeah but I mean how do you launch the coroutine currently?

prisma wave
#

usually you'd use something like GlobalScope.launch no?

ocean quartz
#

Shit, that makes me need to put suspend on the command method which will throw an error on the framework

prisma wave
#

you don't need to

#

you can do something like GlobalScope.launch inside the command function

#

which makes a new coroutine

ocean quartz
#

Ooh

heady birch
#

Anyone got an idea how I can speed this up

#

Running locally on same machine as DB brought big big improvements

#

But the searching dao's is still slow

trim hare
#

Would caching be useful?

ocean quartz
prisma wave
#

yay

trim hare
#

โ€œSo whenโ€™s this operation going to complete?โ€ โ€œSometime in the Future.โ€

prisma wave
#

Futures bad

#

Coroutines good

#

give me attention

#

now

onyx loom
#

kotlin good java bad?

heady birch
#

โ˜น๏ธ

ocean quartz
#

Well it was taking 190 seconds with future and 52 with coroutines

prisma wave
#

190 SECONDS???

onyx loom
#

ah yes

trim hare
#

Youโ€™re not going to sell that to me if youโ€™re not foaming at the mouth

ocean quartz
#

Yup, it was taking a while

prisma wave
#

that's like

#

3 minutes

#

????

ocean quartz
#

Yeah i told you it was blocking the main thread for 3 minutes xD

prisma wave
#

wtaf

trim hare
#

Any luck, Niall?

ocean quartz
#

About 1500 inserts

prisma wave
#

jesus

trim hare
#

Can you batch them? Thatโ€™s basically what the coroutine is accomplishing

prisma wave
#

no clue how coroutines sped it up THAT much

#

but nice I guess

heady birch
#

whats this

#

spring

trim hare
#

Is this... a Spring?

prisma wave
#

call me controversial

#

but Coroutines > Spring

heady birch
#

๐Ÿ˜ 

ocean quartz
onyx loom
#

156s

trim hare
#

What are you saving? Chunks?

ocean quartz
#

It literally says what's being saved in it xD

trim hare
#

Just messages, and that takes 2:30?

ocean quartz
#

Yeah, around 1500 messages

prisma wave
#

are you not able to do it in bulk or something?

trim hare
#

Is this a conversion that happens regularly or a one off thing

heady birch
#

What are you using

ocean quartz
#

Can't BM
And it's a one off thing to sync of data if the bot goes offline for too long

prisma wave
#

hm fair enough

heady birch
#

What are you using
@heady birch

prisma wave
#

coroutine everything

heady birch
#

Dont tag me please..

prisma wave
#

tag me

trim hare
#

Why not queue up changes and schedule them? Instead of all at once?

prisma wave
#

if you're doing it async who cares

onyx loom
#

@prisma wave

prisma wave
#

<3

#

thanks

onyx loom
#

NP

ocean quartz
#

It's faster this way, plus it's like BM just said, it's async it doesn't matter much

heady birch
#

Yes it does

#

Slower than spring

prisma wave
#

lol

#

i'm afraid not

heady birch
#

1500 messages in 2 mins

trim hare
#

And what happens if it gets interrupted?

heady birch
#

Seriosuly spring could do that in a couple seconds with proper batching

ocean quartz
#

It's a bot for my server, i don't care if it gets interrupted xD

prisma wave
#

Spring bad coroutines good

heady birch
#

I can insert 449222 records in under 5 minutes in spring

prisma wave
#

they are completely different things but who cares

trim hare
#

This is why Hal 9000 went crazy

heady birch
#

without any relations

ocean quartz
#

Niall tbh i think what slows it so much is having to iterate through all channels and queue up the past 100 messages for each channel

#

Just inserting would be probably be fast

heady birch
#

That will be it

#

Why not put it all in a list then do it

#

I doubt it would rn out of memory

ocean quartz
#

The amount of operations would be the same, so would the time to do it all

#

Pretty sure this is the slow down of the operations channel.history.retrievePast(100).complete()

prisma wave
#

probably yeah

#

you might want to queue that and do it in a callback based fashion

#

you might also find something like this useful

#
suspend fun <T> RestAction<T>.await() = suspendCoroutine<T> { continuation ->
    queue(
        continuation::resume,
        continuation::resumeWithException
    )
}```
ocean quartz
#

I mean i made my own lib for commands xD

lunar cypress
#

you may also find a library that naturally supports coroutines more useful

ocean quartz
#

Speaking of which i gotta fix a bug in it

heady birch
#

help me

#

Hold the F up

#

Why is it inserting fast...

#

๐Ÿ˜ฎ

#

@frail glade Please make my name CEO of enterprise

onyx loom
#

boost

heady birch
#

what

#

I ust want my name

#

dont want no pink or smilies

onyx loom
#

u dont need to have a pink name

#

im boosting and have purple

heady birch
#

It opened some scammy popup

#

I need to pay 4.99 usd

#

virus

onyx loom
#

๐Ÿ˜‚๐Ÿ˜‚

prisma wave
#

wow sounds like a virus

#

don't give it your bank details

remote goblet
#

@topaz bay

heady birch
#

wait if I boost

onyx loom
#

thats cursed

heady birch
#

nah

#

You have boosted for me

#

change my name

remote goblet
#

it's beautiful

onyx loom
#

WHAT

heady birch
#

MY KINDEST PLEASURE,
niall

jovial warren
#

we making use of all those tier 3 perks?

heady birch
#

russian and chinese addresses like hitting my poor VPS 24/7

#

like

onyx loom
#

๐Ÿ˜•

heady birch
#

who the heck is Beijing National Scientific Research Center

#

Fuck off

onyx loom
#

they're doing science

jovial warren
#

lol

onyx loom
#

so they need to collect data for the experiment

jovial warren
#

what's your host @heady birch ?

topaz bay
#

@remote goblet gay

onyx loom
#

of which it will go to the government to confirm the data

heady birch
#

๐Ÿ˜

jovial warren
#

also if there's that many requests to log in to the root account you should disable root login or setup fail2ban

#

they're probably just bots trying to brute force the root password, happens to literally everyone mate

heady birch
#

Already got fail2ban root ssh is disabled

#

Wonder what experiment their running?

jovial warren
#

running an experiment on their new brute forcing software

onyx loom
#

it seems very intriguing

#

their next test subject: the whitehouse

heady birch
#

Their not lyign

#

It literally is research

jovial warren
#

lol

#

also, even though I deleted my old service offer post, Barry still tells me to wait a month

#

anything anyone can do about that?

onyx loom
#

nop

#

service channels reset tomorrow anyway

#

if u need a new service post / change it
u can edit it

hot hull
#

It's anti bumping

jovial warren
#

I can't edit a deleted post :/

onyx loom
#

service channels reset tomorrow anyway

jovial warren
#

yeah I saw that

onyx loom
#

u can post then ๐Ÿ™ƒ

jovial warren
#

yeah

#

and hopefully I don't get someone asking me to make npcs

onyx loom
#

lmao wtf

#

whats wrong with citizens for them?

jovial warren
#

what's wrong is that I have less than 0% of my knowledge dedicated to usage of the citizens api

#

a.k.a I got absolutely no clue

trim hare
#

have to start somewhere

#

Figure out how to create a basic Trait and integrate it into the system, even if it's something as simple as persisting a string and having the npc speak it.

jovial warren
#

fair point

#

I'm not a massive fan of depending on closed-source projects though

onyx loom
#

yh

jovial warren
#

guessing it's "freemium" then

onyx loom
#

yup

prisma wave
#

I mean citizens has always been free

#

Even now it's premium

#

It's still free if you don't want to pay

old wyvern
#

But no support for free I think

quiet sierra
#

Citizens still offers free support

#

and they even tell people that citizens is free

#

The premium part is a donation and they offer a free link on their premium page

old wyvern
#

I see

jovial warren
#

what's that principle acronym again anyone?

old wyvern
#

which?

jovial warren
#

can't remember

#

begins with S I think

old wyvern
#

SOLID?

jovial warren
#

that's the one

#

cheers

old wyvern
#

๐Ÿ‘Œ

old wyvern
#

rip

lunar cypress
#

how tf did I get 60% on this

old wyvern
#

same

#

welp

lunar cypress
#

I see your mistake

#

but I don't see mine

old wyvern
#

Whats my mistake?

lunar cypress
#

you were supposed to split by " "

old wyvern
#

ah

#

rip

lunar cypress
#

and print the sum of each

#

which I did

old wyvern
#

should have read the question better

lunar cypress
#

huh nvm something is wrong

#

I'm an idiot

#

I used split-with instead of partition-by

distant sun
#

@old wyvern I can't understand this lol

old wyvern
#

it has to do with counting a specific letter in the list of Strings they give you.
Then there is also the unused 3rd int.
Once you look at both of them youll get the answer

#

||count of 'o' * the 3rd int||

distant sun
#

ye I got that

jovial warren
#

anyone using linux, run curl parrot.live in your terminal lol

distant sun
#

I was trying to understand how to get the number that has to me multiplied with the 3rd int :))

old wyvern
#

well I was doing java so
||int count = 0;
for (int i = 0; i < N; i++) {
String row = in.nextLine();
count+=row.chars().filter(a->((char)a)=='o').count();
}||

distant sun
#

yup

#

it was actually cool ngl

old wyvern
#

ikr, im addicted to this xD

distant sun
#

@lunar cypress clojur? xd

lunar cypress
#

?

old wyvern
#

Clojohn

lunar cypress
#

I did this quite badly

#

messed up a couple of times

old wyvern
#

ah

lunar cypress
#

share code gaby

distant sun
#
class Solution {

    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        int S = in.nextInt();
        int count = 0;

        if (in.hasNextLine()) {
            in.nextLine();
        }

        for (int i = 0; i < N; i++) {
            count += in.nextLine().chars().filter(ch -> ch == 'o').count();
        }

        // Write an answer using System.out.println()
        // To debug: System.err.println("Debug messages...");

        System.out.println(count * S);
    }
}```
old wyvern
#

You can click the "Share" button on the result page btw

lunar cypress
#

^

distant sun
#

ah xd

old wyvern
#

xD

distant sun
#

next

old wyvern
#

a dude is still clashing

#

amejonah

lunar cypress
#

we're waiting for our boy

distant sun
#

who is that

old wyvern
#

John's friend I think

distant sun
#

we need a channel for this xd

old wyvern
#

xD

lunar cypress
#

sometimes the invites don't seem to work

old wyvern
#

it timed out for me

#

I was on another window

ocean quartz
#

I'll do the next one, in the middle of a tft match xD

old wyvern
#

tft?

ocean quartz
#

Team fight tactics

old wyvern
#

Alrighty

distant sun
#

nice one

steep grove
#

Join plss

gentle coyote
#

Hey guys

old wyvern
#

Why does facebook look white?

distant sun
#

:))

#

it has dark theme now btw

gentle coyote
#

facebook looks like its from 1989

lunar cypress
#

just had a brain fart there

distant sun
#

F

#

share code

lunar cypress
#

you don't wanna see this

ocean quartz
#

Nothing is in english in it

distant sun
#

I do xd

old wyvern
#

you don't wanna see this
Well not like it makes any sense to us โ˜ ๏ธ

#

xD

distant sun
#

oh you were right

lunar cypress
#

I'm too greedy

#

Literally had to replace partition with partition-all

#

god damn it

#

I had so much time

old wyvern
#

lol

gentle coyote
#

just put some shitcode in there lmao

lunar cypress
#

wdym

gentle coyote
#

just have a look at my code

lunar cypress
#

what's your point

gentle coyote
#

that you shouldn't wonder why the code looks that shitty

lunar cypress
#

I do not, I'm just mad that I didn't use the correct function

gentle coyote
#

lol

lunar cypress
#

(apply str (flatten (map reverse (partition-all 2 S))))

#

This is all I had to do

gentle coyote
#

ah yes

#

(())

old wyvern
#

((((())(()()()()((((()()((()))))

lunar cypress
#

(->> S (partition-all 2) (map reverse) flatten (apply str)) like that more?

#

less parens than go btw ๐Ÿ˜‰

distant sun
#

75%, I've done worse xd

#

Stupid me decided to use smth i've never liked, Iterator xd

ocean quartz
#

Confused af on this one

distant sun
#

it's actually easy

ocean quartz
#

Pretty sure i am overcomplicating it

distant sun
#

me too :))

old wyvern
#

welp imma go sleep now

#

its 4am

distant sun
#

gn

old wyvern
#

ciao

lunar cypress
#

๐Ÿ‘‹

ocean quartz
#

Meh

#

I'm bad

distant sun
#

let's go boyz

ocean quartz
#

Oh i'm dumb

gentle coyote
#

The sounds of condingame are literally the ones you get when you record a whatsapp audio

#

What's that

distant sun
#

wtf

ocean quartz
#

I have no idea

#

I thought it was binary

lunar cypress
#

that is an absolutely easy one

gentle coyote
#

I have no idea
same

distant sun
#

what have you done @lunar cypress

lunar cypress
#

||binary?||

distant sun
#

o

gentle coyote
#

holy

#

thats easy af

#

and it's embarassing that it took so long

distant sun
#

what's the equivalent of that in java?

lunar cypress
#

I used java interop

ocean quartz
#

Oh i was right it was binary

lunar cypress
#

Long.toBinaryString

distant sun
#

well F

lunar cypress
#

or what lukas did works in java as well I believe

ocean quartz
#

Integer also has that

lunar cypress
#

yeah yeah, in clojure the default number type is long

distant sun
#

I did not like this one xd

lunar cypress
#

well it was a no brainer

ocean quartz
#

I hate reverse ones

distant sun
lunar cypress
#

wtf

#

it passes the wrong number of args to my main function

#

ok nvm xd

distant sun
#

:))

lunar cypress
#

got em

distant sun
#

oh ..

lunar cypress
#

the reverse ones are fine if it's not maths

distant sun
#

use lisp Johnny

#

I dare you

lunar cypress
#

I am using lisp the entire time lol

distant sun
#

Clojure it's lisp?

lunar cypress
#

yes

distant sun
#

o

lunar cypress
#

a dialect

distant sun
#

maybe this time I will do it better

ocean quartz
#

Wait is Lisp JVM as well?

lunar cypress
#

Clojure runs on the JVM, yes

#

Lisp is more like a language family

ocean quartz
#

Ooh interesting, good to know

distant sun
#

@lunar cypress did you select reverse mode only? ::))

lunar cypress
#

I am clueless with this

distant sun
#

same here

#

:))

obsidian dragon
#

can someone help me setup Bungee voting?

gentle coyote
#

I hate Go for this one lol

ocean quartz
#

Same for Kotlin

#

Had it done for a while but stupid .0

lunar cypress
#

think i got it

gentle coyote
#

have a look at my code matt. you may see what my problem was

#

it just let out the .something. I don't know why, but I had to parse the integers into floats to make it work.

ocean quartz
#

Yeah, I did mine but it was 2.0 instead of 2 so had to check if it was a whole number or not and print it's int version

gentle coyote
#

One of the operands must be a floating-point constant for the result to a floating-point constant. ah yes

lunar cypress
#

I should have looked at the name of the input params earlier

ocean quartz
#

Gab it was just ||(x1 + x2) / 2 and (y1 + y2) / 2||

distant sun
#

I saw

lunar cypress
#

wait what it's still wrong

#

It's the middle between the two points right?

ocean quartz
#

Yup

lunar cypress
#

dunno what's wrong then

#

screw it

prisma wave
#

you guys still playing?

prisma wave
#

yay

lunar cypress
#

should go to sleep soon though lol

#

wish I had british time sometimes

prisma wave
#

it's pretty late here too

lunar cypress
#

i know

ocean quartz
#

Almost midnight

#

Gaby, you're 2 hours ahead right?

distant sun
#

ye

lunar cypress
#

I'm 1 ahead

#

oh no

#

not this again

prisma wave
#

again?

ocean quartz
#

Had this one before too

prisma wave
#

oh lol

lunar cypress
#

god that took me way too long

#

had to look up how to import java classes in clojure lol

prisma wave
#

why did you need java classes lol

lunar cypress
#

Because I have a big brain

ocean quartz
#

Using date?

lunar cypress
#

I shared my code

prisma wave
#

oh you sneaky devil

ocean quartz
#

Pretty smart tbh

lunar cypress
#

implementing this yourself in a non imperative way - good luck

prisma wave
#

yeah that doesn't sound easy

gentle coyote
#

wtf

distant sun
#

:))

gentle coyote
#

why doesn't this work holy shit

#

I don't get it

lunar cypress
#

lol just import some go time module

gentle coyote
#
package main

import "fmt"
import "time"

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/

func main() {
    var year int
    fmt.Scan(&year)
    tm := time.Date(year, 12, 0, 0, 0, 0, 0, time.Local)
    
    
    // fmt.Fprintln(os.Stderr, "Debug messages...")
    fmt.Println(tm.YearDay() > 365)// Write answer to stdout
}
#

I do

#

holy

prisma wave
#

you guys are cheating

ocean quartz
#

Tbh LocalDate.of(year, 1, 1).isLeapYear would be much easier

lunar cypress
#

Nah it's not cheating

#

also I lost to you xd

gentle coyote
#

it works

#

holy shit this is cancer

lunar cypress
#

I wouldn't have thought that such a game could be addictive

prisma wave
#

it's VERY addictive

lunar cypress
#

but here I am, playing this nonsense at 1 am

prisma wave
#

what's wrong with that?

lunar cypress
#

exam in a few days

#

wow this is the FP problem

prisma wave
#

gotta love FP

lunar cypress
#

shame it will still be longer than kotlin

prisma wave
#

you sure about that?

lunar cypress
#

absolutely

prisma wave
#

idk i can't get lower than 87 characters

gentle coyote
#

same

lunar cypress
#

I'm at 147 over here

#

lol

gentle coyote
#

oh god, I just used a 500IQ move lol

ocean quartz
#

How tf did you do 87

lunar cypress
#

kotlin is bloated

#

that's why

prisma wave
#

BLOATED???

lunar cypress
#

yes

ocean quartz
#

I mean i am doing Kotlin like him and mine is 179

prisma wave
#

it's 1 line

lunar cypress
#

I mean the standard library is

distant sun
#

:))

prisma wave
#

@ocean quartz replace the Scanner stuff with readLine()!!.toInt()

#

saves a nice few bytes

ocean quartz
#

Yeah i have that

#

The problem is the if

#

i%3==0||i%5==0||i%7==0

gentle coyote
#

yeah

prisma wave
#

that's exactly what I have

#

are you doing it declaratively?

ocean quartz
#

This is my line for (i in 0 until readLine()!!.toInt())if(i%3==0||i%5==0||i%7==0)sum+=i

prisma wave
#

oh yeah

#

i'm using IntRange, filter() and sum()

#

brings the size down quite a lot

ocean quartz
#

How do you make it not include the current? I have readLine()!!.toInt().downTo(0).filter { it%3==0||it%5==0||it%7==0 }.sum() but N is also included

gentle coyote
#

nah i can't get any shorter

#

import f"fmt" omegalul

#

just using named imports

prisma wave
#
fun main()=println((1..readLine()!!.toInt()-1).filter{it%3==0||it%5==0||it%7==0}.sum())```
#

this is what I'm using

ocean quartz
#

Meh i'll take second place

#

Didn't wanna copy xD

prisma wave
#

could be worse

#

poor gaby using java

lunar cypress
#

last round

#

for me at least

ocean quartz
#

same for me

prisma wave
#

yeah me too

gentle coyote
#

yup

lunar cypress
#

no

#

fuck this

ocean quartz
#

Oh god

prisma wave
#

uhhh

#

WHAT

gentle coyote
#

oh no

lunar cypress
#

I am not using clojure for that

ocean quartz
#

Can we skip this one? xD

prisma wave
#

i... hate this

lunar cypress
#

what?

#

I get the correct output in the console

#

but it says I'm printing nothing

#

no wait

#

it expects nothing

#

what

prisma wave
#

Yeah me too lol

lunar cypress
#

I have no idea

prisma wave
#

same here

#

wtf?

lunar cypress
#

only works for the ones where the chin is 5 chars

gentle coyote
#

Got it

ocean quartz
#

WTF

lunar cypress
#

nice one

#

works really well

prisma wave
#

OH

#

I got it

#

it's so dumb

lunar cypress
#

how

ocean quartz
#

How yeah

prisma wave
#

you don't pad the right side

#

for some stupid reason

lunar cypress
#

....

#

seriously

ocean quartz
#

Oh fuck off..

#

Ugh i hate this

prisma wave
#

that was fucking stupid