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
| buildscript { | |
| ext.kotlin_version = '1.1.3-2' | |
| repositories { | |
| mavenCentral() | |
| jcenter() | |
| } | |
| dependencies { | |
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
| classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlin_version") |
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
| { | |
| "lender": "4,851.05", | |
| "owner": "3,655.51", | |
| "total": "8,506.56", | |
| "details": { | |
| "lender": { | |
| "itemized": [ | |
| { | |
| "total": "83.25", | |
| "range": "$35,000.00..$50,000.00", |
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
| package com.example; | |
| import org.apache.spark.sql.Dataset; | |
| import org.apache.spark.sql.SparkSession; | |
| import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder; | |
| import scala.runtime.AbstractFunction1; | |
| import java.util.Arrays; | |
| import java.util.function.Function; |
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 scalaz.concurrent.Actor | |
| import collection.mutable.ArrayBuffer | |
| import java.util.Timer | |
| /** | |
| * Usage: | |
| * | |
| * <code> | |
| * val buffer = BufferActor[String](onFlush = _ foreach (println(_), onError = println(_)) | |
| * buffer ! "Now we're talking!" |
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 ShinyNewObject{ | |
| val lovelyProperty = "Property we share" | |
| val notSoLovelyProperty = 3.14 | |
| def weCanHazDoStuff(stuff: String) = doingCoolStuffHere(stuff) | |
| } |
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
| public void doWithFields(Class<?> clazz) { | |
| ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() | |
| { | |
| public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException { | |
| System.out.println(field); | |
| } | |
| }); | |
| } |
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
| <dependency> | |
| <groupId>org.springframework</groupId> | |
| <artifactId>spring-core</artifactId> | |
| <version>3.0.2.RELEASE</version> | |
| </dependency> |
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
| public static <T> Collection<T> toStringFiltered(List<T> aListOfTs) { | |
| return Collections2.filter(aListOfTs, new Predicate<T>() | |
| { | |
| public boolean apply(T from) { | |
| return from.toString().isEmpty(); | |
| } | |
| }); | |
| } |
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
| public static <T> Collection<String> toString(List<T> aListOfTs) { | |
| return Collections2.transform(aListOfTs, new Function<T, String>() | |
| { | |
| public String apply(T from) { | |
| return from.toString(); | |
| } | |
| }); | |
| } |
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
| aListOfTs.map(_.toString) |
NewerOlder