These are chat archives for freeman-lab/discussion

20th
Jan 2016
Jeremy Freeman
@freeman-lab
Jan 20 2016 19:59
@mathisonian oops meant to be typing in here
Andrew Osheroff
@andrewosh
Jan 20 2016 20:00
Jeremy Freeman
@freeman-lab
Jan 20 2016 20:01
basically, the idea would be an electron app for matlab-style GUI building
Kyle Kelley
@rgbkrk
Jan 20 2016 20:01
ooooh love this paper so far
Jeremy Freeman
@freeman-lab
Jan 20 2016 20:02
that you'd talk to via clients (just like our lightning app)
also a lot like @rgbkrk 's sidecar
(hehe hey kyle!)
the backstory is that we're still finding a lot of scientists who insist on using MATLAB because you can easily build GUIs
and there are even cases of people using python now for all their analysis, dumping it into a MAT file, and loading up in matlab to use matlab's GUIs
Nicholas Sofroniew
@sofroniewn
Jan 20 2016 20:03
i miss my matlab GUIs
Kyle Kelley
@rgbkrk
Jan 20 2016 20:03
:) Jupyter pretty much provides sidecar for free
Just hooking into the zeromq sockets and Jupyter message spec
FRP is fun, as is just plain RP
const iopub = enchannel.createIOPubSubject(identity, config);
const displayData = iopub
                      .filter(msg => msg.header.msg_type === 'execute_result' ||
                              msg.header.msg_type === 'display_data')
                      .filter(msg => msg.content)
                      .map(msg => msg.content.data);

const streamReply = iopub
                      .filter(msg => msg.header.msg_type === 'stream')
                      .map(msg => msg.content);

streamReply.subscribe(content => {
  switch(content.name) {
  case 'stdout':
    process.stdout.write(content.text);
    break;
  case 'stderr':
    process.stderr.write(content.text);
    break;
  }
});

displayData.subscribe(data => {
  if(data['image/png']) {
    temp.open('ick-image', (err, info) => {
      if (err) {
        console.error(err);
        return;
      }
      const decodedData = new Buffer(data['image/png'], 'base64');
      const writer = fs.createWriteStream(info.path);
      writer.end(decodedData);
      writer.on('finish', () => {
        imageToAscii(info.path, (imErr, converted) => {
          console.log(imErr || converted);
        });
      });
    });
  }
  else if(data['text/markdown']) {
    console.log(marked(data['text/markdown']));
  }
  else if(data['text/plain']) {
    console.log(data['text/plain']);
  }
});
Applied to Jupyter makes writing clients like that ^^^ a breeze
@captainsafia is going to make that a little more user ready soon
Jeremy Freeman
@freeman-lab
Jan 20 2016 20:05
whoa super sweet!
Kyle Kelley
@rgbkrk
Jan 20 2016 20:06
I'm currently implementing jupyter-paths in node for the 12th time
Right now it calls out to jupyter --paths --json
Enough people requested that it be moved back to pure JS, and so it is
anyway, sorry to derail the FRP Vega awesome
:)
We should chat soon
Jeremy Freeman
@freeman-lab
Jan 20 2016 20:06
haha not at all, this is super cool, and very on topic =)
i guess i'm wondering how to combine these ideas with something like a GUI editor for components that may be slightly different than typical jupyter use cases now
Kyle Kelley
@rgbkrk
Jan 20 2016 20:08
totally
Jeremy Freeman
@freeman-lab
Jan 20 2016 20:08
though i know with all the frontend refactoring that picture is rapidly changing
Kyle Kelley
@rgbkrk
Jan 20 2016 20:08
jupyter should only be about live interaction with a REPL
Jeremy Freeman
@freeman-lab
Jan 20 2016 20:09
yeah...
Kyle Kelley
@rgbkrk
Jan 20 2016 20:09
We do need to figure out a good way to publish built components