12:00 AM
The first but not the second.

bardcore is songs remixed to sound like they're played with medieval instruments
for example

Does it count as a rickroll if it's not the original?

I think it depends
If it's just a different link to the same video, I say it's underhanded and doesn't count. Bardcore rickrolls would be fun and creative.

it's not a rickroll if you know you're being rickrolled

Bardcore DK Rap is something I didn’t know I needed until I discovered it.

12:03 AM
foka

@AaroneousMiller that sounds amazing

^^ means ಠ_ಠ right?

@AaroneousMiller I need this in my life

@emanresuA sy

12:04 AM
gongul sokit tanitomitami ans vmak

@AaroneousMiller if it doesn't have the line "and then there's Chunky - he's dead" I'mma not be fully happy

@emanresuA "Regret the 'perfect' connection in who?"?

@lyxal will you at least be somewhat happy?

yes

12:09 AM
Is LYAL going to start soon?

S C A L A

Aight let's go
Welcome to the Scala LYAL y'all
5

👏👏👏👏

An easy CMS to start with: Find the first vowel in a string (y doesn't count) (e.g. "yabcd" -> 'a')

(And maybe remove the proof assistants and socks messages)

12:16 AM
Proof assistants could be removed now but socks is important

yeahhhh

Hint: You can treat a String as a Seq[Char]. Here are the docs for Seq
@user (you may assume that the input is all lowercase or all caps)

Hello - I don't like Scala, I will leave

:(

but If you teach me, I will join.

12:23 AM
I've got _.find("aeiou".contains(_)). I haven't figured out how to use regex, but this might be shorter anyway

@Fmbalbuena Great! Do you want to tackle that CMC above?
@Wezl-yizl Nice. There are about 3 ways to shorten that, I'll leave it as a challenge to find them

found one, removing (_)

@Wezl-yizl I was messing around with iterator.takeWhile

Yup, that's the second shortest one

12:25 AM
Is it s/contains/count or something?

Nope, it involves converting the String to another collection type Mystery[T] with an apply method that takes a T and returns a boolean
Hint: it's in the form "aeiou".toMystery

@user I haven't leaned Scala

@user Impossible

Wait, not if statements, == and ||

12:28 AM
"[aeiou]".r.findFirstIn (returns a string)

A character literal is written like 'a', so if you want to check if some variable x is a vowel, you'd do x=='a'||x=='e'||x=='i'||x=='o'||x=='u'

@Wezl-yizl Nice, that's shorter than the "aeiou".contains one

toset!

@Fmbalbuena Don't try TIO, try Scastie
@Wezl-yizl Yup!

12:30 AM
@Wezl-yizl Ugh, I tried toSet

How'd you find it?
@emanresuA It is indeed toSet

But I thought it didn't work

@Fmbalbuena did you click the link .-.

Oh wait, find returns an Option[Char], not a Char, I'm dumb

12:31 AM
@user this is a dumb question, but how do I copy-paste a line from scastie
because it isn't letting me select lines

and shift + left/right arrow doesn't select text either

@user Still Impossible, Input?

Really? It's working for me (Vivaldi+Windows)

I was trying to use it differently
Same (Firefox+MacOS)

12:32 AM
@user ah turns out it's my dark mode extension screwing it up

@user This doesn't work.

@Fmbalbuena Did you click on the link? If you want to use it as a function, you can do x=>x=='a'||...

@user yes

@user I tried val f: Seq[Char] => Seq[Char] = f.filter((x: Char) => "aeiou".contains(x)) but it doesn't seem to work

@Fmbalbuena Here's an example
@lyxal What output did you get? If you're trying to keep all vowels in the string, that should work

12:33 AM
scala stdlib is very consistent 😍

@user value filter is not a member of Seq[Char] => Seq[Char]

Wait output is program code, not CMD?

@lyxal Oh it's supposed to be _.filter not f.filter
You're calling filter on the function itself instead of the argument
@Fmbalbuena In Worksheet mode, the output displays next to your code (it's not part of the code). If you want, you can wrap those expressions in println() and it'll show up in the console like this

i finally figured out how to index into a Seq so that's _.intersect("aeiou")(0) for 23

Ooh, didn't think of that one

12:36 AM
was wondering what all those methods about PartialFunctions of Ints were about :P

@user (this should be _.find("aeiou".toSet) actually)

@lyxal you need '

thank you scastie

12:36 AM
val f: Seq[Char] => Char = _.filter((x: Char) => "aeiou".contains(x))(0)
but that's not the point here
wait
oh
that's a horrible way of showing the result

I thought it was saying like the type of the result is scala char and not showing me the result

Here's a horrid solution:
_.collectFirst {
case c@('a'|'e'|'i'|'o'|'u') => c
}

lmao

@Fmbalbuena The ... was just a placeholder for all the other comparisons to vowels
Did you see this? That's what an isVowel function might look like

12:39 AM

Dude are you just trolling rn

@user Ok, I will not troll

Thanks

12:41 AM
Ok, I have a problem

CMS: Another easy one, find the average of a nonempty list of numbers (Scastie) (this is again mainly to show the stdlib)
@Fmbalbuena Yes?

CMS: Print "Hello, World!", but you can't use theese characters "He, 0123456789"

l=>l.sum/l.length?

Yup, though you can do .size too

12:45 AM
I think the .length is for Java people, it annoys me that there's two methods

lmao

CMS: Sum a list without using sum. Feel free to use recursion

@user for loop, But I can't learn Scala

oh it's l.sum?

@user Quick question: How to make an array of ints?

12:46 AM
@user Why doesn't val f: List[Double] => Double = _.sum/_.size work?

Why not? There are easier ways than for loops, but if that's what's familiar to you, you can try this
@emanresuA Array(1, 2, 3) works, but I'd recommend using a List (List(1, 2, 3))

@user ...and Seq only provides size; length is just a List thing?

@lyxal Because the second _ means you're taking two arguments and you want the size of that second argument

oh scastie is one of those editors that groups characters together into tokens like <= into ≤
cool

@user Uh, For loops and if statements?

12:47 AM
@UnrelatedString You know what, I honestly don't know
@Fmbalbuena If statements are pretty simple too, just do if (cond) { thenDoStuffHere() } else if (otherCond) { blahblahblah } else { blahblah }

@user _.reduce((a,b)=>a+b)

@user for loops?

and it's not like there's a second interface that gives List a length
it's just kinda there

@Fmbalbuena for (elem <- lst) { dostuff }

@user so then how do I refer to the first argument if the lambda definition doesn't specify arguments?

12:48 AM

@UnrelatedString Oh, it might be an extension method

@user Do you mean DLosctuff?

@lyxal ...You don't

@emanresuA (a,b)=>a+b -> _+_

@user elem <- lst?

12:49 AM
@emanresuA Hit save and copy the URL
@Fmbalbuena Yes, the <- is like Python's in

Or JS's of because JS's in makes no sense

@user so then what's the point of the template val f: List[Double] => Double = if it doesn't specify any named arguments and I can only use _?

@lyxal it's just generically here's something to set your lambda to for the test harness below

@lyxal The cognitive dissonance is fantastic X^D

@user x=>x./:(0)(_+_) (Not sure how to use this ternary operator)

12:50 AM
@emanresuA Nice find, there's quite a few variations on that: _.foldLeft(0)(_+_), _.fold(0)(_+_), _.reduceLeft(_+_), _.foldRight(0)(_+_), _./:(0)(_+_), _.:\(0)(_+_) (those last two are deprecated)

val inputlist: [2, 2, 4, 8, 16]
val f: 0
for (elem <- inputlist){
f: f + elem
}
print(f)
Not working

@Wezl-yizl It's not a ternary operator, it's just a curried function. It's deprecated now because people don't like the symbols, but it's equivalent to x.foldLeft(0)(_+_). You'd use it like (0 : x)(_+_) in real code (the fact that /: ends in : makes it right-associative)
@Fmbalbuena : is used to show the type of a variable. Here, you don't need to do that, Scala infers those types for you, just use = instead. Also, list literals have to be written as List(2, 2, 4, 8) instead of [2, 2, ...]
And f needs to be a var so that you can modify its value (vals are final, you can't change their value)

inputlist = [2, 2, 4, 8, 16]
val f: 0
for (elem <- inputlist){
f = f + elem
}
print(f)

And you can turn f = f + elem into f += elem, both are pretty much the same here)

Still not working

12:54 AM
val inputlist = List(2, 2, 4)
var f = 0
Try that

What's wrong with my lambda definition here:
val f : List[Int] => List[Int] = _.scan((a, b) => a + b)
It's gives an error:
Missing parameter type

I could not infer the type of the parameter a.
Missing parameter type

I could not infer the type of the parameter b.
when called on something like:
f(List(1, 2, 3, 4, 5, 6))

:60320061 val inputlist = List(2, 2, 4)
var f = 0
for (elem <- inputlist){
f += elem
}
print(f)

nvm it should be
val f : List[Int] => List[Int] = _.scan(0)(_+_)
because it needs the initial value

Ninja'd
I spent a solid 30 seconds trying to figure that one out
Also, I'm sorry but I need to go have dinner now, I'll just leave a couple CMCs here
CMC: Sort a list of numbers by how many digits they have in binary (with the leading 0's trimmed)
CMS: Cartesian product

1:10 AM
You've got me to do this already

CMS: Convert base A to base 10, CMS: Convert base 10 to base A

@user for(a<-_;b<-_)yield List(a,b)

CMS: Ackermann function with finite recursion

@user That's just plain sorting

@emanresuA I have a issue, See DSO repo

1:21 AM
@user _.sortWith(_.toBinaryString.size < _.toBinaryString.size)

* Wezl went to dinner in the middle of LYAL and nobody minded so

@Fmbalbuena Fixed.

@emanresuA thanks, I will use this one time.

so from base 10 is pretty straightforward but for to base 10 does Seq not supply any kind of unfold? :(
...actually why would that be in Seq
time to actually search
wait no it is in Seq

1:45 AM
Yes, you can use unfold with Option.when

...wish i'd seen when before writing List.unfold(_)(n=>Some(n%10,n/10).filter(_+_>0))

I think I have a couple answers that use it if you want to try beating me
@UnrelatedString i mean this is pretty good
@lyxal try sortBy

@user that requires some sort of ordering though
And I couldn't get it to work

it is cool that multiple arguments genuinely are just single tuple arguments

@emanresuA Yup, you can even do ‘yield a->b’
@UnrelatedString ahahaha

1:47 AM
@user Hm

@lyxal ???
It’s just .sortBy(.toBinaryString)

@UnrelatedString that’s a scala 3 feature and it’s not actually a single tuple, it’s just sugar for pattern matching on the tuple

I have too many tabs, o/ while I clean up

1:49 AM
still cool
and lets you pretend it's the same thing

A funct That takes a tuple would be ((Int),(Int))=>foo whereas a function with two args is just (Int,Int)=>foo
@UnrelatedString definitely

@emanresuA do you not just close everything to the right of an arbitrary tab whenever it gets to like 100~200

It gets to 100 for you? :o

@user you seem to be missing some backticks there

all my tabs are important and special to me. I would never do that to my children

1:51 AM
I switch to a new window when I can’t read the names anymore

except for the TNB ofc

@lyxal lol yeah it’s _.sortBy(_.toBinaryString)

@user firefox enables me by having a high minimum width }:-)

Forgive me, I’m on phone

@user it was complaining about some sort of argument application or something

1:52 AM
Hrm
What message did you get?

I don't remember exactly and I don't have my computer with me rn
But it was saying something about ordering or smth

Oh ok
@lyxal oic you need.size
_.toBinaryString.size, because you can’t compare strings

oh hey it's da Scala time

Lol it’s almost over I think

lmao

1:54 AM
LYAL lasts for 24 hours

CMS: All sublists of an infinite LazyList

We partying for the next day gamers

@user LazyList?

@lyxal oh cool, i can post more tomorrow
@Fmbalbuena look it up, i can’t link now because mobile weak

@user mobile weak

1:56 AM
@user is scala-algorithms.com an up-to-date source?

CMS: Make a LazyList of fibonacci numbers

@UnrelatedString You can do that?

@Razetime I have no idea, I suppose so?

right click?

Oh
Thanks

1:57 AM
Even if it’s old it shouldn’t be completely broken

It took ~15s to close lol

You did this to yourself lol

I did

@emanresuA Can you fix and I will double the DSO posts.

@user there gotta be some proper place to read up to date scala docs

1:59 AM
took me this long to realize it outputs backwards lmao
not that that's necessarily a problem

like cppreference.com

@Razetime oh yeah the scala website itself has a book

@Fmbalbuena That is another bug

mmkay

@emanresuA I will review you, Then i will post every bug.

2:01 AM
in Scala, 8 hours ago, by DLosc
It's true that the Scala book does start off with a bunch of "Scala's type system has this great feature," which doesn't mean anything if you don't know a lot about type system theory (I don't). It might be best to start from this point instead.

It was missing a bytecount update in a different place

anyhow i noticed because i threw together val f:Int=>List[Int]=n=>if(n>0)n%10::f(n/10)else List() about which i'm wondering if there's any way to golf the signature since it seems to demand it

@Fmbalbuena Fixed.

would beat List.unfold(_)(n=>Option.when(n>0)(n%10,n/10)) without it

@user 0#::1#::f.zip(f.tail).map((a,b)=>a+b)

2:04 AM
@emanresuA easy fix, I will review again

tried to hack together some kind of fix combinator but it still complained that it couldn't infer

@UnrelatedString yeah scala doesn’t have hindley milner or anything, and recursive stuff needs type annotations (even when the compiler could theoretically infer it)

why does val LL : LazyList[Int] = 1 #:: 2 #:: 3 complain that value #:: is not a member of Int?

@Wezl-yizl nice!

rip
@lyxal you probably need a LazyList on the right

2:06 AM
@lyxal because 3 is an Int. Try replacing it with 3 #:: LazyList.empty

@lyxal I think that means that it's calling the #:: method on 3, which doesn't have that method
@Wezl-yizl totally not taken from the example in the docs

Good night all, I’m happy to see people interested in Scala o/

@Adám BQN's JS is node.js which is difficult to run in the browser

why would I not be interested in a language with xOrElse! functions :P

2:09 AM
@emanresuA 2 posts, 4 posts if you fix This bug
@emanresuA feature? [ should be infinite loop, WRONG [ is [] but [] is NOP

What do you mean?

@emanresuA Try it online! (Pretend the footer code is empty)

@emanresuA BQN.js is not node.js.
It's perfectly embeddable in any static site, I think you got it wrong.
I even wrote my own online repl for it: razetime.github.io/bqn-repl/

Oh. I had this bqn.js which clearly is node, where's the one runnable in the browser?
@Fmbalbuena I don't care. That's undefined behaviour.

@emanresuA ...

[ is not, and never was, a valid BF program.

@emanresuA then You should raise error

Btw @Bubbler also had a "Try in Browser" thing that was supposed to have offline interpreters for everything

BQN works
And permalinking BQN also works, to my surprise
Oh wait of course it works, I just stole the permalinking code from Vyxal

2:49 AM
I'm considering buying a really cheap cloud server to act as a fallback for my hardware one
That way NP/SP, RTO, OSP, etc. will have all of the reliability of the ✨cloud✨, but without the ridiculous costs

3:00 AM
So remember how I said swimming pools are organised chaos consisting of individual groups of order? Well I think that term also applies to shopping centres
Although they are more annoying than public swimming pools though

Less likely to get peed on tho

More likely to have your toes run over by people or by a trolley

What kind of swimming pools are you going to where there aren't any trollies smh

smh

3:15 AM
Here's a question: is it possible to define a sequence of functions \$f_n : N^n \to N^{n-1}\$ such that none are bijective, but the function \$f = f_1 \circ f_2 \circ \cdots \circ f_n\$ (or, in a looser fashion, in any order) is bijective?
(Assuming \$n \ge 2\$)

smh Mathjax doesn't work in chat

It does for me :P
I think no: consider an inductive argument, we'd need \$f_k \text{ bijective} \implies f_{k+1} \text{ bijective}\$, and that \$f_1\$ is bijective, thus a contradiction

Userscripts?

Yeah
@cairdcoinheringaahing But, this assumes an inductive proof

After looking at the code for oK, I'm not going to try adding it to DSO
It doesn't have a single run function, it takes inputs in K form and requires a seperate file to convert, its error catching code is painful...
oic, TIO uses the repl.js file which is node.js :(

3:30 AM
Did I miss the LYAL?

Some stores have "back to school" sections where they have things like stationery, backpacks, etc etc. I like to stand in front of these displays and laugh condescendingly at the nerds that have to partake in buying objects from this display because I'm a uni student
@Nitrodon LYALs go for 24 hours
So no

@Nitrodon Nope, lasts from midnight UTC to midnight UTC

3:44 AM
@cairdcoinheringaahing Let \$\{e_{k,i}\}\$ be an enumeration of \$\mathbb N^k\$ for \$i=0,1,2,...\$, and define \$f_k(e_{k,i})=e_{k-1,i+1}\$ for \$2<k\le n\$, \$f_2(e_{2,i})=e_{1,\max(i-n+2,0)}\$. \$f_k\$ where \$k>2\$ are not bijections because nothing maps to \$e_{k-1,0}\$, and \$f_2\$ is not because \$e_{2,0}=...=e_{2,n-2}=e_{1,0}\$, but it's easy to see that \$f_n\circ...\circ f_2\$ is, mapping \$e_{n,i}\to e_{1,i}\$ for all \$i\$
I don't see mathjax either so I'll have to trust you can :')

@att I don't think that shows \$f_n \circ \cdots \circ f_2\$ is a bijection does it?

For brevity let's call \$f_n\circ...\circ f_2\$ \$f\$
\$f\$ is surjective: for all \$e_{1,i}\$, \$f(e_{n,i})=e_{1,i}\$. \$e_{n,i}\$ exists.
\$f\$ is injective: suppose \$f(e_{n,i})=f(e_{n,j})\$. Then \$e_{1,i}=e_{1,j}\$, which can only happen if \$i=j\$.
It might be easier to see if you consider \$e_n\$ as a bijection between \$\mathbb N\$ and \$\mathbb N^n\$

4:20 AM
@user is this for vyxal v3 :P
@emanresuA ngn/apl ?
oh DSO has BQN
also did we get another spam wave O_o

4:45 AM
@PyGamer0 Yep! And surpisingly, permalinking works even with glyphs
@PyGamer0 JS apl implementation, works surprisingly well

5:01 AM
@PyGamer0 ... maybe ...

1 hour later…
6:12 AM
Ok, I'm gonna try and compile ngn/k to wasm. Wish me luck!

2 hours later…
7:58 AM
@emanresuA were you successful?

I have a wasm file but no idea what to do with it.
o/

8:32 AM
0

prime aluminium industry is the popular aluminium suppliers in pakistan. You can see list of aluminium price in pakistan. Its is providing the premium aluminium with latest technology of thermal break. Our products are: aluminium windows aluminium doors You can find us: aluminium windows design i...

Butter?
Was there a challenge to interpret !@#\$%^&*()_+

8:56 AM
0

Find the index of the matching parentheses for each character The challenge is simple, find the matching parentheses for every one of the parentheses in a given string input E.g. ()()() -> [1, 0, 3, 2, 5, 4] Always start with the ending parentheses index before the starting parentheses, which is...

@emanresuA BQN errors give [object object]
@emanresuA Is there a way to link to a language on DSO, like tio.run#apl-ngn?

9:34 AM
@Adám Exactly the same :P - dso.surge.sh/#ngn-apl

Neat.

Wow DSO is horrible on mobile
@Adám I’ll see if I can get them to print the actual errors tomorrow

@emanresuA make the svgs smaller

They’re not svgs
They’re icons

Then make the icons smaller

9:38 AM
I’ll see what Ican do

Ok, thanks
@lyxal I need a lot of space for the language selection dialogue but I’ll see what I can do.

Switching the language doesn't update the byte count if there's a change from custom bytes to standard bytes or vice versa

@emanresuA Shouldn't ngn/apl be listed as "APL (ngn)"?
@emanresuA You could do with a font-family styling for input and output.

@lyxal hm, okay. If you can put it on the repo I’ll fix it tomorrow
@Adám that’s changing one line of json, sure

9:48 AM
@emanresuA Since you're dealing with languages that tend to use "funny symbols", you should force something like DejaVu Sans Mono.

@lyxal after some investigation that appears to be lag when loading the bytecounter.

@emanresuA when going from standard to custom, but not the other way around

@emanresuA yeah

Type something in risky and then switch to in floop

I know
Also, opinions on this mobile design:

10:01 AM
Cramped but works. How about removing "DSO"?

True
o/, need sleep

Nah, sleep's overrated.

Don't listen to Adám, sleep is for gamers

I'd remove "Select language too, Or maybe make it just:
Lang: [Ultrarisky________↕] 🔗
▶ 🔗 🏅 M↓ </>
With the bottom icons spread evenly across, and the input field adjusting its width dynamically to fill the width.

10:45 AM
0

I've often seen some questions tagged graphical-output and kolmogorov-complexity that have some answer being image files, and they are often disagreements in the comments. examples: Swiss flag (PNG) Swiss flag (GIF) Iceland flag Carpet an airport Minecraft tool Super Mario RGB colour grid Here's ...