« first day (2004 days earlier)      last day (640 days later) » 

1:43 AM
@hyper-neutrino Can you give chat.stackexchange.com/users/552541/user4381972 access?
 
2:23 AM
@Adám done
 
Thanks!
 
 
13 hours later…
2:57 PM
This should be pretty standard… ;-)
 
What's the problem this week?
 
There's a calendar on APL Wiki.
 
Ah I see
 
Welcome to APL Quest 2015-5! Today's quest is He’s so mean, he has no standard deviation:
> Write a function that returns the population standard deviation of its numeric array right argument.
 
was about to ask about quest today :)
 
3:00 PM
So, not the most interesting problem, as it it just translation into APL of formula in traditional mathematical notation.
 
I had {0.5*⍨(+/2*⍨d-(+/÷≢)d)÷≢d←,⍵} way back when.
 
Why do you need ,?
D'oh, the problem asks for it.
 
So it works on scalars
 
It would anyway. But this works on matrices etc.
Seems a bit unnecessary to compute ≢d twice.
 
Isn't that O(1)?
 
3:02 PM
Sure, but reserves a new pocket for it each time.
Btw, thanks to @awagga, we can now use all the newest features on problems.tryapl.org
 
I had (2*∘÷⍨+/÷≢)(×⍨⊢-+/÷≢)
 
Even ?
 
Yes.
 
Sweet
 
@rabbitgrowth Ooh, that looks interesting.
 
3:03 PM
Just watching by mobile on beach...
 
Draw APL glyphs in the sand!
@rabbitgrowth Needs a ravel, though.
 
(0.5*⍨≢÷⍨(+/2*⍨⊢-+/÷≢)),
they are drastically different
 
:)
 
;-)
 
(2*∘÷⍨+/÷≢)(×⍨⊢-+/÷≢)⍤,
(2*∘÷⍨+/÷≢)⍤(×⍨⊢-+/÷≢),
(2*∘÷⍨+/÷≢)⍤(×⍨⊢-+/÷≢)⍤,
 
3:06 PM
Fun variant is using +.×⍨ instead of +/2*⍨
 
Not sure which is best
 
yep, show realize generalized dot product
 
(A*∘÷2⍨)⍤(×⍨⊢-A←+/÷≢)⍤,
 
Stretch goal: no *
 
(A⍟⍣¯1∘÷2⍨)⍤(×⍨⊢-A←+/÷≢)⍤,
 
3:08 PM
Meh
 
I like how (2*∘÷⍨+/÷≢)(×⍨⊢-+/÷≢) tells me exactly what standard deviation is, from the ground up, without using one-off special symbols or extra explanation like "where n is the number of items". Also it's very clear that you're taking the mean twice.
 
Yes.
Although there's no symmetry between 2*∘÷⍨ and ×⍨
How about (×⍨⍣¯1+⌿÷≢)(×⍨⊢-+⌿÷≢)⍤,?
 
no *, v
 
@Adám cunning
 
I think Roger Hui would write (*∘0.5) ∘ (+⌿÷≢) ∘ (*∘2) ∘ (⊢ - +⌿÷≢) ∘ ,
 
3:12 PM
It's very clean that way
 
(0.5*⍨+⌿÷≢)(2*⍨⊢-+⌿÷≢)⍤, seems nice too
I think I like it better than the traditional math formula Google gave me
 
A pair of square and squareroot functions would be niece.
Ah, with the Under operator, you could write (+⌿÷≢)⍢(×⍨)(⊢-+⌿÷≢)⍤,
 
Good spot, I was looking for that
 
catamorphism
 
Look ma, no parens: 2*∘÷⍨≢⍤,÷⍨1⊥2*⍨⊢-+⌿⍤,÷≢⍤,
A bit silly to ravel thrice though. ≢⍤, can be substituted with ×/⍤⍴
OK, so are we all out of ideas?
See you next week for 2015-6: Hey! This is My Space.
 
3:28 PM
Looking forward to next week. Hope to be there.
 
Oh, did you not write anything in the sand?
 
Oh yes, my favourite selfie:)
 
During Dyalog '15 in Sicily, I used rocks to write ⍺*⎕ in huge letters inside the a crater on Etna.
 
@Adám :) :)
 
Did it evaluate?
 
3:31 PM
The no parens version feels a bit weird because when you're taking the mean of the squares of differences, you're dividing by the original number of items instead of the number of squares of differences, but they're the same of course
 
@xpqz No, it blew up.
 
I set 'em up. You knock 'em down.
 
The selfie makes me switch from the beach to the sea. See you all next time.
 
@xpqz I suppose the timed out. Someone must have set ⎕RTL.
 
2*∘÷⍨≢⍤,÷⍨1⊥2*⍨⊢-+⌿⍤,÷≢⍤,
               ^
I think this should be ,
to pass all tests
 
3:40 PM
Ah yes.
 
3:59 PM
The Roger Hui style is interesting. I came across ⌷∘array¨indices the other day; I only knew about array⌷⍨⊂indices
 
Eventually there'll be. indices⊇array. But yeah, that's tangential
 
@rabbitgrowth There's also indices⊃¨⊂array called the chipmunk. It is a Dyalog idiom.
 
Ah yes, I remember reading about that in Mastering Dyalog APL
I need to finish that book...
 
Roger Hui's tacit median:
mindex ← (⌊,⌈)∘(0.5∘×)∘(-∘1)∘≢    ⍝ or (⌊,⌈)∘halve∘decrement∘≢
median ← ⊂∘mindex mean⍤⌷ ⍋⍨
 
4:29 PM
Is that using an alternative definition of where ⍋⍨ works like the standard {⍵[⍋⍵]}?
 
Yes.
 
4:46 PM
@doug Can you show this working?
 
 
3 hours later…
 
1 hour later…
8:48 PM
@Adám Sorry, I’ve lost the context. Was there a bug in something I’ve posted?
I had this for the most recent, BTW. (*∘.5≢÷⍨∘(+/*∘2)⊢-+/÷≢),
 
9:48 PM
In a TabControl, when the form displays, the most recently created tabbutton + form is displayed, instead how can I have it so that the first one displays?
There's the State property, but it's read only
 
10:11 PM
@rak1507 Try quadNQing a GotFocus or Select event on the tab button or the associated sub form. I don't have code in front of me, but it is one of those options, pretty sure.
 
10:31 PM
@PaulMansour thanks, that does the trick - wonder if there's a way to do it with ⎕WC though, it seems strange for the last tab to be selected, surely normally you'd want the first tab selected?
 
10:47 PM
no idea what I've done - I seem to have managed to have it so when typing a line it is one colour theme, and then the rest is another, is there a way to just totally reset it?
 
11:32 PM
@rak1507 I assume you are typing a line in the session? (and not in the editor) If you are in the Windows IDE, there is a session/trace tab on the colors dialog box. You might try resetting the the color scheme there.
@rak1507 As far as I know there is no way to do it with ⎕WC
 

« first day (2004 days earlier)      last day (640 days later) »