Skip to content

Instantly share code, notes, and snippets.

View TreeZipper.java
public class HelloWorld
{
public static void main(String[] args)
{
Node one = new Node(2, new Node(1, null, null), null);
Zipper zipper = new Zipper(null, one);
System.out.println(zipper.left().set(5).newLeft(3).up().up().set(10).newRight(15).newLeft(12).reconstruct());
}
}
View ListZipper.java
class ListZipperDemo {
// arguments are passed using the text field below this editor
public static void main(String[] args) {
Node oneThruFive = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));
Zipper zipper = new Zipper(null, oneThruFive);
System.out.println(zipper.next().next().set(30).next().remove().insert(40).reconstruct());
}
}
class Node {
View A.java
public abstract class A<T> {
public T b;
public A(T b) {
this.b = b;
}
}
View gist:925497
$ sbt
[info] Building project migscala 1.0 against Scala 2.8.1
[info] using MigScalaProject with sbt 0.7.5 and Scala 2.7.7
> update
[info]
[info] == update ==
java.lang.IllegalArgumentException: Cannot add dependency 'com.miglayout#miglayo
ut;3.7.4' to configuration 'swing' of module migscala#migscala_2.8.1;1.0 because
this configuration doesn't exist!
View After.java
class Person {
final String address = makeAddress();
public String getAddress() {
return address;
}
static String makeAddress() {
String result = "1, The Crescent\n";
result += "Codeville";
View gist:402342
class After {
final String address = makeAddress();
public String getAddress() {
return address;
}
static String makeAddress() {
String result = "1, The Crescent\n";
result += "Codeville";
View gist:385329
package uk.org.netvu.util;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import java.io.ByteArrayOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
public class Base64Encoder {
View gist:382097
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.List;
class Main {
public static void main(String[] args) {
System.out.println("Version 1");
MutableComplex.main();
View Common.properties
AlarmImage=Imagem de alarme
SiteInfo=Informações do site
SitePlan=Plano do sítio
LogEvent=Registrar o Evento
Exception=Exceção
Info=Informação
EventList=Lista de Eventos
Online=Conectado
Offline=Desligado
ReviewCurrentCall=Reproduzir a Chamada Actual
View cucumber_scala_dsl.scala
def Given(name: String, body: Either[String => String, (Int, String) => String]) = {
body match {
case Left(b) => b("bob")
case Right(b) => b(5, "belly")
}
}
Given("I have (\\d+) cukes in my (.*)", Right("You have " + _ + " cukes in your " + _))
Given("my name is (.*)", Left("Your name is " + _))