« first day (198 days earlier)      last day (3033 days later) » 

7:12 PM
@adriaan Be ready I'm coming forrr youuuu!!
BADA DA DADADADA
God, I love the sound of the guy's snare in that song
 
@AndrasDeak I augmented the answer with a function for accumlating with a for-loop. I looked at your comment, but couldn't understand it ... so I went the loopy route (which I love).
Thanks for point out the shortcomings too. I really only work with vector output, so I forget n-dimensional arrays.
 
7:33 PM
@AndrasDeak I'm used to sh for hyperbolic sine... isn't that standard in English (alongside sinh)?
 
@TroyHaskin no problem:) I think loops are straightforward and almost unavoidable here
and anonymous functions are a no-go unless you want to use something diabolic like subsasgn
so it's cool
@LuisMendo I don't really know the standard:) But I don't think latex/amsmath knows \sh, which is a strong sine sign
 
@AndrasDeak Indeed. If Matlab were more functional, a loop could be avoided by tail recursion. Also, f being a black box doesn't make the solution any easier.
@LuisMendo I saw that once in a paper, and had no clue what it was until they transformed it to exponential form.
 
@ballBreaker hides under his desk
 
@TroyHaskin yup, or my commented approach would work if you could use octave-like function(){:}.
black box indeed doesn't help, I guess OP wants a general concept
I think the simplest would be to vectorize f itself
 
@AndrasDeak That's almost always the simplest solution.
 
7:38 PM
agreed:)
btw numpy.vectorize ftw
 
I'm off for the weekend; @AndrasDeak don't burn the house down!
 
@Adriaan Don't be scarreedd
I need some angry music
anyone have angry music?
Lmao @Adriaan .. .lmao. I have no idea how you feel about this song so please tell me
I personally love it
 
@TroyHaskin @AndrasDeak What am I missing on this question? Why is it not just g = @(x) sum(bsxfun(f, repmat(x, 1, 3), 1:3))?
 
@beaker Because, according to the OP, the function doesn't work with that kind of vector structure for the inputs. The actual problem is the underlying definition of f, but that's not the goal of the question.
 
7:54 PM
@TroyHaskin but it seems to me that if f(x, 1) works, then the code I gave will work, right?
 
@beaker Treating f as a blackbox (i.e., without code or implementation), I don't know. However, I still wanted to give a general implementation assuming the f is something that cannot be changed for some reason.
 
ah, because we need to apply it to the proper dimension
if x is a non-scalar then we've got to worry about how to pass the proper dimension(s) of x to f
 
Indeed.
That's my assumption anyway.
Although, I am surprised Matlab doesn't have something similar to the accumfun I posted ... unless I'm missing something.
 
@Adriaan see you later, dude
@beaker that's pretty cool actually, I haven't thought about putting f into bsxfun first:)
unfortunately, you need an R^n -> R map for bsxfun, if I'm not mistaken
 
f = @(x, y) x + y
a =

ans(:,:,1) =

   1   1   1
   1   1   1
   1   1   1

ans(:,:,2) =

   2   2   2
   2   2   2
   2   2   2

ans(:,:,3) =

   3   3   3
   3   3   3
   3   3   3
>> b=permute(1:3, [1 3 2])
b =

ans(:,:,1) =  1
ans(:,:,2) =  2
ans(:,:,3) =  3

>> bsxfun(f, a, b)
ans =

ans(:,:,1) =

   2   2   2
   2   2   2
   2   2   2

ans(:,:,2) =

   4   4   4
   4   4   4
   4   4   4

ans(:,:,3) =

   6   6   6
   6   6   6
   6   6   6
sorry, that was more code than i was expecting
 
8:05 PM
@AnderBiguri This is more or less equivalent Matlab code
 
but the + is vectorized, i guess
 
N = 100; % input
n = 0:N-1;
r = floor(sqrt(2*n)+.5);
x = exp(2j*r/3*pi);
y = cumsum(x);
plot(y) % plot the complete spiral
hold on
z = y(isprime(1:numel(y)));
plot(z, 'r.') % marker at primes
 
@beaker it is
 
but again, as long as f(x,y) works for non-scalar x, then this should work
 
try something with transpose(x)^y, that should be vectorization-proof
 
8:06 PM
@AndrasDeak :-DDD
 
oh wait, no, @beaker
that's "y>1-proof"
nevermind
It could actually work:) We'd have to check
actually, if bsxfun doesn't complain, then it might be correct
 
it seems to work
 
in which case you should post it
 
i had to change to .^, of course
@AndrasDeak okay, I'll post something and see how it goes
@AndrasDeak Nope, I was wrong
I had my permutation off by one dimension.
I shouldn't try to code while I'm concentrating on non-coding stuff :/
 
@beaker I guess so:/ But is it salvageable?
I hope everything's OK though (regarding concentration on non-coding stuff)
 
8:20 PM
@AndrasDeak No destruction involved, all good :)
 
ok:)
 
as far as the code i'll have to think about it later
 
@beaker I think it's very promising
I think this is the catch:
FUNC can also be a handle to any binary element-wise function not listed
    above. A binary element-wise function in the form of C = FUNC(A,B)
    accepts arrays A and B of arbitrary but equal size and returns output
    of the same size. Each element in the output array C is the result
    of an operation on the corresponding elements of A and B only.
 
rabble rabble rabble
damn it
 
so if you can express it as an element-wise operation on 2 arrays of the same size, you're OK
And you can! Awesome!:)
 
8:25 PM
repmat(y, [size(x),1]
but you still have to permute y first
 
yeah, so bsxfun(f,x,y) will return the array of size x, each element of which is f(x(i),y)
oh wait, I'm lost again
I'll get back to this when I can concentrate on it:D
yeah, what I wrote is irrelevant for the problem
unless, as you said, I permute the y vector to always produce an additional dimension
and then you can sum along that
which is cool, because it should be anonymizable (brr)
 
About my Ulam challenge / answer: believe it or not:
Dennis is amazing!!
 
@LuisMendo O ho ho !
 
bsxfun(f, repmat(x, [1,1,...,3]), repmat(permute(y, [1,3,...,2]), [size(x) 1])) should do it
 
@LuisMendo you and Dennis both;)
 
8:30 PM
@AndrasDeak How the hell can that ever happen?? :-O... \o/ \o/ \o/
 
@LuisMendo I think he's actually Wolfram Beta ;)
 
@beaker :DD
 
I didn't even expect the online compiler to support graphics... Alex A. asked and I thought "let's try..."
 
@LuisMendo the resolution sill has some issues;)
 
@AndrasDeak Given a 132-column line printer, ASCII art is all you ever really need ;)
 
8:32 PM
ASCII art of scatter plots is not always the best;D
 
WOW ASCII GRAPHICS!
 
@AndrasDeak Hahaha. Well, you know...
@rayryeng AMAZING!!! Isn't it?
 
nice job Dennis :D
It's one step towards actual images but hey it's great
 
@rayryeng He says he didn't ddo anything!
Must be Octave
 
ahhhh... yes.
 
8:33 PM
wtf
 
IIRC, if there is no supported graphics driver, Octave defaults to ASCII plots in the command-line.
2
 
@rayryeng why are we using matlab, again...?
 
so from STDOUT, it gets piped back to the website
 
in The Nineteenth Byte on The Stack Exchange Network Chat, 51 secs ago, by Dennis
@LuisMendo The server doesn't have a GUI, so the environment variable DISPLAY isn't set. I guess that makes Octave fall back to ASCII art.
 
Because we have free access to software that is frequently updated lol
 
8:34 PM
@rayryeng What you said
 
yup that's it.
 
@ray you ever laugh at yourself so hard that you shed a tear? lmao (I know this is random AF)
 
I know I've shat myself hard enough to shed a tear.
ok, you got me. What was so funny?
 
lmfao
you know that implies that you shit your pants right
 
@AndrasDeak Because you don't run into messages that say "This is a function in MATLAB that has not yet been implemented in Octave. To find out how you can contribute..."
 
8:35 PM
yup.
 
hahahahahahaha
 
and that's ALL I AM GOING TO SAY
 
@beaker haha, good point:D Seeing those often?
 
well... I basically took a gamble on a fart... and lost.
 
Man that reminds me of the video of a dude asking a random chinese guy at a bus stop if he's ever shit himself
Have you seen it before?
 
8:36 PM
no never.
is that what you're laughing about? lol
 
oh god I gotta find it
 
@AndrasDeak Only when the MATLAB function is absolutely the only reasonable way to do what I want to do ;)
 
nonono hahaha I'll tell you in a minute
 
@LuisMendo that ASCII art is surprisingly to scale.
 
lmfao so fuckin good
 
8:37 PM
however it is done, it's great.
 
@beaker Also, it has a lot of small incompatibilities. I had to modify 13 functions for MATL, and counting...
@rayryeng It's... unbelievable
 
@beaker I don't think matlab supports ... though
and I'd have to think about it:)
but bsxfun+repmat sound odd
 
