T165
T167
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// version 02-Apr-2019 - Mellite 2.33.0 | |
// written by Hanns Holger Rutz | |
// license: CC BY-SA 4.0 | |
val in0 = ImageFileIn("in") | |
val w = in0.width | |
val h = in0.height | |
val hm = h - 1 | |
val in1 = in0.out(0) | |
val dur = "dur" .attr(10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// quick and dirty from | |
// https://math.stackexchange.com/questions/40164/how-do-you-rotate-a-vector-by-a-unit-quaternion | |
def quaternion_mult(q: Vector[Double],r: Vector[Double]) = | |
Vector(r(0)*q(0)-r(1)*q(1)-r(2)*q(2)-r(3)*q(3), | |
r(0)*q(1)+r(1)*q(0)-r(2)*q(3)+r(3)*q(2), | |
r(0)*q(2)+r(1)*q(3)+r(2)*q(0)-r(3)*q(1), | |
r(0)*q(3)-r(1)*q(2)+r(2)*q(1)+r(3)*q(0)) | |
def point_rotation_by_quaternion(point: Vector[Double],q: Vector[Double]) = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Huawei E353/E3131 - HHR 02-Sep-2018 | |
ATTR{idVendor}=="12d1", ATTR{idProduct}=="1506", RUN +="usb_modeswitch '%b/%k'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.imageio.ImageIO | |
import java.awt.image.BufferedImage | |
//////////////////// | |
val f = file("/data/temp/imperfect-reader.jpg") // JPEG colour | |
val in = ImageIO.createImageInputStream(f) | |
val reader = ImageIO.getImageReaders(in).next() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import de.sciss.kollflitz.Vec | |
import de.sciss.kollflitz.Ops._ | |
case class Segment(numFrames: Int, targetLevel: Double, curve: Curve = Curve.linear) { | |
require (numFrames > 0) | |
} | |
object Envelope { | |
implicit def constant(f: Double): Envelope = Envelope(f, Vector.empty) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo | |
import scala.concurrent.stm._ | |
object Test { | |
def main(args: Array[String]): Unit = { | |
var b = true | |
atomic { implicit tx => | |
println("atomic") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// straight translation from Java | |
/* | |
* Copyright (C) 2008 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |