Day 2

Some things we did

  • More Shiny Server investigation. Today’s issue was related to Shiny Server’s built-in monitoring dashboard (basically, an admin app). There are endpoints in Shiny Server’s code that serve data which populates the dashboard (including the number of running processes, as well as more details). Here’s the Asana task with more details. We couldn’t get far with naive debugging and Alan is in the process of trying to get a repro.

  • I had my 1:1 with Joe (and understood why Nathan’s debugging of Rmds was failing). It turns out that it is indeed expected behavior. For rmarkdown to run/render an Rmd correctly, it must send its output into the to-be-generated artifact (whether it’s an app or a static doc), and so it can’t divert it to the console for debugging. If that’s what you want to do, then, at the debug Browse console prompt, call sink(). This will divert the output from its proper destination to the console, allowing you to examine it for debugging processes. However, this also means that you no longer expect that the generated artifact will be run/rendered correctly. However, if you just run/render it again (without calling sink()), you’re back to normal.

  • Chatted with Yihui to figure out the best release time for the lastet learnr, given that it depends on the latest rmarkdown. After talking to Yihui, I think the best is for me to wait for rmarkdown’s release, which should only be in January.

  • Team sync.

Lingo

The call method (OOP in JS)

In object-oriented Javascript, the .call method is useful when we need to explicitly pass the value of this:

var Person = function(name, age) {
  this.name = name;
  this.age = age;
}                                           // undefined
var barbara = new Person("Barbara", 24)     // undefined
Person.prototype.species = "human"          // 'human'
barbara.species                             // 'human'

var func = function(x) { return this + x; } // undefined
func(5)                                     // '[object global]5'
func.call(10, 5)                            // 15

Miscellanea