Skip to content

Instantly share code, notes, and snippets.

@Sciss
Sciss / build.sbt
Created September 1, 2019 12:44 — forked from markehammons/build.sbt
Packaging your application with a minimized runtime courtesy of jlink
import java.io.{ByteArrayOutputStream, PrintWriter}
import java.util.spi.ToolProvider
enablePlugins(JavaAppPackaging)
//this allows us to run tools like jdeps and jlink from within the JVM
def runTool(name: String, arguments: Seq[String]): Either[String,String] = {
val maybeTool: Option[ToolProvider] = {
val _tool = ToolProvider.findFirst(name)
if(_tool.isPresent) {
[error] java.lang.AssertionError: assertion failed:
[error] type AnyRef in java.lang
[error] while compiling: /home/hhrutz/Documents/devel/Lucre/geom/src/main/scala/de/sciss/lucre/geom/Space.scala
[error] during phase: globalPhase=terminal, enteringPhase=typer
[error] library version: version 2.12.9
[error] compiler version: version 2.12.9
[error] reconstructed args: -Ywarn-unused:imports -Ywarn-unused:privates -Ywarn-unused:locals -Ywarn-unused:implicits -encoding utf8 -deprecation -Xsource:2.13.0 -release 8 -feature -classpath /home/hhrutz/.ivy2/cache/de.sciss/serial_2.12/jars/serial_2.12-1.1.1.jar -bootclasspath /home/hhrutz/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.12.9.jar -Xlint:adapted-args -Xlint:nullary-unit -Xlint:inaccessible -Xlint:nullary-override -Xlint:infer-any -Xlint:missing-interpolator -Xlint:doc-detached -Xlint:private-shadow -Xlint:type-parameter-shadow -Xlint:poly-implicit-overload -Xlint:option-implicit -Xlint:delayedinit-select -Xlint:by-n
// negatum-94fb0dd8
def Protect(in: GE, lo: Double, hi: Double, dyn: Boolean): GE = {
val in1 = if (lo.isInfinite && hi.isInfinite) in
else if (lo.isInfinite) in.min(hi)
else if (hi.isInfinite) in.max(lo)
else in.clip(lo, hi)
val in2 = if (dyn) LeakDC.ar(in1) else in1
in2
val fCfg = userHome / ".config" / "rncbc.org" / "QjackCtl.conf"
assert(fCfg.isFile)
val cOld = {
import java.io._
val in = new FileInputStream(fCfg)
try {
val sz = in.available()
val arr = new Array[Byte](sz)
in.read(arr)
Full thread dump OpenJDK 64-Bit Server VM (25.212-b03 mixed mode):
"Attach Listener" #152 daemon prio=9 os_prio=0 tid=0x00007f9e9c001000 nid=0x6534 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"scala-execution-context-global-145" #145 daemon prio=6 os_prio=0 tid=0x00007f9e04006000 nid=0x6500 waiting on condition [0x00007f9e29df8000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000005cbdd9d80> (a java.util.concurrent.ForkJoinPool)
at java.util.concurrent.ForkJoinPool.awaitWork(ForkJoinPool.java:1824)
val sr = "sample-rate".attr(44100.0)
//val noiseLen = "noise-dur".attr(1.0).max(0.0) * sr
val numZero = "zero-crossings".attr(6).max(1)
val f1 = "f1".attr( 500.0)
val f2 = "f2".attr(1000.0)
//val roll = "roll".attr(0.0)
val tpe = "type".attr(1).clip(0, 4)
//val noise = WhiteNoise().take(noiseLen)
val noiseLen = 1
val in0 = ImageFileIn("in")
val wIn = in0.width
val hIn = in0.height
val wOut = "width".attr(1920)
val hOut = "height".attr(1080)
val num = "num-frames".attr(100)
val gamma = "gamma".attr(1.0)
val szIn = wIn * hIn
val szOut = wOut * hOut
val in = RepeatWindow(in0, szIn, num)
<html>
<head>
<style>
em {
font-style: normal;
}
em::before {
content: "*";
}
em::after {
object Sandbox {
/*
the matrix of required support:
map: Ex[Option[A]] -> Ex[B] -> Ex[Option[B]]
map: Ex[Seq[A]] -> Ex[B] -> Ex[Seq[B]]
map: Ex[Option[A]] -> Act -> Ex[Option[Act]]
map: Ex[Seq[A]] -> Act -> Ex[Seq[Act]]
flatMap: Ex[Option[A]] -> Ex[Option[B]] -> Ex[Option[B]]
flatMap: Ex[Seq[A]] - > Ex[Option[B]] -> Ex[Seq[B]]
flatMap: Ex[Seq[A]] - > Ex[Seq[B]] -> Ex[Seq[B]]
// ==UserScript==
// @name Disable ctrl-F keyboard hijacking
// @description Stop websites from highjacking keyboard shortcuts
//
// @run-at document-start
// @include *
// @grant none
// ==/UserScript==
document.addEventListener('keydown', function(e) {