3 hours later…
2:30 AM
in Neon, Mar 1 '18 at 5:13, by Esolanging Fruit
Also note that the Jelly wiki literally calls Jelly "inspired by Jelly". Where is Jelly inspired by J if not in syntax?

6 hours later…
8:26 AM
@H.PWiz thanks! I don't know any julia but I love it already :)

2 hours later…
10:04 AM
18

I define the method of combining a sequence to mean that every number in the sequence is concatenated as a string, then that result is made an integer. [1, 2, 3] -> 123 For every finite sequence of at least 3 consecutive integers, missing exactly one element in the sequence, and this missing e...

-4

Imagine getting up for an urgent meeting, grabbing that towel, rushing to the bathroom in a hurry and end up finding that there’s no water in the tap. You try to find the reason behind it and you discover that the pipe got blocked. You think of taking your bath at your friend’s place but that’s n...

10:24 AM
0

How many countries are in the European Union? On 31 January 2020, the United Kingdom will leave the European Union, the first time that the number of EU member states will decrease. Your job is to take a date (in any format) and output the number of members of the EU on that date, according to...

1 hour later…
11:34 AM
CMC:
2

2 hours later…
1:36 PM
@Adám What's the image? (It didn't load.)

@a'_' Can you see it if you click on it?

@Adám No, imgur was banned altogether.

@a'_' Anywhere I can put the image so you can see it?

@Adám I could think of nowhere else other than GitHub (which may be a bit inappropriate for an image).

@a'_' Does this work?

1:44 PM
@Adám That doesn't seem to work either.

@a'_' This?

@Adám Gist doesn't seem to work.

@a'_' \○/ It is a screenshot of my CPU activity looking like ▁▁█▅█▁█▁▃▁▁ while showing my APL REPL having run the code CPU'HI.'

3 hours later…
4:42 PM
Truly the pinnacle of computing technology.

I need to hand in my code golf badge. I saw an SO question using let a=b=c=10 and didn't immediately realise that this made b and c globals

What language is that?

Based on the let, I'm guessing Javascript.

5:03 PM
Oh yeah Neil is a Javascript user.

5:15 PM
Vim has ruined me. I almost sent an email to a colleague that ended with jk
(because I inoremap jk <esc> and inoremap kj <esc>)

I have a habit of typing o and O quite a bit.
I also hit <esc> pretty much any time I stop typing for a bit, but that tends to be ignored most the time.
My biggest issue is with TIO. I for some reason always forget TIO is not Vim.

That's my biggest problem with every text editor

Do you actually use Vim or nvim btw?

vihan.org/p/tio has vim for TIO, but i neither use it or vim, so don't know how good it is

@PostRockGarfHunter Generally gvim because I'm on windows
But like... The real gvim, not ngvim or whatever it's called
I got really excited about neovim a few years ago, but then vim 8 came out and implemented a lot of the features that neovim was hyping, so I don't see the point as much.
I'm sure if I was writing games in vim I'd be pretty excited about nvim still

5:25 PM
I've been using nvim for a while now and the only differences is that I hate the autoindentation that nvim has as default.
Vim knew to stay out of my business.

5:59 PM
0

Inspired by a question on the puzzling stack exchange. Rules Given 5 stacks of 5 cards numbered 1 to 7, output the moves needed to empty all stacks. A move is defined as the index of a column to pull the card off of, and a move is only valid if: The stack is non-empty The value of the card ...

6:19 PM
0

Background We define the prime-counting function, \$\pi(x)\$, as the number of prime numbers less than or equal to \$x\$. You can read about it here. For example, \$\pi(2) = 1\$ and \$\pi(6) = 3\$. It can be shown, using dark magic, that \$\lim_{x \to \infty} \frac{\pi(x)}{x/\log x} = 1 \$ ...

6:55 PM
CMC: functional square root of cumulative sum. 1 1 1 1 1 → 1 1.5 1.875 2.1875 2.4609375; 1 1.5 1.875 2.1875 2.4609375 → 1 2 3 4 5; 3 1 4 1 5 9 2 63 2.5 5.625 4.3125 8.1328125 14.13671875 10.7041015625 14.04931640625 (i don't have (anything close to) a proof that my solution is the only one (or that it's even correct), but it was a fun challenge to get it at least working)

3 hours later…
9:58 PM
In Julia, how can I create a random binary array of b bits? I want something packed, as it were, so I can XOR it with other random binary array of b bits.
@H.PWiz ^^

I don't know

TIO. I didn't know any Julia before this :p

That's not a bit array

CMC: Given b, answer a random binary array of b bits. (packed, if packed bit booleans exist at all in your language)

@H.PWiz hm, docs say "Generate a BitArray of random boolean values." and BitArray says "Space-efficient N-dimensional boolean array"

10:13 PM
Oh, I thought that was an Array{Bool}. My bad

10:23 PM
@Adám for a bit string, Print(StringMap(InputNumber(), Random(2))) (4 bytes in native Charcoal; if you were going to calculate on the array, you would probably use Map instead). for an arbitrary precision integer, Print(Cast(Random(Power(2, InputNumber())))) (5 bytes in native Charcoal; not sure whether Random actually works on arbitrary precision integers; not sure whether Charcoal has bitwise XOR anyway)

10:33 PM
but rand is super fast
bitrand

11:01 PM
@dzaima so, if i understand correctly, the functional square root of g is an f such that f(f(x))=g(x) for all x. how does the input encode g(x)?

@ngn g←+\

This looks odd, as if you answered a message that wasn't posted yet, without editing!

for instance what is g(1.5) when g ≡ +\1 1 1 1 1?

that's the whole challenge.
Find a function f such that f⍣2≡+\

11:08 PM
@Adám then how do we compute f(f(x)) when f(x) is 1.5?

@ngn I don't understand what you're asking.

@ngn f (= the solution/answer) is given an array

in the examples the answer f is a list, not a function
how do we apply a list to an argument? is f(x) indexing?

@ngn the examples are arguments to f, not f itself

E.g. f 1 1 1 1 1 gives 1 1.5 1.875 2.1875 2.4609375

11:11 PM
^ and so f f 1 1 1 1 1 gives 1 2 3 4 5.

ok, same question about the input - why is it a list?

@ngn what other input would you give to a cumulative sum function?

And since the first element is the "seed" (it stays constant), f is fully specified by f f≡+⍀

@dzaima if g is cumulative sum of 1 1 1 1 1, then what is g(1.5)?

@ngn f g or f f f or g f if you want.

11:13 PM
@ngn g is just a function
imagine the challenge was to just calculate the cumulative sum. an input of 1 1 1 1 1 would make perfect sense. Now just do the challenge 0.5 times.

i thought the challenge was to find an f such that f(f(x))=g(x). how can i compute such an f if i don't even know the g?

@ngn You do know g, it is +⍀
but x is always a vector with at least 2 elements.

@Adám (eh, it could be just one, just that it's the trivial case of returning itself)

@dzaima Right, hence I wrote 2.

so, would ⎕ucs be a valid answer? (with some restrictions on the domain of the input)

11:17 PM
@ngn No, ⎕UCS⍣2⊢1 1 1 1 1 gives 1 1 1 1 1 which is not the same as +⍀1 1 1 1 1

ah, right

This is a really tricky one. Somehow, it is obvious to me that there exists an f such that f⍣2 is +⍀ but I can't quite see how to find it.

but i think i understand the challenge now. thanks @Adám @dzaima
aren't the examples irrelevant? isn't my function f(x) free to return whatever it wants as the first result, as long as the second result is the +\ ?

@ngn hence me saying i don't have a proof that this is the only solution.

i see

11:23 PM
@Adám what i'll say is you definitely won't guess it (unless you can approach it from a less brute-force-y way than me)

@dzaima f←{1=≡⍵:⍵⍬⋄+\⊃⍵}

@ngn ‽ ≡⍵ is always 1.

@Adám not on the second application

@ngn Oh, but it fails on all the test cases.

@Adám the test cases are irrelevant, the function can return anything it wants as long as the second invocation returns the +\

11:27 PM
@Adám those aren't concrete
@ngn now do it with the output domain being numbers :) (still probably abuseable)

@dzaima i was sure this wasn't the kind of solution you were hoping to see :)

@dzaima What is the input domain? All numbers, even imaginary?

@Adám i'm okay with just reals, though input domain should be equal to output domain

@dzaima I think I found the formula for coefficients: nth term = (2n-1)Cn / 2^(2n-1)

@Bubbler though i have no idea what exactly that means (also spoilers!), it does seem vaguely related to what i have

11:31 PM
@ngn f←{⍎'f←+\⋄⍵'}
@dzaima C is !⍨

@Adám self-modifying code :)

@Adám yeah, that's what i interpreted it as
i have a "cheating" solution with equal I/O domain of reals that also satisfies  (f f f X) ≡ +\f X

@Bubbler I translate that as {(n!¯1+2×n)÷2*¯1+2×n←⍳≢⍵} but there's something missing here, as this ignores ⍵

@Adám Actually I omitted certain piece information in that line.

a linear-algebra solution: +\ is like matrix-multiplying by a matrix that has 0 above the diagonal and 1 on and below the diagonal. find its matrix square root and multiply by that instead

11:42 PM
@Bubbler ah, that's exactly equvalent to (2n)Cn / 4^n in my code
@ngn oh so there is a proper way to get the answer

@ngn Thanks. Now I have an elegant solution.

@dzaima (i got that formula from oeis :p)

f←{({2÷⍨⍵+a⌹⍵}⍣≡a←≥/↑⍳2⍴≢⍵)+.×⍵} using the babylonian method

@dzaima {⍵+.×+.×⍨⍣¯1∘.≤⍨⍳≢⍵}
I was overjoyed to find that +.×⍨⍣¯1 works to find the square root of a matrix.

11:47 PM
@Bubbler Think of it: ×⍨ is the square, so ×⍨⍣¯1 is the sqrt. Same for matrices: +.×⍨ is the square, so +.×⍨⍣¯1 is the sqrt!

@Adám domain error for me (old version) but i wouldn't have thought of trying this

works on TIO

@ngn How old‽ Works in 16.0.

15.0.29007

@ngn You really should update. There's not even any registration anymore.

11:49 PM
We should definitely have a listing of all the mathematical ⍣ tricks somewhere.

This one is really cool.
I actually just finished compiling a list of desired inverses. I plan on submitting it to Marshall for implementation asap, though he says he's unlikely to do it before 18.0.
E.g. ∘.f⍨⍣¯1 fails even though it is obviously f⍨⍣¯1⊢⍉⍨⍴∘⍴⍴∘⍳2÷⍨⍴∘⍴

this is the answer i got to with no knowledge of linear algebra, just brute force and some logic.

@dzaima I was thinking something similar, and I got the formula by hand-crafting the first 4 terms (1/2, 3/8, 5/16, 35/128).

@Bubbler that's indeed what i did too

@Adám How come is it obvious?!

11:58 PM
@Bubbler Well think about it. ∘.f is an f-table. Now since we have ∘.f⍨ we know that the arguments listed down along the left side of the table are identical to the ones listed across the top. So along the diagonal, we have all the f⍨xs. This means that the original arguments are simply f⍨⍣¯1 on the diagonal.