Skip to content

Instantly share code, notes, and snippets.

case class stream(key: String)
implicit class DiskInStream(peer: DiskIn.type) {
def ar(stream: stream, loop: GE = 0): DiskIn = DiskIn.ar(1, 0, loop) // (test placeholder)
}
DiskIn.ar(stream("foo")) // phew, "overloading" works

To install:

sudo apt-get install openjdk-6-jdk

and

sudo apt-get install openjdk-7-jdk

Somehow this leaves OpenJDK 6 as default (which is fine).

import java.awt._
import javax.swing._
import image.BufferedImage
val f = new JFrame("Foo")
val img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB)
val g = img.createGraphics
g.setPaint(new LinearGradientPaint(0f, 0f, 256f, 256, Array(0f, 1f), Array(Color.red, Color.blue)))
g.fillOval(0, 0, 256, 256)
g.dispose()
@Sciss
Sciss / IdeaCE.desktop
Created February 21, 2014 16:42
KDE desktop entry for IntelliJ IDEA 13 CE
[Desktop Entry]
Name=IntelliJ IDEA CE 13
Version=1.0
GenericName=IntelliJ IDEA CE 13
Comment=JetBrains IntelliJ IDEA Development Environment
Exec=/home/hhrutz/Applications/idea-IC-133.696/bin/idea.sh
StartupWMClass=jetbrains-idea-ce
Icon=/home/hhrutz/Applications/idea-IC-133.696/bin/idea.png
Categories=Development;
Terminal=false
import javax.swing._
val f = new JFrame
val p = f.getContentPane.asInstanceOf[JComponent]
p.addKeyListener {
new java.awt.event.KeyAdapter {
override def keyPressed (e: java.awt.event.KeyEvent): Unit = println(e)
override def keyReleased(e: java.awt.event.KeyEvent): Unit = println(e)
override def keyTyped (e: java.awt.event.KeyEvent): Unit = println(e)
}
Migrating from computer A to computer B, such that publishing to Sonatype works again:
1. on A:
$ gpg --export-secret-keys -a <key-id> > /Volumes/<USB>/temp.asc
$ cp ~/.sbt/0.13/credentials.sbt > /Volumes/<USB>/
2. on B:
$ gpg --import /media/usb0/temp.asc
@Sciss
Sciss / WebLAF_InternalFrame.java
Created February 24, 2014 13:55
Attempt to reproduce WebLaF issue #90 - doesn't reproduce the bug though....
package de.sciss.debug;
import com.alee.laf.WebLookAndFeel;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Debug implements Runnable {
public static void main(String[] args) {
def foo(x0: => Int): Unit = {
lazy val x = {
println("resolve foo")
x0
}
x
x
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.