I hereby claim:
- I am jorgeortiz85 on github.
- I am jorge (https://keybase.io/jorge) on keybase.
- I have a public key whose fingerprint is 6BBB 3DAF 4B48 4133 E7CC A2E0 18C2 FC59 5D5C 0620
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
use std::libc::{c_int, c_ulong, c_void, exit, puts}; | |
struct timeval { | |
tv_sec: i64, | |
tv_usec: i64 | |
} | |
struct itimerval { | |
it_interval: timeval, | |
it_value: timeval |
import com.twitter.util.{Duration, Future, FuturePool, Try} | |
import java.util.concurrent.{LinkedBlockingQueue, ThreadPoolExecutor, TimeUnit} | |
val poolSize = 4 | |
val queue = new LinkedBlockingQueue[Runnable]() | |
val executor = new ThreadPoolExecutor(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS, queue) | |
val futurePool = FuturePool(executor) | |
def doWork(n: Int): Int = { | |
Thread.sleep(1000) |
import com.twitter.util.{Duration, Future, FuturePool, Try} | |
import java.util.concurrent.{LinkedBlockingQueue, ThreadPoolExecutor, TimeUnit} | |
val poolSize = 4 | |
val queue = new LinkedBlockingQueue[Runnable]() | |
val executor = new ThreadPoolExecutor(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS, queue) | |
val futurePool = FuturePool(executor) | |
def doWork(n: Int): Int = { | |
Thread.sleep(1000) |
java.lang.NullPointerException | |
at scala.tools.nsc.symtab.Symbols$Symbol.baseTypeSeqLength$1(Symbols.scala:1003) | |
at scala.tools.nsc.symtab.Symbols$Symbol.isLess(Symbols.scala:1006) | |
at scala.tools.nsc.symtab.Types$Type.baseTypeIndex(Types.scala:769) | |
at scala.tools.nsc.symtab.Types$CompoundType.baseType(Types.scala:1377) | |
at scala.tools.nsc.symtab.Types$TypeRef.baseType(Types.scala:1915) | |
at scala.tools.nsc.symtab.Types$class.firstTry$1(Types.scala:4664) | |
at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$isSubType2(Types.scala:4821) | |
at scala.tools.nsc.symtab.Types$$anonfun$isSubType$1.apply$mcZ$sp(Types.scala:4536) | |
at scala.tools.nsc.symtab.Types$undoLog$.undoUnless(Types.scala:143) |
trait CompanionProvider[T] { | |
type CompanionT | |
def provide: CompanionT | |
}; object CompanionProvider { | |
def apply[T](implicit c: CompanionProvider[T]): c.CompanionT = c.provide | |
} | |
object Foo { | |
def foo = "fooooo" |
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> class Outer { class Inner } | |
defined class Outer | |
scala> trait DepFun { def apply(x: Outer): x.Inner } | |
defined trait DepFun |
import scala.collection.JavaConversions._ | |
case class Foo(s: String) | |
val map: Map[Foo, String] = | |
Map( | |
Foo("a") -> "a", | |
Foo("b") -> "b") | |
val v = map.get("a") // should be a type error, actually returns null |
class FK[A] extends StaticAnnotation | |
class User | |
class Checkin | |
object Main { | |
def fetch[A](id: Int @ FK[A]): A = null.asInstanceOf[A] | |
def main(args: Array[String]): Unit = { | |
val id: Int @ FK[Checkin] = 10 |
import scala.sys.process._ | |
import java.io._ | |
// Run a Process, return the output as a String | |
Process("echo foo") !! | |
// Run a Process, pipe in some input, and return the output as a String | |
Process("cat") #< (new ByteArrayInputStream("foobar".getBytes("UTF-8"))) !! | |
// Run a Process, pipe in some input, and pipe the output to a Array[Byte] |