This file contains 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
// Problematic code snippet, `collect` invocation causes compiler to crash with an error below | |
val cache2 = cache | |
.withoutPath(quotedAlias) | |
.withValue("\"" + url + "\"", newConfig(Map( | |
"lastCheckMs" -> cacheObj.get[Option[Long]]("lastCheckMs").value, | |
"lastUpdateMs" -> cacheObj.get[Option[Long]]("lastUpdateMs").value | |
).collect { case (k, Some(v)) => (k, v) })) | |
/* | |
[error] java.lang.IllegalArgumentException: Could not find proxy for case val x1: Tuple2 in List(value x1, method applyOrElse, <$anon: Function1>, value cache2, method $anonfun$post-1.3_1$1, value x1, value x$1, method post-1.3_1, class MigrationService, package migration, package checker, package fs, package org, package <root>) (currentOwner= value k ) |
This file contains 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 debounce(func, wait, immediate) { | |
let timeout; | |
return function() { | |
let context = this, args = arguments; | |
let later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); | |
}; | |
let callNow = immediate && !timeout; | |
clearTimeout(timeout); |
This file contains 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 org.newtonpolyhedron.ex; | |
public class WrongFormatException extends Exception { | |
private static final long serialVersionUID = 1943547769150295590L; | |
public WrongFormatException() {} | |
public WrongFormatException(String msg) { | |
super(msg); |
This file contains 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
trait Foo { self => | |
type SelfType <: Foo { | |
type SelfType = self.SelfType | |
} | |
} | |
// SelfType points to its child type | |
trait FooExtLvl1 extends Foo { | |
type SelfType = FooExtLvl2 | |
} |
This file contains 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 test.* | |
Parent.withNewSession { | |
Parent.withNewTransaction { | |
def parent = new Parent() | |
.addToChildren(new Child(name: "a")) | |
.addToChildren(new Child(name: "b")) | |
.addToChildren(new Child(name: "c")) | |
.save(failOnError: true) | |
} |
This file contains 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
Merge: | |
z | |
|\ | |
| g | |
x | | | |
| * | | |
| | f | |
| * | | |
| * | |
This file contains 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
# Generated by Slick (select terms optimized for clarity) | |
# Takes 47034 ms | |
SELECT * | |
FROM ( | |
SELECT x281.id | |
FROM `comp_proposal_raw_batch_comp_proposal_raw` x282, `comp_proposal_raw` x281 | |
WHERE (x282.`comp_proposal_raw_batch_proposals_id` = 4936) AND (x281.`id` = x282.`comp_proposal_raw_id`) | |
) x187 | |
INNER JOIN ( | |
SELECT * |
This file contains 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
SELECT status_temp.id FROM ( | |
SELECT temp_batch.original_id as id, temp_batch.validation_errors, COUNT(temps_enabled.id), COUNT(temps_disabled.id) | |
FROM comp_proposal_raw_temp_batch temp_batch | |
LEFT OUTER JOIN comp_proposal_raw temps_enabled | |
ON temps_enabled.temp_batch_id = temp_batch.id AND temps_enabled.dont_integrate = 0 | |
LEFT OUTER JOIN comp_proposal_raw temps_disabled | |
ON temps_disabled.temp_batch_id = temp_batch.id AND temps_disabled.dont_integrate = 1 | |
GROUP BY temp_batch.original_id | |
HAVING (COUNT(temps_enabled.id) = 0 AND COUNT(temps_disabled.id) > 0) OR temp_batch.validation_errors > 0 | |
) status_temp |
This file contains 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
trait A { | |
val a: Int | |
} | |
trait B extends A { | |
println(a) | |
} | |
trait C extends A { | |
override val a: Int = 10 |
This file contains 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
trait Parsers { | |
type Elem | |
type Input = Reader[Elem] | |
sealed abstract class ParseResult[+T] { | |
... | |
} | |
case class Success[+T](result: T, override val next: Input) extends ParseResult[T] { | |
... | |
} |