We need two libraries for plotting in Livebook:
- The
vega_lite
package allows us to define our graph specifications
We need two libraries for plotting in Livebook:
vega_lite
package allows us to define our graph specificationsimport com.intellij.openapi.actionSystem.AnActionEvent | |
import static liveplugin.PluginUtil.* | |
import java.awt.* | |
import com.intellij.openapi.wm.ex.* | |
registerAction("FocusFindDialog", "alt shift F") { AnActionEvent event -> | |
def frame = WindowManagerEx.getInstanceEx().getFrame(event.project) | |
frame?.windows.each { Window window -> | |
def className = 'com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog' |
let calc v = | |
let rec loop min_ max_ sum = function | |
| head :: tail -> loop (min min_ head) (max max_ head) (head + sum) tail | |
| [] -> [sum - max_; sum - min_] |> List.map string |> String.concat " " | |
loop 0 0 0 v | |
printfn "%s" (calc [ 4; -3; 7; 8; 2 ]) |
let calc = (n, v) => { | |
if(n < 2 || n > 10) { | |
throw "Tamanho do array de números inválido." | |
} | |
if(v.length < n) { | |
throw "Array de números inválido." | |
} | |
var sum = min = max = v[0]; |