repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
ihji/dotty | tests/run/phantom-param-accessor.scala | <gh_stars>0
import Boo._
object Test {
def main(args: Array[String]): Unit = {
new Foo(a).aVal
}
}
class Foo(val aVal: A)
object Boo extends Phantom {
type A = this.Nothing
def a = assume
}
|
ihji/dotty | tests/neg/phantom-volitile.scala |
class Foo {
@volatile var foo1 = Boo.boo // error: var fields cannot have Phantom types
@volatile val foo2 = Boo.boo // error: Phantom fields cannot be @volatile
}
object Boo extends Phantom {
def boo = assume
}
|
ihji/dotty | tests/neg/enums.scala | package enums
enum List[+T] {
case Cons[T](x: T, xs: List[T]) // ok
case Snoc[U](xs: List[U], x: U) // error: different type parameters
}
enum class X {
case Y // error: case not allowed here
}
enum E1[T] {
case C // error: cannot determine type argument
}
enum E2[+T, +U >: T] {
case C // error: cannot de... |
ihji/dotty | bot/src/dotty/tools/bot/Main.scala | package dotty.tools.bot
import org.http4s.server.{ Server, ServerApp }
import org.http4s.server.blaze._
import scalaz.concurrent.Task
object Main extends ServerApp with PullRequestService {
val githubUser = sys.env("GITHUB_USER")
val githubToken = sys.env("GITHUB_TOKEN")
val githubClientId ... |
ihji/dotty | tests/neg/phantom-instanceOf-1.scala |
class phantomInstanceOf1 {
null.asInstanceOf[Boo.Any] // error
null.asInstanceOf[Boo.Nothing] // error
"".asInstanceOf[Boo.Any] // error
"".asInstanceOf[Boo.Nothing] // error
}
object Boo extends Phantom {
def boo[B <: Boo.Any]: B = assume
}
|
ihji/dotty | tests/neg/phantom-trait-3.scala | <filename>tests/neg/phantom-trait-3.scala
class Boo1 extends Phantom // error
trait Boo2 extends Phantom // error
object Boo3 extends Phantom
|
ihji/dotty | sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala | <gh_stars>0
package dotty.tools.sbtplugin
import sbt._
import sbt.Keys._
import java.io._
import java.lang.ProcessBuilder
import scala.collection.mutable
import scala.util.Properties.{ isWin, isMac }
import dotty.tools.languageserver.config.ProjectConfig
import com.fasterxml.jackson.databind.ObjectMapper
import scal... |
ihji/dotty | tests/run/phantom-methods-1.scala | /* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
fun(phantomFun1(... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/localopt/InlineLabelsCalledOnce.scala | package dotty.tools.dotc
package transform.localopt
import core.Contexts.Context
import core.Symbols._
import core.Flags._
import transform.SymUtils._
import scala.collection.mutable
import config.Printers.simplify
/** Inlines LabelDef which are used exactly once.
*
* @author DarkDimius, OlivierBlanvillain
*/
cla... |
ihji/dotty | bot/src/dotty/tools/bot/PullRequestService.scala | <filename>bot/src/dotty/tools/bot/PullRequestService.scala
package dotty.tools
package bot
import org.http4s.{ Status => _, _ }
import org.http4s.client.blaze._
import org.http4s.client.Client
import org.http4s.headers.{ Accept, Authorization }
import cats.syntax.applicative._
import scalaz.concurrent.Task
import sca... |
ihji/dotty | library/src/dotty/DottyPredef.scala | package dotty
import scala.reflect.ClassTag
import scala.Predef.???
object DottyPredef {
/** A class for implicit values that can serve as implicit conversions
* The implicit resolution algorithm will act as if there existed
* the additional implicit definition:
*
* def $implicitConversion[T, U](x... |
ihji/dotty | tests/run/phantom-methods-5.scala | <reponame>ihji/dotty<gh_stars>0
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]... |
ihji/dotty | tests/neg/phantom-fun-app.scala | <filename>tests/neg/phantom-fun-app.scala
class phantomFunApp {
import Boo._ // Note: this is dangerous as it imports Boo.Any as Any
def foo1(a: Any) = ???
def foo2(b: BooAny) = ???
foo1(1)
foo1(boo[Blinky]) // error
foo1(boo[Pinky]) // error
foo2(boo[Blinky])
foo2(boo[Pinky])
foo2(1) // error
f... |
ihji/dotty | tests/neg/phantom-AndOr.scala | <filename>tests/neg/phantom-AndOr.scala
class BooFunDef1 {
import Boo._
def fun1(b: BooAny | Any) = ??? // error
def fun2(b: BooAny | Any | Any) = ??? // error // error
def fun3(b: Any | BooAny | Any) = ??? // error
def fun4(b: BooAny | BooAny | Any) = ??? // error
def fun5(b: BooAny & Any) = ??? // erro... |
ihji/dotty | tests/neg/phantom-multiversal-type-param-bounds-2.scala | <gh_stars>0
class phantomTypeParamBounds2 {
import Universe1._
import UniverseA._
def fun1[X <: One & A] = ??? // error
def fun2[X <: One | A] = ??? // error
def fun3[X >: OneNothing & ANothing] = ??? // error
def fun4[X >: OneNothing | ANothing] = ??? // error
def fun5[X >: One & A <: One & A] = ??? /... |
ihji/dotty | tests/run/phantom-3.scala | /* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
fun3(boo[Blinky]... |
ihji/dotty | tests/neg/customArgs/phantom-overload.scala | <reponame>ihji/dotty
class phantomOverload {
import Boo._
import Boo2._
def foo1(): A = nothing
def foo1(): B = nothing // error
def foo1(): C = nothing2 // error
def foo1(): N = nothing // error
def foo2(x: A) = ???
def foo2(x: A) = ??? // error
def foo2(x: B) = ??? // error
def foo2(x: C) = ???... |
ihji/dotty | tests/run/phantom-poly-2.scala | <reponame>ihji/dotty<gh_stars>0
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/localopt/Varify.scala | <gh_stars>0
package dotty.tools.dotc
package transform.localopt
import core._
import core.Contexts.Context
import core.Symbols._
import core.Flags._
import scala.collection.mutable
/** Inline val with exactly one assignment to a var. For example:
*
* {
* val l = <expr>
* // code that may use l
* var r ... |
ihji/dotty | tests/neg/phantom-classOf-2.scala |
class phantomClassOf {
type Blinky <: Boo.BooAny
classOf[Blinky] // error
}
object Boo extends Phantom {
type BooAny = this.Any
}
|
ihji/dotty | compiler/src/dotty/tools/dotc/transform/FirstTransform.scala | package dotty.tools.dotc
package transform
import core._
import Names._
import dotty.tools.dotc.ast.tpd
import dotty.tools.dotc.core.Phases.NeedsCompanions
import dotty.tools.dotc.transform.TreeTransforms._
import ast.Trees._
import Flags._
import Types._
import Constants.Constant
import Contexts.Context
import Symbol... |
ihji/dotty | tests/pos/overloaded.scala | <gh_stars>0
object overloaded {
def f(x: String): String = x
def f[T >: Null](x: T): Int = 1
val x1 = f("abc")
val x2 = f(new Integer(1))
val x3 = f(null)
val x4: String => String = f
val x5: String => Any = f
val x6: Any = f _
def g(): Int = 1
def g(x: Int): Int = 2
val y1: Int => Int = g
... |
ihji/dotty | tests/idempotency/IdempotencyCheck.scala | <reponame>ihji/dotty
import java.nio.file.{ Files => JFiles, Path => JPath, Paths => JPaths }
import java.util.stream.{ Stream => JStream }
import scala.collection.JavaConverters._
object IdempotencyCheck {
val blacklisted = Set(
// No fix needed. Bridges on collections in different order. Second one in scala2... |
ihji/dotty | compiler/src/dotty/tools/dotc/reporting/StoreReporter.scala | <filename>compiler/src/dotty/tools/dotc/reporting/StoreReporter.scala
package dotty.tools
package dotc
package reporting
import core.Contexts.Context
import collection.mutable
import config.Printers.typr
import diagnostic.MessageContainer
import diagnostic.messages._
/** This class implements a Reporter that stores a... |
ihji/dotty | tests/neg/phantom-evidence.scala | <reponame>ihji/dotty
/* This is a example of how to implement =:= using erasable phantom types.
*
* Run this test with
* `run tests/neg/phantomEvidence-1.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasu... |
ihji/dotty | tests/neg/phantom-classOf-1.scala | <filename>tests/neg/phantom-classOf-1.scala
class phantomClassOf {
classOf[BooAny] // error
classOf[BooNothing] // error
}
object Boo extends Phantom {
type BooAny = this.Any
type BooNothing = this.Nothing
}
|
ihji/dotty | tests/neg/phantom-type-param-bounds-1.scala |
class phantomTypeParamBounds1 {
def fun5[X >: Boo.Nothing <: Any] = ??? // error
def fun6[X >: Nothing <: Boo.Any] = ??? // error
}
object Boo extends Phantom {
def boo[B <: this.Any]: B = assume
}
|
ihji/dotty | compiler/src/dotty/tools/dotc/transform/TypeTestsCasts.scala | <reponame>ihji/dotty
package dotty.tools.dotc
package transform
import core._
import Contexts._, Symbols._, Types._, Constants._, StdNames._, Decorators._
import ast.Trees._
import Erasure.Boxing._
import TypeErasure._
import ValueClasses._
import SymUtils._
import core.Flags._
import util.Positions._
/** This trans... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/Constructors.scala | package dotty.tools.dotc
package transform
import core._
import TreeTransforms._
import dotty.tools.dotc.ast.tpd._
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.core.StdNames._
import Phases._
import ast._
import Trees._
import Flags._
import SymUtils._
import Symbols._
import SymDenotations._
... |
ihji/dotty | compiler/src/dotty/tools/dotc/core/Periods.scala | package dotty.tools.dotc.core
import Contexts._
import dotty.tools.dotc.util.DotClass
/** Periods are the central "clock" of the compiler.
* A period consists of a run id and a phase id.
* run ids represent compiler runs
* phase ids represent compiler phases
*/
abstract class Periods extends DotClass { self: C... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/ExtensionMethods.scala | <gh_stars>0
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author <NAME>
*/
package dotty.tools.dotc
package transform
import dotty.tools.dotc.transform.TreeTransforms._
import ValueClasses._
import dotty.tools.dotc.ast.{Trees, tpd}
import scala.collection.{ mutable, immutable }
import mutable.List... |
ihji/dotty | tests/run/phantom-poly-3.scala | /* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
polyfun3(boo[Bli... |
ihji/dotty | compiler/test/dotty/tools/dotc/SimplifyTests.scala | package dotty.tools.dotc
import org.junit.Assert._
import org.junit.Test
import dotty.tools.backend.jvm._
import dotty.tools.dotc.config.CompilerCommand
import dotty.tools.dotc.core.Contexts.FreshContext
import scala.tools.asm.tree.MethodNode
class SimplifyPosTests extends SimplifyTests(optimise = true)
class Simplif... |
ihji/dotty | compiler/src/dotty/tools/dotc/repl/ConsoleWriter.scala | <gh_stars>0
package dotty.tools
package dotc
package repl
import java.io.Writer
/** A Writer that writes onto the Scala Console.
*
* @author <NAME>
* @version 1.0
*/
class ConsoleWriter extends Writer {
def close() = flush()
def flush() = Console.flush()
def write(cbuf: Array[Char], off: Int, len: Int):... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/ElimErasedValueType.scala | package dotty.tools.dotc
package transform
import ast.{Trees, tpd}
import core._, core.Decorators._
import TreeTransforms._, Phases.Phase
import Types._, Contexts._, Constants._, Names._, NameOps._, Flags._, DenotTransformers._
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._, Scopes._, Denotatio... |
ihji/dotty | tests/run/phantom-hk-2.scala | <reponame>ihji/dotty<gh_stars>0
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
type HKPhantom[X <: BooAny] ... |
ihji/dotty | compiler/src/dotty/tools/dotc/transform/CheckPhantomCast.scala | package dotty.tools.dotc
package transform
import core._
import dotty.tools.dotc.transform.TreeTransforms.{MiniPhaseTransform, TransformerInfo}
import Types._
import Contexts.Context
import Symbols._
import Decorators._
import dotty.tools.dotc.ast.Trees._
import dotty.tools.dotc.ast.tpd
/** A no-op transform to ensu... |
ihji/dotty | compiler/test/dotc/tests.scala | package dotc
import dotty.Jars
import dotty.tools.dotc.CompilerTest
import dotty.tools.StdLibSources
import org.junit.experimental.categories.Category
import org.junit.{Before, Test}
import org.junit.Assert._
import java.io.{ File => JFile }
import dotty.tools.io.Directory
import scala.io.Source
/** WARNING
* ====... |
ihji/dotty | sbt-bridge/src/xsbt/ConsoleInterface.scala | /* sbt -- Simple Build Tool
* Copyright 2008, 2009 <NAME>
*/
package xsbt
import xsbti.Logger
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.repl.REPL
import dotty.tools.dotc.repl.REPL.Config
class ConsoleInterface {
def commandArguments(
args: Array[String],
bootClasspathString: S... |
ihji/dotty | tests/run/mixins1/A_1.scala | <filename>tests/run/mixins1/A_1.scala
trait A {
var x = 3
println("hi")
val y = x * x
def f: Int = x + y
def f(z: Int): Int = f + z
}
|
ihji/dotty | tests/run/phantom-poly-1.scala | <filename>tests/run/phantom-poly-1.scala<gh_stars>0
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main... |
ihji/dotty | tests/neg/phantom-type-param-bounds-2.scala | <filename>tests/neg/phantom-type-param-bounds-2.scala
class phantomTypeParamBounds2 {
def fun1[X <: Boo.Any & Any] = ??? // error
def fun2[X <: Boo.Any | Any] = ??? // error
def fun3[X >: Boo.Nothing & Nothing] = ??? // error
def fun4[X >: Boo.Nothing | Nothing] = ??? // error
def fun5[X >: Boo.Any & Any <:... |
ihji/dotty | compiler/src/dotty/tools/backend/jvm/LabelDefs.scala | <reponame>ihji/dotty
package dotty.tools.backend.jvm
import dotty.tools.dotc.ast.Trees.Thicket
import dotty.tools.dotc.ast.{Trees, tpd}
import dotty.tools.dotc.core.Contexts.Context
import dotty.tools.dotc.core.Types
import dotty.tools.dotc.transform.TreeTransforms.{TransformerInfo, TreeTransform, MiniPhase, MiniPhase... |
ihji/dotty | tests/run/phantom-methods-10.scala | /* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomRefErasure,phantomErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {
fun2.pacFun4(inky)
... |
ihji/dotty | tests/neg/phantom-var.scala |
class Foo {
var foo = Boo.boo // error: var fields cannot have Phantom types
}
object Boo extends Phantom {
def boo = assume
}
|
ihji/dotty | tests/neg/i1650.scala | object Test {
test4(test4$default$1) // error
def test4[T[P]](x: T[T[List[T[X forSome { type X }]]]]) = ??? // error // error
def test4$default$1[T[P]]: T[Int] = ???
}
|
ihji/dotty | tests/run/phantom-hk-1.scala | <reponame>ihji/dotty
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._
def main(args: Array[String]): Unit = {... |
ihji/dotty | tests/run/phantom-methods-3.scala | <reponame>ihji/dotty<filename>tests/run/phantom-methods-3.scala
/* Run this test with
* `run tests/run/xyz.scala -Xprint-diff-del -Xprint:arrayConstructors,phantomTermErasure,phantomTypeErasure,erasure`
* to see the the diffs after PhantomRefErasure, PhantomDeclErasure and Erasure.
*/
object Test {
import Boo._... |
arajajyothibabu/game-of-life | src/main/scala/GameOfLife.scala | <reponame>arajajyothibabu/game-of-life<filename>src/main/scala/GameOfLife.scala
/**
* Created by jyothi on 18/11/17.
*/
case class Cell(x: Int, y: Int)
class GameOfLife(inputPanel: Array[Array[Int]] = Array()) {
val alive = 1
val dead = 0
private val defaultGamePanel = (0 until 5).map(x => (0 until 5).map... |
arajajyothibabu/game-of-life | src/main/scala/Main.scala | /**
* Created by jyothi on 18/11/17.
*/
/**
* 1. Any Live cell with neighbours fewer than 2 are dead
* 2. Any Live cell with more than 3 live neighbours dies of over population
* 3. Any dead cell with exactly 3 live neighbours comes to life of warmth
*/
object Main extends App {
val panel = (0 until 5)... |
arajajyothibabu/game-of-life | build.sbt | name := "GameOfLife"
version := "1.0"
scalaVersion := "2.12.1" |
rohitkumarjoshi/gitbucket | src/main/scala/gitbucket/core/service/CommitsService.scala | <gh_stars>0
package gitbucket.core.service
import gitbucket.core.model.CommitComment
import gitbucket.core.model.Profile._
import gitbucket.core.model.Profile.profile.blockingApi._
import gitbucket.core.model.Profile.dateColumnType
trait CommitsService {
def getCommitComments(owner: String, repository: String, com... |
rohitkumarjoshi/gitbucket | src/main/scala/gitbucket/core/controller/ReleasesController.scala | <filename>src/main/scala/gitbucket/core/controller/ReleasesController.scala<gh_stars>0
package gitbucket.core.controller
import java.io.File
import gitbucket.core.service.{AccountService, ActivityService, ReleaseService, RepositoryService}
import gitbucket.core.util.{FileUtil, ReadableUsersAuthenticator, ReferrerAuth... |
easel/elidable | build.sbt | <reponame>easel/elidable
scalaVersion := "2.11.8"
crossScalaVersions := Seq(scalaVersion.value)
//
//scalacOptions := Seq("-Xelide-below", "SEVERE") // does not work, 1000 > 2000, not below
//scalacOptions := Seq("-Xelide-below", "WARNING") // does not work, 2000 = 2000, not below
scalacOptions := Seq("-Xelide-below", ... |
easel/elidable | src/main/scala/Main.scala | <reponame>easel/elidable<filename>src/main/scala/Main.scala
object Main extends App {
println("starting")
assert(false, "assertions are enabled")
println("finished without errors")
}
|
littlenag/zparsers | src/main/scala/zio/stream/parsers/package.scala | package zio.stream
package object parsers {
type ~[+A, +B] = (A, B)
object ~ {
def unapply[A, B](in: (A, B)): Some[(A, B)] = Some(in)
}
} |
littlenag/zparsers | src/main/scala/zio/stream/parsers/KMap.scala | <filename>src/main/scala/zio/stream/parsers/KMap.scala<gh_stars>0
package zio.stream.parsers
private[parsers] class KMap[K[_] <: AnyRef, V[_] <: AnyRef] private (delegate: Map[AnyRef, AnyRef]) {
def apply[A](key: K[A]): V[A] = delegate(key).asInstanceOf[V[A]]
def get[A](key: K[A]): Option[V[A]] = delegate.get(k... |
littlenag/zparsers | src/test/scala/scalaz/stream/parsers/ParserSpecs.scala | <filename>src/test/scala/scalaz/stream/parsers/ParserSpecs.scala
/*
* Copyright 2015 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICEN... |
littlenag/zparsers | src/main/scala/zio/stream/parsers/Parsers.scala | package zio.stream.parsers
import cats._
import cats.data._
import cats.syntax.eq._
import cats.syntax.monad._
import cats.syntax.show._
import cats.syntax.either._
object Syntax {
type \/[A,B] = Either[A,B]
def -\/[A, B](a: A): Either[A, B] = Left(a)
def \/-[A, B](b: B): Either[A, B] = Right(b)
}
import... |
littlenag/zparsers | build.sbt | <reponame>littlenag/zparsers
/*
* Copyright 2015 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... |
littlenag/zparsers | src/main/scala/scalaz/stream/parsers/KMap.scala | <reponame>littlenag/zparsers<filename>src/main/scala/scalaz/stream/parsers/KMap.scala
/*
* Copyright 2015 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apac... |
littlenag/zparsers | src/main/scala/playground/AkkaStreamPlayground.scala | <filename>src/main/scala/playground/AkkaStreamPlayground.scala
package playground
import akka.stream.stage.{GraphStage, GraphStageLogic, InHandler, OutHandler}
import akka.stream.{Attributes, FlowShape, Inlet, Outlet}
class AkkaMap[A, B](f: A => B) extends GraphStage[FlowShape[A, B]] {
val in = Inlet[A]("Map.in")
... |
littlenag/zparsers | src/test/scala/zio/stream/parsers/ZioStreamSpecs.scala | /*
* Copyright 2015 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... |
littlenag/zparsers | src/main/scala/scalaz/stream/parsers/package.scala | <reponame>littlenag/zparsers
/*
* Copyright 2015 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... |
littlenag/zparsers | src/main/scala/playground/ParsersPlayground.scala | <reponame>littlenag/zparsers
package playground
object ParsersPlayground {
/**
*
* a matcher is already a driver program for the coroutine that a parser generates
* parsers generates coroutines that compose, that's the only magic
*
* when a matcher evaluates the parser on the next input, could probab... |
littlenag/zparsers | src/main/scala/playground/ZioStreamPlayground.scala | package playground
/**
* @author <NAME> (<EMAIL>)
*/
object ZioStreamPlayground {
import zio.stream._
val intStream: Stream[Nothing, Int] = Stream.fromIterable(0 to 100)
val stringStream: Stream[Nothing, String] = intStream.map(_.toString)
val s = ZSink.sum[Int]
val x = intStream.run(s)
//intStre... |
littlenag/zparsers | src/main/scala/playground/FastParsePlayground.scala | package playground
/**
* @author <NAME> (<EMAIL>)
*/
object FastParsePlayground {
import fastparse._
import NoWhitespace._
def binary(implicit ev: P[_]) = P( ("0" | "1" ).rep.! )
def binaryNum[_: P] = P( binary.map(Integer.parseInt(_, 2)) )
val Parsed.Success("1100", _) = parse("1100", x => binary(x))
... |
littlenag/zparsers | src/main/scala/zio/stream/parsers/StreamMatchers.scala | <filename>src/main/scala/zio/stream/parsers/StreamMatchers.scala
package zio.stream.parsers
import cats._
//import cats.data._
//import cats.syntax.show._
//import cats.syntax.either._
import zio._
import zio.stream._
import zio.stream.ZTransducer.Push
trait StreamMatchers { self: Parsers =>
sealed trait ParseResu... |
marcozov/extreme_startup_servers | scala/scalatra/src/main/scala/ExtremeStartup.scala | <gh_stars>10-100
import org.scalatra.ScalatraServlet
class ExtremeStartup extends ScalatraServlet {
get("/") {
"The server is running"
}
}
|
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/SparkShellHelpers.scala | import com.lucidworks.searchhub.analytics.AnalyzerUtils._
import com.lucidworks.searchhub.analytics._
import com.lucidworks.spark.util.SolrSupport
import org.apache.spark.ml.classification.RandomForestClassifier
import org.apache.spark.ml.param.IntParam
import org.apache.spark.mllib.linalg.{Vector => SparkVector}
impor... |
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/MailMessage.scala | <filename>searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/MailMessage.scala<gh_stars>10-100
package com.lucidworks.searchhub.analytics
import java.text.{SimpleDateFormat, DateFormat}
import scala.collection.JavaConverters._
import com.lucidworks.apollo.common.pipeline.PipelineDocument
imp... |
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/AnalyzerUtils.scala | package com.lucidworks.searchhub.analytics
import com.lucidworks.spark.analysis.LuceneTextAnalyzer
/**
* Example schema for various Lucene analyzer chains
*/
object AnalyzerUtils {
val whitespaceSchema =
"""{ "analyzers": [
| { "name": "ws",
| "tokenizer": { "type": "whitespace"} }],
|... |
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/ManyNewsgroups.scala | <reponame>liamstar97/searchhub
package com.lucidworks.searchhub.analytics
import org.apache.spark.ml.param.IntParam
import org.apache.spark.ml.{PipelineModel, Model, Pipeline}
import org.apache.spark.ml.classification.RandomForestClassifier
import org.apache.spark.ml.clustering.{LDAModel, LDA, KMeans}
import org.apach... |
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/recommender/SimpleTwoHopRecommender.scala | package com.lucidworks.searchhub.recommender
import org.apache.spark.sql.{SQLContext, Row, DataFrame}
import org.slf4j.LoggerFactory
case class UserId(id: String)
case class ItemId(id: String)
case class Pref(userId: UserId, itemId: ItemId, weight: Double)
case class ItemSim(itemId1: ItemId, itemId2: ItemId, weight:... |
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/SearchHubLoader.scala | <reponame>liamstar97/searchhub<gh_stars>10-100
package com.lucidworks.searchhub.analytics
import java.io.File
import org.apache.spark.SparkContext
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{DataFrame, SQLContext}
import scala.io.Source
import scala.util.Random
object SearchHubLoader {
val project... |
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/GraphUtils.scala | <filename>searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/GraphUtils.scala
package com.lucidworks.searchhub.analytics
import scala.collection.mutable
/**
* Created by jakemannix on 4/29/16.
*/
object GraphUtils {
/**
* Finds the adjacency list form of a graph, not caring about or... |
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/TfIdfVectorizer.scala | <filename>searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/TfIdfVectorizer.scala<gh_stars>10-100
package com.lucidworks.searchhub.analytics
import org.apache.spark.mllib.linalg.{Vectors, Vector => SparkVector}
import org.apache.spark.sql.DataFrame
import org.apache.spark.sql.functions._
/**
... |
liamstar97/searchhub | searchhub-fusion-plugins/src/main/scala/com/lucidworks/searchhub/analytics/MailThreadJob.scala | <reponame>liamstar97/searchhub<gh_stars>10-100
package com.lucidworks.searchhub.analytics
import org.apache.spark.{SparkContext, Accumulator}
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{Row, DataFrame}
import org.slf4j.LoggerFactory
// DEPRECATED: Scala for old mail threading job that did not work
ob... |
sathishsri88/practice | src/main/scala/lectures/part1as/DarkSugar.scala | package lectures.part1as
object DarkSugar extends App {
val anUnImplementedInstance: UnImplemented = (a: String) => a.toInt
abstract class UnImplemented {
def implemented(x: Int): Int = x * 3
def toImplement(in: String): Int
}
// ending with : are always right assosciative
}
|
sathishsri88/practice | src/main/scala/lectures/part1as/Recap.scala | <filename>src/main/scala/lectures/part1as/Recap.scala
package lectures.part1as
import scala.annotation.tailrec
object Recap extends App {
val aCondition: Boolean = false
val aCodeBlock = {
if (aCondition) {
42
}
65
}
val theUnit: Unit = println("Hello Scala !!!")
def recInt(x: Int): In... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/model/graphentities/Entity.scala | <gh_stars>0
package com.raphtory.core.model.graphentities
import scala.collection.mutable
import scala.collection.parallel.mutable.ParTrieMap
/** *
* Represents Graph Entities (Edges and Vertices)
* Contains a Map of properties (currently String to string)
* longs representing unique vertex ID's stored in subcl... |
dorely103/Raphtory | mainproject/project/plugins.sbt | <reponame>dorely103/Raphtory<filename>mainproject/project/plugins.sbt
// "2.3.2" is just sbt plugin version
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.1")
addSbtPlugin("com.lightbend.sbt" % "sbt-javaagent" % "0.1.5")
addS... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/PartitionManager/Writer.scala | package com.raphtory.core.actors.PartitionManager
import akka.actor.SupervisorStrategy.Resume
import akka.actor.{Actor, ActorLogging, ActorRef, Cancellable, OneForOneStrategy, Terminated}
import akka.cluster.pubsub.{DistributedPubSub, DistributedPubSubMediator}
import com.raphtory.core.actors.RaphtoryActor
import com.... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/RaphtoryGraph.scala | package com.raphtory
import akka.actor.{ActorSystem, Props}
import ch.qos.logback.classic.Level
import com.raphtory.api.Analyser
import com.raphtory.core.actors.AnalysisManager.{AnalysisManager, AnalysisRestApi}
import com.raphtory.core.actors.ClusterManagement.{RaphtoryReplicator, WatchDog, WatermarkManager}
import c... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/model/EntityStorage.scala | <reponame>dorely103/Raphtory<filename>mainproject/src/main/scala/com/raphtory/core/model/EntityStorage.scala
package com.raphtory.core.model
import akka.actor.ActorRef
import akka.cluster.pubsub.DistributedPubSubMediator
import com.raphtory.core.model.communication._
import com.raphtory.core.model.graphentities.{Edge,... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/RaphtoryActor.scala | package com.raphtory.core.actors
import akka.actor.{Actor, ActorContext, ActorLogging, ActorRef, Cancellable, Timers}
import scala.collection.mutable
import scala.concurrent.ExecutionContext
import scala.concurrent.duration.FiniteDuration
trait RaphtoryActor extends Actor with ActorLogging with Timers {
val parti... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/AnalysisManager/Tasks/LiveTasks/BWindowedLiveAnalysisTask.scala | package com.raphtory.analysis.Tasks.LiveTasks
import com.raphtory.api.Analyser
import com.raphtory.core.model.communication.AnalysisType
import scala.collection.mutable.ArrayBuffer
class BWindowedLiveAnalysisTask(managerCount:Int, jobID: String,args:Array[String], analyser: Analyser,repeatTime:Long,eventTime:Boolean... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/model/analysis/entityVisitors/EdgeVisitor.scala | package com.raphtory.core.model.analysis.entityVisitors
import akka.actor.{ActorContext, ActorRef}
import akka.cluster.pubsub.DistributedPubSubMediator
import com.raphtory.api.ManagerCount
import com.raphtory.core.actors.PartitionManager.Workers.ViewJob
import com.raphtory.core.model.analysis.GraphLenses.GraphLens
imp... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/Router/GraphBuilder.scala | <reponame>dorely103/Raphtory
package com.raphtory.core.actors.Router
import com.raphtory.core.model.communication.GraphUpdate
import scala.collection.mutable
import scala.util.hashing.MurmurHash3
trait GraphBuilder[T]{
var updates:mutable.HashSet[GraphUpdate] = mutable.HashSet[GraphUpdate]()
def getUpdates() =... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/AnalysisManager/Tasks/LiveTasks/LiveAnalysisTask.scala | <reponame>dorely103/Raphtory
package com.raphtory.analysis.Tasks.LiveTasks
import akka.cluster.pubsub.DistributedPubSubMediator
import com.raphtory.api.Analyser
import com.raphtory.analysis.Tasks.AnalysisTask
import com.raphtory.core.model.communication.{AnalysisType, Finish, Setup, TimeCheck}
import scala.collection... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/api/Serialiser.scala | <filename>mainproject/src/main/scala/com/raphtory/api/Serialiser.scala
package com.raphtory.api
import java.io.{BufferedWriter, File, FileWriter}
import com.raphtory.core.model.analysis.entityVisitors.{EdgeVisitor, VertexVisitor}
import scala.collection.mutable.ArrayBuffer
abstract class Serialiser extends Analyser... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/model/communication/raphtoryMessages.scala | <filename>mainproject/src/main/scala/com/raphtory/core/model/communication/raphtoryMessages.scala
package com.raphtory.core.model.communication
import com.raphtory.api.Analyser
import com.raphtory.core.actors.PartitionManager.Workers.ViewJob
import com.raphtory.core.model.graphentities.Edge
import scala.collection.mu... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/serialisers/JSONSerialiser.scala | package com.raphtory.serialisers
import com.raphtory.api.Serialiser
import com.raphtory.core.model.analysis.entityVisitors.{EdgeVisitor, VertexVisitor}
import scala.collection.parallel.mutable.ParTrieMap
class JSONSerialiser extends Serialiser {
override def startOfFile(): String = "{\"directed\": true, \"multigr... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/model/graphentities/Edge.scala | package com.raphtory.core.model.graphentities
import com.raphtory.core.model.EntityStorage
import scala.collection.mutable
import scala.collection.parallel.mutable.ParTrieMap
/**
* Companion Edge object (extended creator for storage loads)
*/
object Edge {
def apply(
workerID: Int,
creationTime: Lo... |
dorely103/Raphtory | mainproject/src/tests/scala/lotr/LOTRDeployment.scala | <reponame>dorely103/Raphtory
package lotr
import com.raphtory.RaphtoryGraph
import com.raphtory.algorithms.{ConnectedComponents, DegreeBasic}
object LOTRDeployment extends App{
val source = new LOTRSpout()
val builder = new LOTRGraphBuilder()
val rg = RaphtoryGraph[String](source,builder)
val arguments = Arra... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/PartitionManager/Reader.scala | <reponame>dorely103/Raphtory
package com.raphtory.core.actors.PartitionManager
import akka.actor.{Actor, ActorLogging, ActorRef, Props, Terminated}
import akka.cluster.pubsub.{DistributedPubSub, DistributedPubSubMediator}
import akka.cluster.pubsub.DistributedPubSubMediator.SubscribeAck
import com.raphtory.core.actors... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/AnalysisManager/Tasks/ViewTasks/WindowedViewAnalysisTask.scala | package com.raphtory.analysis.Tasks.ViewTasks
import com.raphtory.api.Analyser
import com.raphtory.core.model.communication.AnalysisType
class WindowedViewAnalysisTask(managerCount:Int, jobID: String,args:Array[String], analyser: Analyser, time: Long, window: Long,newAnalyser:Boolean,rawFile:String)
extends V... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/AnalysisManager/Tasks/ViewTasks/BWindowedViewAnalysisTask.scala | <reponame>dorely103/Raphtory<filename>mainproject/src/main/scala/com/raphtory/core/actors/AnalysisManager/Tasks/ViewTasks/BWindowedViewAnalysisTask.scala
package com.raphtory.analysis.Tasks.ViewTasks
import com.raphtory.api.Analyser
import com.raphtory.core.model.communication.AnalysisType
import scala.collection.mut... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/AnalysisManager/Tasks/ViewTasks/ViewAnalysisTask.scala | <reponame>dorely103/Raphtory
package com.raphtory.analysis.Tasks.ViewTasks
import com.raphtory.api.Analyser
import com.raphtory.analysis.Tasks.AnalysisTask
import com.raphtory.core.model.communication.AnalysisType
class ViewAnalysisTask(managerCount:Int, jobID: String,args:Array[String], analyser: Analyser, time: Lon... |
dorely103/Raphtory | mainproject/src/main/scala/com/raphtory/core/actors/AnalysisManager/AnalysisManager.scala | <filename>mainproject/src/main/scala/com/raphtory/core/actors/AnalysisManager/AnalysisManager.scala
package com.raphtory.core.actors.AnalysisManager
import akka.actor.{Actor, ActorRef, InvalidActorNameException, PoisonPill, Props}
import akka.cluster.pubsub.{DistributedPubSub, DistributedPubSubMediator}
import akka.pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.