# IRC log for #pdl, 2013-05-22

All times shown according to UTC.

Time Nick Message
01:56 Meiermann joined #pdl
04:02 LimitSupremum joined #pdl
04:02 LimitSupremum what's the equivalent of outer( ... ) in R?
04:03 LimitSupremum I need to make a difference table for a project...
04:03 LimitSupremum example in R
04:03 LimitSupremum > outer(1:10,1:10,'-')
04:03 LimitSupremum [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
04:03 LimitSupremum [1,]    0   -1   -2   -3   -4   -5   -6   -7   -8    -9
04:03 LimitSupremum [2,]    1    0   -1   -2   -3   -4   -5   -6   -7    -8
04:03 LimitSupremum [3,]    2    1    0   -1   -2   -3   -4   -5   -6    -7
04:03 LimitSupremum [4,]    3    2    1    0   -1   -2   -3   -4   -5    -6
04:03 LimitSupremum [5,]    4    3    2    1    0   -1   -2   -3   -4    -5
05:52 LimitSupremum joined #pdl
14:45 run4flat Hey everyone, if somebody ever asks that sort of question, use pdldoc's apropos switch
14:45 run4flat i.e. at the command line, type "pdldoc -a outer"
14:45 run4flat It turns out there's an "outer" function
14:46 run4flat and "pdldoc outer" gives me its documentation and tells me it's in PDL::Primitive
14:46 run4flat So, now you know. :-)
14:46 pdurbin half the battle
14:46 run4flat that said, I don't think that would have entirely answered LimitSupremum's question
14:46 pdurbin need moar R fu
14:46 run4flat right
14:48 run4flat For LimutSupremum's problem, I can generate the desired matrix with this:
14:48 run4flat yvals(10, 10) - xvals(10, 10)
14:49 run4flat I'll have liddle tell LimitSupremum next time he clocks in
14:50 pdurbin liddle_piddle_bot: help
14:50 * run4flat checks liddle_piddle_bot's code
14:51 run4flat pdurbin, try sending a private message to liddle_piddle_bot
14:52 pdurbin ah ha! a link to https://github.com/PDLPorters/pdl/wiki/PDL-IRC
14:52 run4flat beware, that might be dated. :-)
14:52 pdurbin better than nothing
14:53 pdurbin is liddle_piddle_bot's code on github too?
14:54 run4flat honestly, I can't recall
14:54 run4flat I am not sure
14:54 run4flat pdubrin, do me a quick favor, leave the channel and come back
14:54 pdurbin left #pdl
14:54 pdurbin joined #pdl
14:54 liddle_piddle_bot pdurbin, run4flat wanted me to say hi. :-)
14:54 pdurbin hi yourself
14:55 run4flat great, then it should notify LimitSupremum correctly
14:55 run4flat I've figured out a handy way to build one-off messages into liddle_piddle_bot
14:55 run4flat if you log back in, it won't send you that message
14:56 run4flat it only sends it once
14:56 run4flat I kinda want to turn that into a feature of liddle_piddle_bot that's a bit easier to use
14:57 pdurbin ok
14:58 run4flat since it's not uncommon for somebody to ask a question while I'm away, and nobody here can answer it
14:58 pdurbin run4flat: we are lost without you
14:58 run4flat heh
14:58 run4flat the sentiment is much appreciated
15:00 pdurbin is there a http://pleac.sourceforge.net for data-oriented languages? PDL, R, etc?
15:01 run4flat I don't think so, though it would be quite helpful, I'm sure
15:01 run4flat add matlab/octave and numpy/python to that list
15:02 pdurbin yeah
15:05 run4flat liddle_piddle_bot, tell run4flat this is a test
15:05 run4flat ha
15:06 run4flat Let's try that again
15:07 liddle_piddle_bot joined #pdl
15:07 run4flat liddle_piddle_bot, tell run4flat this is a test
15:07 run4flat left #pdl
15:07 run4flat joined #pdl
15:07 liddle_piddle_bot run4flat, this is a test
15:07 run4flat left #pdl
15:07 run4flat joined #pdl
15:08 run4flat sweet
15:08 run4flat liddle_piddle_bot, tell LimitSupremum run4flat wanted you to see his response to your question about outer: http://irclog.perlgeek.de/pdl/2013-05-22
15:11 run4flat whereis FFT
15:11 liddle_piddle_bot run4flat: Found FFT in PDL::FFT.pm (http://pdl.sourceforge.net/PDLdocs/FFT.html)
15:11 run4flat whereis fft
15:11 liddle_piddle_bot run4flat: Found fft in PDL::FFT (http://pdl.sourceforge.net/PDLdocs/FFT.html#fft), PDL::FFT (http://pdl.sourceforge.net/PDLdocs/FFT.html#fft), PDL::FFT (http://pdl.sourceforge.net/PDLdocs/FFT.html#fft), PDL::FFT (http://pdl.sourceforge.net/PDLdocs/FFT.html#fft)
15:12 run4flat whereis outer
15:12 liddle_piddle_bot run4flat: Found outer in PDL::Primitive (http://pdl.sourceforge.net/PDLdocs/Primitive.html#outer)
15:35 run4flat OK, I updated the wiki for liddle_piddle_bot: https://github.com/PDLPorters/pdl/wiki/PDL-IRC
15:36 run4flat now you can leave messages. :-)
15:36 pdurbin nice. I asked about pleac for R etc. here https://lists.iq.harvard.edu/pipermail/techtalkfollowup/2013-May/date.html
15:36 pdurbin but it got split into two messages :(
15:39 run4flat Hmm, how is that dated May 7?
15:39 run4flat see the date at the top of this page: https://lists.iq.harvard.edu/pipermail/techtalkfollowup/2013-May/000002.html
15:40 pdurbin it is to cry
16:03 LimitSupremum joined #pdl
16:03 liddle_piddle_bot LimitSupremum, run4flat wanted you to see his response to your last question: http://irclog.perlgeek.de/pdl/2013-05-22
16:04 liddle_piddle_bot LimitSupremum, run4flat wanted you to see his response to your question about outer: http://irclog.perlgeek.de/pdl/2013-05-22
16:04 run4flat oops
16:04 run4flat didn't mean to double-post that message
16:04 run4flat hello, LimitSupremum
16:04 run4flat :-)
16:04 LimitSupremum hi
16:05 LimitSupremum reading through th elog
16:11 run4flat liddle_piddle_bot leave
16:11 run4flat Argh, not qute ready for that test...
16:11 liddle_piddle_bot joined #pdl
16:12 run4flat liddle_piddle_bot, tell run4flat this is a test
16:12 run4flat left #pdl
16:12 run4flat joined #pdl
16:12 liddle_piddle_bot run4flat, this is a test
16:12 run4flat ok, good
16:12 run4flat liddle_piddle_bot, tell run4flat this is a test
16:12 liddle_piddle_bot joined #pdl
16:12 run4flat left #pdl
16:12 run4flat joined #pdl
16:13 run4flat hmm
16:13 run4flat liddle_piddle_bot, tell run4flat this is a test
16:14 liddle_piddle_bot joined #pdl
16:14 run4flat liddle_piddle_bot, tell run4flat this is a test
16:16 liddle_piddle_bot joined #pdl
16:16 run4flat left #pdl
16:16 run4flat joined #pdl
16:16 liddle_piddle_bot run4flat, this is a test
16:16 run4flat ah, good
16:16 run4flat :-)
16:17 run4flat now, liddle_piddle_bot remembers messages even if it breaks and gets restarted
16:17 run4flat :-)
16:17 LimitSupremum I see, so the point of this thing is to deliver messages to currently offline people?
16:17 run4flat the point of my last set of tests
16:18 run4flat sorry, those weren't complete sentences
16:18 LimitSupremum sorta. have you worked with J or R before?
16:18 run4flat the last 10 minutes or so, I've been testing a delayed message system through liddle_piddle_bot
16:18 run4flat anyway, no, I haven't used J or R, though I'm familiar with them
16:19 LimitSupremum right, so one thing I'm a little bit confused about is higher order functions since I can't find them in the documentation
16:19 LimitSupremum getting the difference between pairs in a list in J is  -/~ list
16:19 run4flat I can think of two meanings of the term "higher order functions"
16:19 LimitSupremum and in R it's outer(list,list,'-')
16:20 LimitSupremum I just meant a function that takes a function as an argument
16:20 run4flat ok
16:20 run4flat hmm
16:20 run4flat ok
16:20 LimitSupremum the outer method I think just does multiplication
16:20 LimitSupremum not arbitrary tensor products
16:21 run4flat I'm confused by the actual output of "outer" vs your description
16:21 LimitSupremum it makes a matrix
16:21 run4flat it looks like outer takes the transpose of a given vector and sends it, along with the second argument to the given operator
16:21 LimitSupremum the ij_th entry of which is i_th element of the list - the j_th element of the list
16:22 run4flat For this particular situation, PDL has a general machinery that we can use in a particular way to achieve the same thing
16:22 LimitSupremum outer(c(4,5,6),c(0,100),'-')
16:22 LimitSupremum [,1] [,2]
16:22 LimitSupremum [1,]    4  -96
16:22 LimitSupremum [2,]    5  -95
16:22 LimitSupremum [3,]    6  -94
16:22 run4flat here's how I'd say that in PDL
16:23 run4flat \$a = pdl(4, 5, 6)
16:23 LimitSupremum right, I wrote some code to do the same thing, but it's too verbose and not idiomatic
16:23 LimitSupremum oh
16:23 run4flat \$b = pdl(0, 100)
16:23 run4flat p \$a->transpose - \$b
16:24 run4flat If you fire up the PDL shell and enter those three lines, you should get the same output as what you got before
16:24 LimitSupremum I ... did
16:24 LimitSupremum wait what that's confusing
16:24 run4flat I suspect you have more general notions in mind, and I suspect this doesn't answer your underlying question...
16:24 run4flat but we'll get there
16:25 LimitSupremum oh I see
16:25 LimitSupremum so I have something of dimension
16:25 LimitSupremum 3
16:25 LimitSupremum and something of dimension 1,3
16:25 LimitSupremum and apply an operation that works on scalars like -
16:26 run4flat right
16:26 LimitSupremum I'll get a 3,3 result equivalent to using outer or table
16:26 run4flat yeah
16:26 run4flat It looks like r provides the "outer" function to perform outer products, outer additions, etc
16:27 LimitSupremum yeah
16:27 LimitSupremum pdl doesn't need them
16:27 run4flat though I must say I've only heard of outer products
16:27 run4flat right, stupid index tricks will suffice. :-)
16:27 LimitSupremum so in J you have noun and verb rank
16:28 LimitSupremum and that determines how verbs (functions) are applied to their arguments
16:28 run4flat interesting
16:28 LimitSupremum I can't figure out what the PDL equivalent is
16:28 LimitSupremum but I suspect the rules are simple and fairly general
16:28 run4flat so in PDL, you figure this out checking the signature
16:28 run4flat ... at least, I think this is how it would work...
16:29 LimitSupremum oh I see, the signature tells you the smallest unit of data a function operates on
16:29 run4flat right, and it always works on the first ranks
16:29 LimitSupremum same with J, okay I get this so far
16:29 LimitSupremum and R kind of but R is weird
16:29 run4flat great
16:29 LimitSupremum the thing that confuses me
16:29 LimitSupremum is why transpose worked
16:30 LimitSupremum are dimensions of length 1 treated specially?
16:30 run4flat ah, that's a special condition for auto-looping performed by PDL
16:30 run4flat yes
16:30 LimitSupremum where are the rules for auto-looping?
16:30 run4flat btw, auto-looping is called "threading"
16:30 LimitSupremum I see
16:30 run4flat which is unfortunate
16:30 liddle_piddle_bot run4flat: Could not find threading.
16:30 LimitSupremum ah
16:31 run4flat yeah, see if that helps
16:31 LimitSupremum thanks
16:32 run4flat I didn't write it, and I always thought it was a little difficult to get through
16:32 run4flat so feel free to ask questions
16:32 run4flat and maybe I'll submit a docs patch if we come up with a better way of explaining something
16:35 LimitSupremum ohhh that's clever
16:36 LimitSupremum \$a->xchg(1,0) -= \$cols
16:36 LimitSupremum hah
16:36 run4flat wait... does that actually work?
16:36 * run4flat checks
16:37 * run4flat wipes brow
16:37 run4flat oh, you mean \$a from the documentataion. :-)
16:38 LimitSupremum yeah
16:38 LimitSupremum sorry
16:38 run4flat n/p
21:01 run4flat Argh, the numpy/scipy documentation is severely lacking in useful examples
21:01 run4flat especially help with solving pitfalls
21:01 run4flat if anybody has problems with PDL's documentation, TELL ME so I can address it
21:02 run4flat we try to have useful examples for all of our documentation, but I'm sure we fall short sometimes
23:18 LimitSupremum joined #pdl