@AndrasDeak that was an example. you'd have to replace the ... with 1:number_of_dimensions and move the 2
 
2
A: Character-mode (shell) plots with Matlab / Octave?

carandraugIn the case of Octave you should have no problem. I usually do my computations on remote machines over ssh, and use it all the time. As long as you have gnuplot as your graphics toolkit (for future reference, as of 3.6.2 this is still the default but may change to fltk in the future), you'll get...

 
@rayryeng But no man, I caught myself slipping. Like I realized that what I've been doing is so far away from me as a person that it was actually hilarious. The turning point was remembering this dude Dom friend-zoned soooooo hard, then realizing I was starting to do the same shit he was doing
 
8:40 PM
@beaker I was thinking something like sum(bsxfun(f,x,permute(y,[(1:length(size(x)))+2, 2])),length(size(x))+1)
 
Then burst out laughing around a bunch of strangers, and laughed so hard that I started tearing up
 
oh boy lol
 
Then the fact that I was dying over a thought in my head around strangers and they were all staring at me like I was insane made it even funnier
I know that sounds maniacal as hell
But I'm more of a maniac than a depressed person ;')
lmao
hahahaha oh god, anyone here take the SO developer survey?
 
8:58 PM
@ballBreaker Not sure about angry, but uplifting : "Arty gentle touch".
 
I need a rough and callous touch right now
 
Justice Genesis?
 
Also I don't know if I want to be gently touched by Arty, isn't he like 15
 
nah he is all grown up I guess
 
Seriously?
Damn, that just means I'm getting old
 
9:00 PM
Justice Genesis is prolly the only rock track I know about
 
and not realizing it
genesis is not rock hahah
 
ahaha it's not?
well w/e :D
 
hahaha noo dude
Im finding this survey really hard to take seriously
I hope they can't track it back to me as a user
 
@AndrasDeak Oh look, @Divakar is here to show us how the pros do it :D
 
wait! Do what? @beaker
 
9:06 PM
@Divakar OI
 
OI OI!
 
@Divakar did we tell you? MATL is online now
 
yeah that MATL guy!
ahhhh lovely!!
 
:D
it also uses ASCII graphics when plotting :D
 
I will try it after this Valentine's :D
So, how did you guys do it? Octave backend?
 
@Divakar we were having trouble with this one:
0
Q: Function handle applied to array in MATLAB

snarskiI've searched and there are many answers to this kind of question, suggesting functions like arrayfun, bsxfun, and so on. I haven't been able to resolve the issue due to dimension mismatches (and probably a fundamental misunderstanding as to how MATLAB treats anonymous function handles). I have ...

 
Yes it's an Octave backend.
 
niice Ray!
@beaker Ah too abstract, those things!
 
i know
 
I can't take all of the credit. Dennis from PPCG did a lot of the work
 
9:09 PM
awesome ! So, wow can I say "Hello world" there?
 
@Divakar I think "Justice - Stress" Is more what I'm looking for right now
Sometimes if I need to motivate myself, or distract myself I listen to stressful music, and that song is perfectly stressful
 
haha well w/e works for you right!? @ballBreaker
 
yes you can :D
 
@Divakar Yes! Exactly
 
@rayryeng Worked!
though it took good 3-4 secs!
 
9:13 PM
hahaha I know.
 
@Divakar That's what she said?
 
Some of the time is to send the request to the server and the server piping results back to the browser
@ballBreaker to you?
it's mind blowing how that phrase can be placed at the end of so many sentences lol
 
@ballBreaker Yeah she said - "forgive me forgive you - Ashley" ;)
This is full on groovy - "atb josh gold" @ballBreaker
@rayryeng You gotta check out your meta SE tag cloud! :D
 
really?? what does it look like?
Lots of Jon, many more lots of Skeet?
 
dunno!
Tag cloud now supports all SE sites!
so just paste your meta link in it.
 
9:18 PM
OH :D
I will run soon.
@Divakar I can't remember if I told you, but I'm teaching machine learning where I went to school for this winter semester
I've been hired as a contract instructor for now.
I still work full-time though!
 
you didn't! Awesome news!
very good really!
when did you start?
And adios to boobly cam?
 
@rayryeng hahaha yea dude
 
I started this past Wednesday.
 
wheere you posted a "I quit" video?
:D
 
9:24 PM
hahahaha.
no no I'm still working at Boobly Cam.
until I get something better, then I'll quit
 
haha
 
mmm boob
ly
 
but the goal is to go back into academia.
 
so, what's there on the YT channel?
 
BOOOOBIE
 
