Skip to content

Instantly share code, notes, and snippets.

View scala-native-benchmark-error.txt
Failed: -35 EAGAIN
[error] java.lang.RuntimeException: Nonzero exit code: 1
[error] at scala.sys.package$.error(package.scala:27)
[error] at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.$anonfun$scalaNativeConfigSettings$45(ScalaNativePluginInternal.scala:432)
[error] at scala.Option.foreach(Option.scala:257)
[error] at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.$anonfun$scalaNativeConfigSettings$44(ScalaNativePluginInternal.scala:432)
[error] at scala.scalanative.sbtplugin.ScalaNativePluginInternal$.$anonfun$scalaNativeConfigSettings$44$adapted(ScalaNativePluginInternal.scala:417)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] at sbt.std.Transform$$anon$4.work(System.scala:66)
View first_pi.rb
#My first Sonic Pi thingy!
live_loop :lead_bass do
with_fx :reverb, room: 1 do
with_fx :echo do
p = [1, -1].choose
sample :bass_thick_c, pan: p
sample :bd_boom, amp: 4, rate: 1, pan: -p
sample :loop_garzul, rate: [0.5, 1].choose
sleep 8
View Diverging implicit expansion
trait Parser[A] {
def apply(s: String): Option[A]
}
import scala.util.Try
implicit val stringParser: Parser[String] = new Parser[String] {
def apply(s: String): Option[String] = Some(s)
}
@RomanIakovlev
RomanIakovlev / ExecuteOnCaller.java
Created Jan 21, 2014
On Android, this can be used to schedule callbacks back on the caller thread, if it has a Looper installed, or to the UI thread otherwise.
View ExecuteOnCaller.java
package com.example.concurrent;
import android.os.Handler;
import android.os.Looper;
import java.util.concurrent.Executor;
/**
* When the calling thread has a Looper installed (like the UI thread), an instance of ExecuteOnCaller will submit
* Runnables into the caller thread. Otherwise it will submit the Runnables to the UI thread.
View 1.sql
# --- !Ups
CREATE TABLE users(
email VARCHAR(255) NOT NULL PRIMARY KEY,
name VARCHAR(255)
);
CREATE TABLE subjects(
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
title LONGTEXT NOT NULL,