« first day (3 days earlier)      last day (90 days later) » 

1:16 AM
Any idea what's going on there?
 
hahaha I love that picture
@Dennis Where?
 
0
A: Subsequence Substitution

DennisJulia, 62 59 58 bytes f(s,p,r)=(try s[[i=findnext(s,c,i+1)for c=p]'],i=r,0end;s) I/O is in form of character arrays. Verification julia> f(s,p,r)=(try s[[i=findnext(s,c,i+1)for c=p]'],i=r,0end;s) f (generic function with 2 methods) julia> F(s,p,r)=join(f([s...],[p...],[r...])) # string/char...

Why do I need '? Why does the tupled assignment work?
 
Why does the tupled assignment work? Because tuple assignments are a thing in Julia...
As for the transpose, I have absolutely no idea
 
OK, but I'm basically doing x,x[i],i=[1,2,3],4,1, so I use i before I actually define it.
 
That's... bizarre.
I honestly don't know why that would work
It looks like the left hand side of the tuple assignment all gets parsed and evaluated together rather than individually
because it knows what x is and it knows what i is and it correctly replaces x[i]
 
2:29 AM
@AlexA. But x[i],i,x=4,1,[1,2,3] does not work...
 
O_O
I have no idea then
What's the error?
 
ERROR: UndefVarError: x not defined
 
?:U
 
Btw, X->det(X'X)>.5 works.
 
Even for empty input?
 
2:32 AM
Yup.
 
X = []; X'X errors for me
 
You need a 0x0 matrix, not Any[].
 
Oh
In that case what I do now might work
 
Nope.
 
Never mind then
 
2:35 AM
julia> (X->det(X'X)>.5)(reshape(Int64[],(0,0)))
true
 
It's golfier to do ones(Int,0,0) :P
But that's nuts!
Sure you don't want to post that?
 
Quite frankly, I'm a little fuzzy on the details. Why is X'X invertible iff the columns of X are linearly independent?
 
@AlexA. The claim is true. The rows of M being dependent with coefficients given by vector v means there that v*M=0. This implies that v*M*(M^T)=0, so M*M^T is singular, since it maps some nonzero vector to zero. Conversely, if M*(M^T) is singular, then there exists a vector v so that v*M*(M^T)=0, in which case (v*M)*(v*M)^T=0. But, only the zero vector has norm zero, so v*M=0, which means the rows of M have a linear dependence. — xnor 4 hours ago
It's the same approach as Anna's Matlab answer. This is xnor's proof of the approach.
 
Oh, I hadn't read the MATLAB answer for some reason...
 
Nice first answer by a new user.
 
2:41 AM
Definitely.
Well, alrighty then. If you don't want to post the determinant answer, I will.
 
Well selfishly I want to because it's 14 bytes which will be the smallest so far, but technically you came up with it.
 
Completely up to you.
 
2:57 AM
Well, you came up with the approach and it happens to be identical to Anna's and I already have two other answers on that question, so you go for it. :)
 
3:08 AM
POSTE
D
 
hahahahaha
 
 
16 hours later…
7:19 PM
@AlexA. A filter would be shorter.
 
Shorter than what?
oh
 
Also, the Boolean logic can be replaced with .
 
Not sure which logic you mean but I cut out the ternary
 
!=[]&&
 
Wouldn't it be an IndexError since I'm doing z[1]?
 
7:23 PM
Ah, nevermind, that returns a singleton array of the result...
Why on Earth is nothing not falsy?
 
Because it's not a boolean, it's nothing
 
I came to terms with not casting numbers to Booleans because of the loss of information, but it doesn't get falsier than nothing.
 
Well, the thing about nothing is that it means "no information." So you don't know whether something is false because you don't have any information about it at all. It's like NA in R.
Except NA is a logical in R and nothing is of type Void in Julia
 
Anywho:
x->(y=sort(x))∈[circshift(x,i)for i=1:endof(x)]&&y
 
Oh nice, that's even shorter than my old solution that didn't work!
Thanks for your help :)
 
7:37 PM
:)
 
7:49 PM
@AlexA. That sum squares challenge needs a Julia answer btw.
 
I'm on it!
 
I'm currently at 26 bytes.
 
8:00 PM
Uh, those test cases...?
I'm at 21 based on my understanding of the challenge but I must be misunderstanding because those test cases make absolutely no sense to me
 
What about 'em?
Your function should sum all odd for which k² < n, not all odd for which k < n. — Dennis ♦ 14 mins ago
 
Ohhhhhhhhhh
 
8:29 PM
@Dennis 29
 
I'm also at 35 for driftsort.
 
._.
 

« first day (3 days earlier)      last day (90 days later) »