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
@prefix foaf: <http://xmlns.com/foaf/0.1/> . | |
@prefix dc: <http://purl.org/dc/terms/> . | |
@prefix locn: <http://www.w3.org/ns/locn#> . | |
@prefix madsrdf: <http://www.loc.gov/mads/rdf/v1#> . | |
@prefix geonames: <http://www.geonames.org/ontology#> . | |
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . | |
@prefix xmpl: <http://ont.example.org/2017/v1.0#> . | |
@prefix time: <http://www.w3.org/2006/time#> . | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
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
# idea stuff | |
*.iml | |
.idea/ | |
# scala staff | |
*.class | |
*.log | |
branches.properties | |
logs |
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
implicit class FutureOps(companion: Future.type) { | |
def unorderedReduce[A, B](in: Iterable[A]) | |
(fn: A => Future[B], combop: (B,B) => B) | |
(implicit executor: ExecutionContext): Future[B] = { | |
val promises = Array.fill(2 * in.size - 1)(Promise.apply[B]) | |
var i = 0 // used for iteration optimization (not needing to search for uncompleted promise from start every time) | |
in.foreach { a => | |
fn(a).onComplete { t => | |
var p = promises(i) |
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 akka.actor.{ActorSystem, Scheduler} | |
import com.astoncap.util.concurrent.Async._ | |
import scala.concurrent.{ExecutionContext, Future, Promise} | |
import scala.concurrent.duration.{Duration, FiniteDuration} | |
import scala.util.Try | |
trait Scheduling { | |
implicit val scheduling: Scheduling = this |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 com.sparkbeyond.engine.util.logging.eventslogger | |
import java.nio.charset.StandardCharsets | |
import akka.Done | |
import ch.qos.logback.core.rolling.{ | |
FixedWindowRollingPolicy, | |
RollingFileAppender, | |
SizeBasedTriggeringPolicy | |
} |
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 scratch.example; | |
import java.util.List; | |
public class Tree { | |
int value; | |
List<Tree> children; | |
public Tree(int value, List<Tree> children) { |
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
from typing import Optional | |
class Tree: | |
def __init__(self, value: int, children: list): | |
self.value = value | |
self.children = children # list of Tree | |
def format_tree(t: Tree) -> str: | |
pass |
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 akka.stream.{Attributes, FlowShape, Inlet, Outlet} | |
import akka.stream.stage.{GraphStage, GraphStageLogic, InHandler, OutHandler} | |
import com.typesafe.scalalogging.Logger | |
object StreamEventInspector { | |
def default[T](logger: Logger, context: String, printElem: T => String): StreamEventInspector[T] = { | |
val ctx = "[" + context + "] " | |
new StreamEventInspector[T]( | |
() => logger.info(ctx + "upstream completed"), | |
ex => logger.error(ctx + "upstream failure", ex), |