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
(function() { | |
// request PerformanceResourceTiming info for all resources on the page | |
var resources = window.performance.getEntriesByType('resource'); | |
// filter all resources to just +1 button iframes with timing information | |
var p1Resources = resources.filter(function(rtInfo) { | |
return rtInfo.name.indexOf('_/+1/fastbutton') != -1 && | |
rtInfo.responseStart != 0; | |
}); |
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
val numbersAsStrings = Seq("1", "4", "5", "7", "8", "20", "10") | |
val ints = (numbersAsStrings.view map { _.toInt } filter {_ % 2 == 0}).force |
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
(***********************************************************************) | |
(* Graphics module stub *) | |
(***********************************************************************) | |
exception Graphic_failure of string | |
(* mutable state *) | |
let win_size = ref (0,0) | |
let current_pos = ref (0,0) |
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
object UnitType extends Enumeration { | |
val Em = Value("em") | |
val Px = Value("px") | |
val Pc = Value("%") | |
} | |
import UnitType._ | |
case class Dimension( | |
val length : Double = 0.0, |
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 java.util.*; | |
import static java.util.Arrays.*; | |
import static java.lang.System.*; | |
class Main { | |
public static void main(String[] args) { | |
List<Integer> list = asList(1, 2, 3, 4, 5, 6); | |
Stack<Integer> filtered = new Stack<Integer>(); | |
Iterator<Integer> it = list.iterator(); |
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
class A { | |
public void x(byte b) { System.out.println("byte"); } | |
public void x(long l) { System.out.println("long"); } | |
} | |
class B extends A { | |
public void x(short s) { System.out.println("short"); } | |
public void x(int i) { System.out.println("int"); } | |
} |
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
{ "name": "Plaid", | |
"scopeName": "source.plaid", | |
"fileTypes": ["plaid"], | |
"patterns": [ | |
{ | |
"name": "keyword.source.plaid", | |
"match": "\\b(case|default|import|match|new|of|package|requires|state|override|with)\\b", | |
"comment": "keywords" | |
}, | |
{ |
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
abstract class Term[A] | |
case class Val[A](v : A) extends Term[A] | |
case class Fn[A, B](f : A => B) extends Term[A => B] | |
case class Apply[A, B](fn : Term[A => B], input : Term[A]) extends Term[B] | |
def eval[A](input : Term[A]) : A = input match { | |
case Val(v) => v | |
case Fn(f) => f | |
case Apply(m,d) => eval(m)(eval(d)) |