9:24 PM
BOOOOBBIIEE CAAAMMM
 
hahaa
 
It's just my lectures captured on video. I used a Microsoft Surface and captured my desktop in real-time.
 
Boobie cam motto: "Show us yer tits"
 
nice.
I like that.
 
lol
 
9:25 PM
The first lecture was all introduction... what machine learning is, different kinds of algorithms... then I started off with linear regression with one variable with Gradient Descent.
something easy to start off.
 
nice Ray!
so that is York Uni?
 
no actually! This is where I graduated from. Ryerson.
 
oh lovely!
 
My supervisor is now the chair of the electrical engineering department.. he emailed me two months ago and asked if I would teach
I said yup, of course.
 
perfecto! Just like you had plans for!
 
9:27 PM
@rayryeng I heard they actually call it Cry-erson
 
@ballBreaker It's known by many names
 
That's why they bring the BOOBly cam to stop the crying
 
I've known it to be Rye High because the main campus building looks straight out of shit you'd see in high school
dark rooms, lockers and shit that keeps falling down
 
@rayryeng we call that "homely"
 
9:29 PM
an interesting fact: The main Ryerson library was designed by the same guy who designed the Don Jail
that's why the library is laid out like a prison.
 
@rayryeng Yeah, plus I just made that up
 
Cry-erson is new lol
 
it was something like homecoming @rayryeng ;)
 
homely eh?
hahaha yes :) @Divakar
 
@rayryeng ;) now you know why
@Divakar will check her out
I hope she's qute
 
9:31 PM
she who?
ah that track yes!
 
:)
She sounds cute
Check that out, it's one of my all-time favourite trance tracks
 
slow net again, but soon I will @ballBreaker :)
 
ahhhhh alright buddy
 
ahh for the angry mood try "rex mundi"!!
 
Hey @Divakar! Did you see the MATL ASCII plots that Ray mentioned? It's amazing! matl.tryitonline.net/#code=NTpYRw&input=
 
9:42 PM
hey Luis!!
 
How are you doing?
MATL is online! I'm so happy!
thanks to Ray and Dennis from PPCG
 
great work! I just said "hello world" on and the output came back in 3-4 secs! Felt like it came back after travelling to moon!
 
@LuisMendo the happiest bounty hunter in the galaxy:)
 
@AndrasDeak I surely am!!
Except I didn't appear in episode VII. Oh well
 
lol
 
9:43 PM
@LuisMendo :D
 
@LuisMendo awww what a pity
 
@rayryeng Nah... I'll have a movie for my own
 
So, MATL ASCII plots? Really?
any examples?
 
ah its running!
 
9:44 PM
It's an Octave thing. Nobody had any idea that would happen
 
lovely!
 
It is! :-)
It supports images as well
 
@AnderBiguri's dinner on MATL might take a day to cook though :D
 
Hahaha
 
@Divakar :D
worth the wait
 
9:46 PM
He'll have a sandwhich
 
Invite Lena for a MATL Friday party?
 
Why not? Hehehehe
 
@LuisMendo now you really should include a kind of easter egg that plots your avatar
 
wait, Friday already over here :(
 
unsuspecting coding, and BAM, face to face with Boba Fett
 
9:46 PM
I'd invite Lena over for a BOOBIE party
 
hahaha
 
@AndrasDeak Hahaha. I do have an Easter egg planned. But simpler. Similar to Matlab's why
and undocumented
you'll have to find out
 
@LuisMendo obviously;)
 
MATL EASTER EGGS
 
@rayryeng Just one
 
9:47 PM
@LuisMendo grep -i easter *.m
:D
 
Make a symbol where it will output the ASCII version of Divakar's avatar
:D @AndrasDeak
 
@AndrasDeak No way. It'll be coded
 
@LuisMendo I hoped so!:)
 
as in the sun and moon? @rayryeng
 
@rayryeng It's just text. Like why
Just some random sentences
 
9:51 PM
:D
why -> Because The Force Awakens
who -> Jango Fett
spy -> ASCII image of Luis Mendo's avatar
 
@rayryeng Jango?
 
yes... you gotta attribute the father.
 
Jango Unchained
The Unchained is silent.
 
lmao
Jango Fett is Boba Fett's father.
Boba Fett == Luis Mendo's avatar
 
I know:)
 
9:53 PM
oh ok. sorry.
 
I just thought you were confused about "who's your daddy"
 
hahahahaha
 
I thought his shirt said AC DC
and was about to throw up in my mouth
 

« first day (198 days earlier)      last day (3033 days later) »