Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2014-07-09

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:06 jberger_ joined #pdl
00:35 drrho joined #pdl
02:21 mohawk new Inline dev release, test results welcome
12:13 ilbot2 joined #pdl
12:13 Topic for #pdl is now Install PDL: http://pdl.perl.org/?page=install  | Book: http://pdl.perl.org/content/pdl-book-toc.html | Mailing list: http://pdl.perl.org/?page=mailing-lists | Pasting: http://scsys.co.uk:8001/pdl | Channel is logged by ilbot2: http://irclog.perlgeek.de/pdl/today
12:14 lungching joined #pdl
13:18 vicash joined #pdl
13:34 gtodd joined #pdl
13:49 gtodd sivoais: grimoire :-)  nice name for that app
14:52 rindolf joined #pdl
15:23 mohawk joined #pdl
16:01 sivoais hehe... :-)
16:06 mohawk ?
16:06 mohawk what's grimoire?
16:10 gtodd in french it means a book full of random notes scribbling
16:10 gtodd sort of
16:10 gtodd https://github.com/zmughal/p5-Dev​el-REPL-Web/tree/master/grimoire
16:11 gtodd but here it's mojo perl's *secret weapon*
16:12 mohawk ha
16:12 mohawk in english, it's used for the books used by fictional sorcerers to keep their spells
16:14 mohawk i've just remembered i wrote a web REPL back in the day
16:14 gtodd for maybe one day a web repl for perl and PDL w/  html5 SVG javadoodoo enhanced thingies etc
16:14 mohawk i called it "websh", it was effectively a command shell in a CGI
16:14 gtodd probably spells hexes etc too yeah but that is handled at a lower level in perl :)
16:14 mohawk that IS perl
16:15 mohawk what's mojo perl?
16:15 gtodd hehe
16:15 gtodd just mojolicious
16:18 gtodd http://rosettacode.org/wiki/GUI​_enabling/disabling_of_controls  hmm there's a perl6 entry but no perlTk or Prima there ... and one of the entries stretches things by saying the "GUI" is a web page ...
16:18 gtodd mohawk:  so perhaps one could say mojolicious is a GUI for perl ;-)
16:20 sivoais yeah, I've been treating the browser as my GUI for a while. The event loops for multimedia are easier and someone already did the portability work...kinda... :-P
16:20 mohawk https://www.youtube.com/watch?v=BLc5mvOGgxc
16:21 mohawk brb
16:27 gtodd sivoais: damnit that rosettacode page should have a p5/mojolicious entry
16:48 mohawk joined #pdl
17:22 perltricks joined #pdl
17:24 perltricks hey qq. Can a PDL hold multiple data types? I have a multi dimensional array with both discrete and continuous variables. But when I create a pdl it clobbers the discrete text variables to zero, as the default pdl datatype is double
17:45 gtodd ...
17:45 sivoais perltricks: no, it uses a single type. That's how it vectorises computations
17:46 sivoais btw, are you trying to make a table?
17:52 perltricks sivoais: thanks. No I've got a dataset of people with different attributes and am building a predictive model for $work
17:55 sivoais perltricks: would something like R's data frames be useful there? I've been wanting to write a data frame module for Perl.
18:04 sivoais I think I should just write out the logic of a data frame and think about features like HDF5 and SQL later. :-P It shouldn't be hard.
18:07 vicash perltricks: each attribute can be assigned an integer/double value and then you can load it into a PDL object ...
18:08 vicash since you're building a predictive model, mapping a text string to a number will eventually need to be done anyway
18:09 perltricks hey all yeah thanks for the feedback
18:09 perltricks I guess I could map the discrete vars to numbers yeah
18:10 vicash perltricks: think of it as creating an enum
18:11 perltricks I haven't used R Data frames before, but it would be nice to have different data types in a pdl. Although I'm ignorant of the downsides so .... whatever
18:11 perltricks right, yeah an enum
18:11 vicash you will have the same issue in R
18:12 sivoais in R, enums are done the same way. They're called factors.
18:12 vicash a data.frame can save any table form into a data.frame object but any mathematical work will have to be done by either transforming the non-numeric values to something numeric or subsetting the data.frame into a numeric-only data frame
18:13 perltricks so next question. Is it possible to have a a slice from a where function where the condition is on the nth element of the row. The examples I've seen seem to assume a 1 dimensional array
18:17 sivoais perltricks: there is whereND
18:18 sivoais but I think what you want is something like SELECT * WHERE col = "foo" ?
18:20 perltricks yeah so given this data: [ [1, 20], [2, 13], [3, 27] ]
18:20 perltricks be able to select the rows where [1] > 15
18:23 sivoais hmm, going to try coming up with something
18:26 mohawk PDSQL ;-)
18:27 mohawk can a slice be like a "where"?
18:27 * mohawk is woefully ignorant about slices and quite interested in how this turns out
18:30 sivoais really, a data frame would be good here...PDL::Stats kind of has what you want, but it's not as easy as R
18:32 mohawk so the takeaway would be "use R"?
18:34 sivoais Yeah :-( It's made for this. It's not a bad tool, just not as general purpose as Perl.
18:36 mohawk the right tool for the job
18:36 mohawk nothing wrong with that
18:36 mohawk pity that's not perl here though ;-)
18:37 sivoais perltricks: this is what I've got
18:37 sivoais $g = pdl q[ [1, 20], [2, 13], [3, 27]  ]; $col = $g->slice('1,'); $g->dice(X, which( $col > 15 ))
18:40 sivoais in R, that would be: subset( my_data, SecondColName > 15 )
18:42 mohawk that looks good
18:49 sivoais aha! I just had an idea on how to make a similar interface in Perl.. Use the same localise trick that List::Utils uses
18:49 sivoais and get
18:49 * pdurbin went to an R workshop yesterday
18:49 sivoais subset $my_data { $SecondColName > 15 }
18:50 mohawk sivoais, do it!
19:04 sivoais mohawk: I will! It's the right combination of easy and fun coding. Unlike the units of measure idea I'm working on which is hard and fun.
19:04 sivoais pdurbin: how did you like it? Did you cover any data-mining?
19:07 pdurbin a little mind bending. I'm new to R. just a quick intro over lunch
19:09 pdurbin touched on https://github.com/IQSS/Zelig a bit. which is developed in house
19:09 chm joined #pdl
19:11 chm perltricks: Work on PDL3 is planned to add improved type support including pdls of objects
19:13 chm perltricks, sivoais:  Or using whereND:  $g->whereND($g(1)>15)
19:15 sivoais ah, that's where I was using whereND wrong... awesome
19:18 sivoais pdurbin: I was looking through the Data Science site and <http://datascience.iq.harvard.edu/tworavens> looks interesting
19:19 sivoais exploratory data analysis :-)
19:24 pdurbin sivoais: right, so from https://github.com/IQSS/dataverse (the app I work on) you can click "explore" to launch https://github.com/IQSS/TwoRavens (a d3.js app) which calls into https://github.com/IQSS/Zelig (an R package) that actually does the analysis
19:27 gtodd pdurbin: in the past I only really used R for data and grew to like it's "REPL plus" approach (commands for launching graphics, browser based output, printing to PDF printers SVG web browser based mostly contextual documentation etc) and especially the save-able "dataframe and workspace" thing where you save the state of your work and come back to it ...
19:27 pdurbin gtodd: makes sense
19:28 gtodd I think a lot of that would be doable from Devel::REPL or reply or PDL shell
19:35 mohawk i'd like to believe perl has enough introspection and GUI stuff to make that highly doable ;-)
19:37 pdurbin I had never used "R Console" before. It's a decent GUI app. And I hear RStudio is even nicer.
19:37 vicash pdurbin Rstudio is like a Visual Studio for R with all auto-complete and all that ....
19:38 vicash R Console is a very basic UI for R.
19:39 pdurbin right
19:40 vicash unless you need to build a UI in R, I would recommend using either R Studio or R-cmdline + $EDITOR...
19:44 gtodd there's some neat .R. webserver frameworks too ... in keeping with the "portable GUI" idea ;-)
19:45 perltricks pdurbin: thanks!
19:46 pdurbin perltricks: for what? :)
19:46 perltricks whereND example
19:52 pdurbin perltricks: that was sivoais
19:53 vicash ha perltricks that was chm
19:55 gtodd I thought it was perltricks :)
19:56 perltricks hah, sorry. thanks all
21:27 chm joined #pdl
21:28 chm gtodd: Regarding "REPL plus" for PDL.  Definitely something readily done within the current pdl2 or perldl shells.
21:29 chm I haven't made the push since I would like to see perldl and pdl2 unified into a single REPL command line shell.
21:30 chm At that point, we could use it in a GUI REPL wrapper and add some friendliness routines.
21:30 chm One thing that pdl2 support but not perldl is lexical variables.  It should be possible to track and save the
21:31 chm entire shell state to resume at a later date or for data/computation provenance.
21:33 chm perltricks, sivoais: PDL slicing is already very/too powerful.  It would be useful to simplify access to that great power---it's our great responsibility.  :-)
21:34 chm And from the PDL3 plan list, we have named dimensions which could allow for category or text type indexing.
22:07 mohawk you may be excited to know we're looking at making an Inline v1.0!
22:17 mohawk by the way, much more immediate - Inline 0.56 is the last one that will include Inline::C

| Channels | #pdl index | Today | | Search | Google Search | Plain-Text | summary