code
stringlengths
5
1M
repo_name
stringlengths
5
109
path
stringlengths
6
208
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
5
1M
// java: -Dneeds.forked.jvm.for.windows import java.io.File import scala.tools.partest.ReplTest import scala.util.Properties.propOrElse /** * filter out absolute path to java * filter: java */ object Test extends ReplTest { def java = propOrElse("javacmd", "java") def code = s""":sh $java -classpath $testOutput h...
scala/scala
test/files/run/t7634.scala
Scala
apache-2.0
520
package lila.monitor import java.lang.management.ManagementFactory import scala.concurrent.duration._ import scala.util.{ Success, Failure } import akka.actor._ import akka.pattern.{ ask, pipe } import play.api.libs.concurrent._ import actorApi._ import lila.hub.actorApi.monitor._ import lila.hub.actorApi.round.Move...
danilovsergey/i-bur
modules/monitor/src/main/Reporting.scala
Scala
mit
3,038
/////////////////////////////////////////////////////////////////////////////// // DistDocument.scala // // Copyright (C) 2010, 2011, 2012 Ben Wing, The University of Texas at Austin // Copyright (C) 2011, 2012 Stephen Roller, The University of Texas at Austin // // Licensed under the Apache License, Version 2.0 (t...
utcompling/fieldspring
src/main/scala/opennlp/fieldspring/gridlocate/DistDocument.scala
Scala
apache-2.0
38,760
package scala.tools.partest import scala.tools.nsc.Settings import scala.tools.nsc.reporters.StoreReporter import scala.collection.mutable trait StoreReporterDirectTest extends DirectTest { lazy val storeReporter: StoreReporter = new scala.tools.nsc.reporters.StoreReporter() /** Discards all but the first messag...
adriaanm/scala-partest
src/main/scala/scala/tools/partest/StoreReporterDirectTest.scala
Scala
bsd-3-clause
605
package task.airport package util import akka.http.scaladsl.marshalling.Marshaller.StringMarshaller import akka.http.scaladsl.marshalling.ToEntityMarshaller import akka.http.scaladsl.model.MediaTypes.`text/html` import scalatags.Text.Tag // See: https://github.com/cretz/scala-web-ideal/blob/master/server/src/main/sc...
rarrabi/task-airport
jvm/src/main/scala/task/airport/util/ScalaTagsSupport.scala
Scala
mit
653
package kartograffel.client.component import japgolly.scalajs.react._ import japgolly.scalajs.react.component.Scala.Unmounted import japgolly.scalajs.react.vdom.html_<^._ import kartograffel.client.geolocation.GeoLocation import kartograffel.client.rest.API import kartograffel.shared.domain.model.Position import karto...
fthomas/kartograffel
modules/client/js/src/main/scala/kartograffel/client/component/TagComponent.scala
Scala
apache-2.0
2,511
/* * Copyright 2021 HM Revenue & Customs * * 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 a...
hmrc/ct-calculations
src/test/scala/uk/gov/hmrc/ct/computations/CP296Spec.scala
Scala
apache-2.0
2,369
package com.malpeza.solid.isp.model class WithdrawalResponse(val done: Boolean, val reason: Option[FailReason]) { def this() { this(false, Option(CallBank)) } } object WithdrawalResponse { def apply() = new WithdrawalResponse() def apply(done: Boolean) = new WithdrawalResponse(done, None) def apply(fail...
lsolano/blog.solid.demo
scala/src/main/scala/com/malpeza/solid/isp/model/WithdrawalResponse.scala
Scala
mit
510
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
gioenn/xSpark
mllib/src/test/scala/org/apache/spark/mllib/evaluation/RankingMetricsSuite.scala
Scala
apache-2.0
2,659
object Test { def test(foo: List[String]): Unit = { foo.filter(f => { iDontExist // error true }) } }
som-snytt/dotty
tests/neg/i2412.scala
Scala
apache-2.0
126
package odfi.h2dl.indesign.session import com.idyria.osi.ooxoo.core.buffers.structural.xelement @xelement(name="Session") class Session extends SessionTrait { def getValueOrCreate(name : String) = { this.values.find { v => v.name.toString == name} match { case Some(v) => v case None =>...
richnou/h2dl-indesign
src/main/scala/odfi/h2dl/indesign/session/Session.scala
Scala
gpl-2.0
400
package org.eobjects.analyzer.beans.valuematch import org.scalatest.junit.AssertionsForJUnit import org.junit.Test import org.eobjects.analyzer.storage.InMemoryRowAnnotationFactory import org.eobjects.analyzer.data.MockInputColumn import scala.collection.JavaConversions._ import org.eobjects.analyzer.data.MockInputRow ...
datacleaner/AnalyzerBeans
components/value-distribution/src/test/scala/org/eobjects/analyzer/beans/valuematch/ValueMatchAnalyzerTest.scala
Scala
lgpl-3.0
2,153
// run with scala -cp mysql-connector-java-5.1.36-bin.jar:. example5.scala import java.sql.{Connection, DriverManager, ResultSet}; /** * Gets user ids from user field in mysql */ object Example5 { val conn_str = "jdbc:mysql://localhost:8889/foobar?user=root&password=root" def readDBWithJDBC() { val conn = ...
frankcash/Misc
Scala/example5.scala
Scala
mit
820
/* * 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 writing, software * distributed under the...
gnieh/tekstlib
src/main/scala/gnieh/string/GapBuffer.scala
Scala
apache-2.0
3,815
/* * Copyright 2015 Textocat * * 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 la...
Denis220795/Textokit
Textokit.PhraseRecognizer/src/main/scala/com/textocat/textokit/phrrecog/input/AnnotationReader.scala
Scala
apache-2.0
2,650
/** * Copyright 2015 Daniel Götten * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicab...
dangoe/maci-beanmodel
maci-beanmodel-gen/src/main/scala/de/maci/beanmodel/generator/util/Closeables.scala
Scala
apache-2.0
914
/* * scala-bcp-rpc * Copyright 2014 深圳岂凡网络有限公司 (Shenzhen QiFun Network Corp., LTD) * * 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...
ThoughtWorksInc/scala-bcp-rpc
src/main/scala/com/qifun/bcp/rpc/TextSession.scala
Scala
apache-2.0
10,574
package com.thangiee.lolhangouts.ui.sidedrawer import java.util.concurrent.TimeUnit.SECONDS import com.thangiee.lolhangouts.data.usecases._ import com.thangiee.lolhangouts.ui.core.Presenter import com.thangiee.lolhangouts.ui.sidedrawer.DrawerItem._ import com.thangiee.lolhangouts.ui.sidedrawer.SideDrawerView._ import...
Thangiee/LoL-Hangouts
src/com/thangiee/lolhangouts/ui/sidedrawer/SideDrawerPresenter.scala
Scala
apache-2.0
3,157
/*********************************************************************** * Copyright (c) 2013-2017 Commonwealth Computer Research, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Apache License, Version 2.0 * which accompanies this distribution and...
ronq/geomesa
geomesa-web/geomesa-web-core/src/main/scala/org/locationtech/geomesa/web/core/GeoMesaServletCatalog.scala
Scala
apache-2.0
1,354
package pamflet case class Frontin(header: Option[String], body: String) object Frontin { val separator = "---" def separates(str: String): Boolean = (str.trim == separator) && (str startsWith separator) def apply(str: String): Frontin = str.linesWithSeparators.toList match { case Nil => Front...
xuwei-k/pamflet
library/src/main/scala/frontin.scala
Scala
lgpl-3.0
575
package edu.cmu.lti.oaqa.cse.space.scala.test.worksheets import net.liftweb.json.JsonAST._ import net.liftweb.json.Extraction._ import net.liftweb.json.Printer._ import scala.collection.JavaConversions._ import scala.collection.JavaConverters._ import net.liftweb.json.parse import net.liftweb.json.DefaultFormats import...
oaqa/bagpipes-old
.worksheet/src/edu.cmu.lti.oaqa.cse.space.scala.test.worksheets.confTree.scala
Scala
apache-2.0
1,855
package com.github.ghik.silencer import scala.collection.mutable.ArrayBuffer import scala.reflect.internal.util.{Position, SourceFile} import scala.reflect.io.AbstractFile import scala.tools.nsc.reporters.{FilteringReporter, ForwardingReporter} import scala.util.matching.Regex class SuppressingReporter( original: F...
ghik/silencer
silencer-plugin/src/main/scala-2.12-13/com/github/ghik/silencer/SuppressingReporter.scala
Scala
apache-2.0
2,232
package mesosphere.marathon package core.deployment.impl import mesosphere.UnitTest import mesosphere.marathon.state._ class RestartStrategyTest extends UnitTest { val container = Some(Container.MesosDocker(volumes = Seq(VolumeWithMount( volume = PersistentVolume(name = None, PersistentVolumeInfo(123)), mo...
guenter/marathon
src/test/scala/mesosphere/marathon/core/deployment/impl/RestartStrategyTest.scala
Scala
apache-2.0
7,994
package io.buoyant.consul.v1 import com.twitter.conversions.time._ import com.twitter.finagle.http import com.twitter.finagle.service.Backoff import com.twitter.finagle.stats.{DefaultStatsReceiver, StatsReceiver} import com.twitter.util.{Closable, Duration, Future} trait ConsulApi extends BaseApi { def serviceMap( ...
hhtpcd/linkerd
consul/src/main/scala/io/buoyant/consul/v1/ConsulApi.scala
Scala
apache-2.0
4,684
package lila.analyse import chess.Color import chess.format.UciMove case class Info( ply: Int, score: Option[Score] = None, mate: Option[Int] = None, // variation is first in UCI, then converted to PGN before storage variation: List[String] = Nil, // best is always in UCI (used for hilight) ...
terokinnunen/lila
modules/analyse/src/main/Info.scala
Scala
mit
2,574
package ghpages.examples import ghpages.GhPagesMacros import ghpages.examples.util.SingleSide import japgolly.scalajs.react._ import japgolly.scalajs.react.vdom.html_<^._ object TriStateCheckboxExample { def content = SingleSide.Content(source, main()) lazy val main = addIntro(App.withKey(_)(sampleData), _( ...
japgolly/scalajs-react
ghpages/src/main/scala/ghpages/examples/TriStateCheckboxExample.scala
Scala
apache-2.0
2,782
package li.cil.cc.camera import java.security.MessageDigest import java.security.NoSuchAlgorithmException import java.util.logging.Logger import cpw.mods.fml.common.FMLLog import cpw.mods.fml.common.Mod import cpw.mods.fml.common.Mod.Init import cpw.mods.fml.common.Mod.PostInit import cpw.mods.fml.common.Mod.PreInit ...
fnuecke/cccamera
li/cil/cc/camera/Camera.scala
Scala
mit
7,053
/* * Copyright 2008-2010 WorldWide Conferencing, LLC * * 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 applica...
lift/lift
examples/example/src/main/scala/net/liftweb/example/lib/WikiStuff.scala
Scala
apache-2.0
4,973
package sample.stream.experiments import rx.lang.scala.Observable object ObservableExample { def main(args: Array[String]) { // def print(n: Int) { // println(n) // } // // def printThrowable(t: Throwable) { // println(t) // } //why is this a partially applied...
pallavig/akka-examples
src/main/scala/sample/stream/experiments/ObservableExample.scala
Scala
cc0-1.0
1,427
/* Copyright 2016 ScalABM 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 writing, software distribu...
EconomicSL/agora
src/main/scala/org/economicsl/agora/markets/tradables/orders/bid/DemandFunction.scala
Scala
apache-2.0
927
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
DieBauer/flink
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/TableSinkITCase.scala
Scala
apache-2.0
2,274
package com.karasiq.torrentstream import akka.actor.ActorRef import akka.stream.scaladsl.Source import akka.util.ByteString import com.karasiq.bittorrent.format.Torrent import com.karasiq.bittorrent.streams.TorrentSource case class TorrentStream(size: Long, source: Source[ByteString, akka.NotUsed]) object TorrentSt...
Karasiq/torrentstream
library/src/main/scala/com/karasiq/torrentstream/TorrentStream.scala
Scala
apache-2.0
1,066
package cgta.serland import cgta.serland.SerlandExportsShared.{SerlandStringExtensions, SerlandTypeAExtensions} import cgta.serland.backends.{SerJsonOut, SerJsonIn} ////////////////////////////////////////////////////////////// // Created by bjackman @ 3/1/14 3:54 AM /////////////////////////////////////////////////...
cgta/open
serland/shared/src/main/scala/cgta/serland/SerlandExports.scala
Scala
mit
1,404
package taczombie.test.model import org.specs2.mutable.Specification import taczombie.model.GameFactory import taczombie.model.MoveDown class LoggerSpec extends Specification { "Creating a new Game which extends Logger" should { "without initialisation yield an empty logger" in { val game = GameFa...
mahieke/TacZombie
model/src/test/scala/taczombie/test/model/LoggerSpec.scala
Scala
gpl-2.0
797
package functionsAPI import scala.concurrent.duration._ import io.gatling.core.Predef._ import io.gatling.http.Predef._ import io.gatling.jdbc.Predef._ import scala.util.parsing.json._ class GetFunctions1 extends Simulation { val httpProtocol = http .baseURL("http://sp.int3.sonata-nfv.eu:32001") .inferHtml...
sonata-nfv/son-qual
qual-stress-gtkapi/src/test/scala/2_functions_API/Recorder1.scala
Scala
apache-2.0
1,729
package gridscale import java.io.ByteArrayInputStream import java.net.SocketTimeoutException import java.nio.charset.StandardCharsets import java.security.KeyStore.{ PasswordProtection, PrivateKeyEntry } import java.security.PrivateKey import java.security.cert.{ Certificate, CertificateFactory } import gridscale.eff...
openmole/gridscale
http/src/main/scala/gridscale/http/package.scala
Scala
agpl-3.0
20,316
/* * Copyright 2014 Databricks * * 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 i...
gasparms/spark-csv
src/main/scala/com/databricks/spark/csv/util/TypeCast.scala
Scala
apache-2.0
3,471
package controllers.backend trait Backend { }
overview/overview-server
web/app/controllers/backend/Backend.scala
Scala
agpl-3.0
47
/******************************************************************************* Copyright (c) 2012-2013, KAIST, S-Core. All rights reserved. Use is subject to license terms. This distribution may include materials developed by third parties. **********************************************************...
daejunpark/jsaf
src/kr/ac/kaist/jsaf/analysis/typing/models/DOMHtml/HTMLScriptElement.scala
Scala
bsd-3-clause
5,046
import sbt._, Keys._ object TestP extends AutoPlugin { override def projectSettings: Seq[Setting[_]] = Seq( resourceGenerators in Compile += Def.task { streams.value.log info "resource generated in plugin" Nil } ) }
Duhemm/sbt
sbt/src/sbt-test/project/auto-plugins-default-requires-jvmplugin/project/TestP.scala
Scala
bsd-3-clause
241
package todomvc.example import scala.scalajs.js.JSApp import scala.scalajs.js.annotation.JSExportTopLevel import com.greencatsoft.angularjs.core.HttpProvider import com.greencatsoft.angularjs.{ Angular, Config } @JSExportTopLevel("TodoApp") object TodoApp extends JSApp { override def main() { Angular.module("...
greencatsoft/scalajs-angular-todomvc
js/src/main/scala/todomvc/example/TodoApp.scala
Scala
apache-2.0
694
package scala99 import scala.annotation.tailrec object Questions11To20 { /** * Problem 11 * * Modified run-length encoding. * * Modify the result of problem P10 in such a way that if an element has no * duplicates it is simply copied into the result list. Only elements with * duplicates are tra...
gergelyfabian/scala-99
src/main/scala/scala99/Questions11To20.scala
Scala
mit
8,323
package com.twitter.finagle.http2 import com.twitter.finagle.Stack import com.twitter.finagle.http2.param._ import io.netty.handler.codec.http2.Http2Settings private[http2] object Settings { private[http2] def fromParams(params: Stack.Params): Http2Settings = { val HeaderTableSize(headerTableSize) = params[Head...
spockz/finagle
finagle-http2/src/main/scala/com/twitter/finagle/http2/Settings.scala
Scala
apache-2.0
1,154
package com.gilt.opm.lock import org.scalatest.FunSuite import org.scalatest.Matchers import java.util.concurrent.{CountDownLatch, Executors} import java.util.concurrent.atomic.AtomicInteger import com.gilt.opm.CollectionHelper /** * Tests the lock contract. * * @author Eric Bowman * @since 1/8/13 7:44 AM */ cla...
gilt/opm
src/test/scala/com/gilt/opm/lock/LockManagerTest.scala
Scala
mit
2,615
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
maropu/spark
core/src/main/scala/org/apache/spark/SSLOptions.scala
Scala
apache-2.0
10,000
package org.jetbrains.plugins.scala package lang package scaladoc package parser package parsing import com.intellij.lang.PsiBuilder import com.intellij.psi.tree.IElementType import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilderImpl...
loskutov/intellij-scala
src/org/jetbrains/plugins/scala/lang/scaladoc/parser/parsing/MyScaladocParsing.scala
Scala
apache-2.0
10,985
object UnapplySeqTest { def unapplySeq(any: Any): Option[(Int, Seq[Int])] = Some((5, List(1))) } object Test extends dotty.runtime.LegacyApp { null match { case UnapplySeqTest(5) => println("uh-oh") case UnapplySeqTest(5, 1) => println("Matched!") // compiles case UnapplySeqTest(5, xs : _*) => println(...
yusuke2255/dotty
tests/pending/run/t7039.scala
Scala
bsd-3-clause
358
package com.twitter.finatra.benchmarks import com.twitter.finagle.http.{Request, Response} import com.twitter.finatra.http.internal.routing.{Route, RoutingService} import com.twitter.inject.requestscope.{FinagleRequestScope, FinagleRequestScopeFilter} import com.twitter.util.Future import org.jboss.netty.handler.codec...
tom-chan/finatra
benchmarks/src/main/scala/com/twitter/finatra/benchmarks/FinagleRequestScopeBenchmark.scala
Scala
apache-2.0
1,205
package com.mproject.mnote.servlet import com.mproject.mnote.auth.AuthenticationSupport import org.scalatra.ScalatraServlet import org.json4s.{DefaultFormats, Formats} import org.scalatra.json.JacksonJsonSupport import com.mproject.mnote.db.{Repository, DB} import java.util.UUID import com.mproject.mnote.model.NoteMod...
ma-tu/scalatra-angular1-memo-app
src/main/scala/com/mproject/mnote/servlet/ApiServlet.scala
Scala
mit
1,268
package loaders import breeze.linalg.DenseVector import org.apache.spark.SparkContext import org.apache.spark.rdd.RDD import scala.collection.mutable /** A case class containing loaded pre-featurized TIMIT train & test data */ case class TimitFeaturesData( train: LabeledData[Int, DenseVector[Double]], test: Labe...
etrain/keystone
src/main/scala/loaders/TimitFeaturesDataLoader.scala
Scala
apache-2.0
2,406
/* * Copyright 2017 Beikern * * 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 w...
beikern/functional-programming-scala
functional-data-structures/src/main/scala/es/beikern/functional/programming/datastructures/List.scala
Scala
apache-2.0
7,734
/* Copyright 2014 Twitter, Inc. 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 writing, software distr...
tglstory/scalding
scalding-core/src/main/scala/com/twitter/scalding/typed/CoGrouped.scala
Scala
apache-2.0
14,579
package controllers.api import play.api.i18n.Messages import play.api.mvc.Result import scala.concurrent.Future import controllers.auth.ApiAuthorizedRequest import controllers.util.NullMessagesApi import controllers.SelectionHelpers import models.Selection trait ApiSelectionHelpers extends SelectionHelpers { self: A...
overview/overview-server
web/app/controllers/api/ApiSelectionHelpers.scala
Scala
agpl-3.0
611
package controllers import play.api._ import play.api.mvc._ import play.api.data._ import play.api.data.Forms._ import play.api.i18n.{Messages} import play.api.libs.json._ import anorm._ import models._ import views._ import utils.DoubleFormat._ import utils.CSV._ import utils.Email._ import java.util.{Date} ...
cpeck1/tempmonServer
app/controllers/Containers.scala
Scala
bsd-2-clause
9,989
package com.github.nearbydelta.deepspark.word.layer import breeze.linalg.DenseVector import com.esotericsoftware.kryo.Kryo import com.esotericsoftware.kryo.io.{Input, Output} import com.github.nearbydelta.deepspark.data._ import com.github.nearbydelta.deepspark.layer.InputLayer import com.github.nearbydelta.deepspark....
nearbydelta/deepspark
src/main/scala/com/github/nearbydelta/deepspark/word/layer/Ledger.scala
Scala
gpl-2.0
2,462
class X class A { def foo[T1, T2 >: T1]: Unit = {} def test = { foo[X, X] } }
lampepfl/dotty
tests/pos/i523.scala
Scala
apache-2.0
89
/* * Copyright 2016 Miroslav Janíček * * 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 agree...
mjanicek/rembulan
rembulan-tests/src/test/scala/net/sandius/rembulan/test/BenchmarkRunner.scala
Scala
apache-2.0
8,765
package org.startupDirectory.common import play.api._ import play.api.mvc._ import org.startupDirectory.data.User trait SessionManaged { val userId = "user.id" val userEmail = "user.email" val userLoginSecret = "user.loginSecret" def addSession[A](result: Result, user: User)(implicit request: Request[A]): R...
mresposito/italianStartupDirectory
app/org/startupDirectory/common/SessionManager.scala
Scala
apache-2.0
1,151
package fpinscala.laziness trait Stream[+A] { import Stream._ def toListRec: List[A] = this match { case Cons(h, t) => h() :: t().toListRec case _ => Nil } def toList: List[A] = { def loop(s: Stream[A], a: List[A]): List[A] = s match { case Empty => a case Cons(h, t) =>...
nmcb/fpinscala
exercises/src/main/scala/fpinscala/laziness/Stream.scala
Scala
mit
6,636
package mesosphere.marathon import java.util.concurrent.CountDownLatch import java.util.{ Timer, TimerTask } import javax.inject.{ Inject, Named } import akka.Done import akka.actor.{ ActorRef, ActorSystem } import akka.stream.Materializer import akka.util.Timeout import com.google.common.util.concurrent.AbstractExec...
Caerostris/marathon
src/main/scala/mesosphere/marathon/MarathonSchedulerService.scala
Scala
apache-2.0
11,247
package io.prediction.workflow import _root_.java.lang.Thread import org.scalatest.FunSuite import org.scalatest.Inside import org.scalatest.Matchers._ import org.scalatest.Inspectors._ import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import org.apache.spark.SparkConf import org.apache.spa...
nvoron23/PredictionIO
core/src/test/scala/workflow/EvaluationWorkflowTest.scala
Scala
apache-2.0
2,037
/* * Copyright 2013 Marconi Lanna * * 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...
notbrain/play-bootstrap
app/util/Resource.scala
Scala
apache-2.0
1,525
package xkcd1083 import grizzled.slf4j.Logging import akka.actor.{Actor, ActorRef, Props, FSM} import scala.concurrent.Future import scala.concurrent.duration._ import scala.concurrent.ExecutionContext.Implicits.global import dispatch.StatusCode import scala.collection.immutable.Queue /** An Actor system that tra...
ohbadiah/xkcd1083
src/main/scala/actors.scala
Scala
lgpl-3.0
12,554
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package swave.core.impl.stages import scala.collection.mutable.ListBuffer import scala.util.Failure import or...
sirthias/swave
core-tests/src/test/scala/swave/core/impl/stages/GroupBySpec.scala
Scala
mpl-2.0
2,991
import java.io._ import scala.collection.mutable object E { val fromChar = mutable.HashMap( 'A' -> ".-", 'H' -> "....", 'O' -> "---", 'V' -> "...-", 'B' -> "-...", 'I' -> "..", 'P' -> ".--.", 'W' -> ".--", 'C' -> "-.-.", 'J' -> ".---", 'Q' -> "--.-", 'X' -> "-..-", ...
shengmin/coding-problem
acm/false-sense-of-security/E.scala
Scala
mit
1,636
package com.eharmony.aloha.factory import com.eharmony.aloha.models.Submodel import com.eharmony.aloha.reflect.RefInfo import spray.json.{JsValue, JsonFormat} import scala.util.Try /** * Created by ryan on 1/31/17. */ trait SubmodelFactory[U, A] { def submodel[N](json: JsValue)(implicit r: RefInfo[N]): Try[Sub...
eHarmony/aloha
aloha-core/src/main/scala/com/eharmony/aloha/factory/SubmodelFactory.scala
Scala
mit
390
package de.frosner.broccoli.nomad.models import enumeratum._ import cats.syntax.either._ import play.api.mvc.PathBindable import scala.collection.immutable /** * The kind of log stream of a client. */ sealed trait LogStreamKind extends EnumEntry with EnumEntry.Lowercase object LogStreamKind extends Enum[LogStre...
FRosner/cluster-broccoli
server/src/main/scala/de/frosner/broccoli/nomad/models/LogStreamKind.scala
Scala
apache-2.0
606
package scalismo.transformations import breeze.linalg.{DenseMatrix, DenseVector} import scalismo.common.{EuclideanSpace, EuclideanSpace1D, EuclideanSpace2D, EuclideanSpace3D, Field, RealSpace} import scalismo.geometry.{_1D, _2D, _3D, EuclideanVector, NDSpace, Point, SquareMatrix} import scalismo.registration.LandmarkR...
unibas-gravis/scalismo
src/main/scala/scalismo/transformations/Rotation.scala
Scala
apache-2.0
8,780
import leon.lang._ object Lists2 { abstract class List[T] case class Cons[T](head: T, tail: List[T]) extends List[T] case class Nil[T]() extends List[T] def forall[T](list: List[T], f: T => Boolean): Boolean = list match { case Cons(head, tail) => f(head) && forall(tail, f) case Nil() => true } d...
epfl-lara/leon
testcases/verification/higher-order/valid/Lists2.scala
Scala
gpl-3.0
1,435
package se.marcuslonnberg.stark import akka.actor.{Actor, ActorLogging, ActorRef, Props} import akka.io.Tcp.ConnectionClosed import se.marcuslonnberg.stark.ConnectionActor.SiteRequest import se.marcuslonnberg.stark.auth.AuthActor import se.marcuslonnberg.stark.auth.AuthActor.{AuthResponse, Authenticated} import se.mar...
FredrikWendt/stark
src/main/scala/se/marcuslonnberg/stark/ConnectionActor.scala
Scala
mit
3,199
/* * Copyright 2014–2018 SlamData Inc. * * 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 agr...
slamdata/slamengine
foundation/src/main/scala/quasar/contrib/cats/effect/liftio.scala
Scala
apache-2.0
1,730
// Copyright (C) Maxime MORGE 2017 package org.scaia.solver.asia import org.scaia.asia._ /** * Heuristics which returns a "good" matching * @param pb to solved * @param approximation true if only subgroups of size -1 are investigated * @param rule to apply (i.e. maximize the utilitarian/egalitarian welfar...
maximemorge/ScaIA
src/main/scala/org/scaia/solver/asia/SelectiveSolver.scala
Scala
gpl-3.0
4,043
package instances import org.scalatest.funsuite.AnyFunSuite import org.scalatest.matchers.should.Matchers import pl.iterators.kebs.instances.InstanceConverter.DecodeErrorException import pl.iterators.kebs.instances.TimeInstances import pl.iterators.kebs.json.KebsSpray import spray.json._ import java.time._ class Tim...
theiterators/kebs
spray-json/src/test/scala/instances/TimeInstancesTests.scala
Scala
mit
9,869
package test import dotty._ import Predef.{any2stringadd => _, StringAdd => _, _} object implicitDefs { implicit val x = 2 // error: type of implicit definition needs to be given explicitly implicit def y(x: Int) = 3 // error: result type of implicit definition needs to be given explicitly implicit def z(a: x....
som-snytt/dotty
tests/neg/implicitDefs.scala
Scala
apache-2.0
537
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
hequn8128/flink
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/CorrelateITCase.scala
Scala
apache-2.0
13,716
package daos import javax.inject.Inject import constants.TaskStatus import models.Task import play.api.db.slick.{DatabaseConfigProvider, HasDatabaseConfigProvider} import slick.jdbc.JdbcProfile import scala.concurrent.{ExecutionContext, Future} class TaskDao @Inject()(protected val dbConfigProvider: DatabaseConfigP...
chang850/play_slick
app/daos/TaskDao.scala
Scala
mit
2,019
/* * Copyright 2012 Twitter Inc. * * 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 t...
coursera/zipkin
zipkin-collector-service/src/main/scala/com/twitter/zipkin/collector/builder/CollectorServiceBuilder.scala
Scala
apache-2.0
4,653
/** * Copyright 2011-2017 GatlingCorp (http://gatling.io) * * 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 appli...
MykolaB/gatling
gatling-http/src/main/scala/io/gatling/http/protocol/HttpComponents.scala
Scala
apache-2.0
1,591
/* * sbt * Copyright 2011 - 2018, Lightbend, Inc. * Copyright 2008 - 2010, Mark Harrah * Licensed under Apache License 2.0 (see LICENSE) */ package sbt.util import java.io.{ Closeable, File, OutputStream } import sjsonnew.{ IsoString, JsonWriter, SupportConverter } import sbt.io.Using trait Output extends Clos...
xuwei-k/xsbt
util-cache/src/main/scala/sbt/util/Output.scala
Scala
apache-2.0
1,237
object Foo { def ### = 123 }
scala/scala
test/scaladoc/resources/t4641.scala
Scala
apache-2.0
31
package sampler.todo; //package sampler.data // //import sampler.math.Random //import sampler.Implicits._ //import org.scalatest.Matchers //import org.scalatest.FreeSpec //import org.scalatest.BeforeAndAfter // //class EmpiricalTableTest extends FreeSpec with BeforeAndAfter with Matchers { // // implicit val r = Rando...
tearne/Sampler
sampler-core/src/test/scala/sampler/todo/EmpiricalTableTest.scala
Scala
apache-2.0
2,270
/** * Copyright 2015 Thomson Reuters * * 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 ag...
bryaakov/CM-Well
server/cmwell-bg/src/main/scala/cmwell/bg/ImpStream.scala
Scala
apache-2.0
50,998
package wandou.util /** * * @author Caoyuan Deng * @version 1.0, November 24, 2006, 5:06 PM * @since 1.0.4 */ trait ChangeObserver { type Updater = PartialFunction[ChangeSubject, Unit] val updater: Updater def observe(subject: ChangeSubject) { subject.addObserver(this, this) } def unObserve(su...
wandoulabs/wandou-math
wandou-util/src/main/scala/wandou/util/ChangeObserver.scala
Scala
apache-2.0
383
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /** @author John Miller * @version 1.3 * @date Fri Feb 28 14:31:14 EST 2014 * @see LICENSE (MIT style license file). */ package apps.process import scalation.model.Modelable import scalation.process._ import scalation.ran...
NBKlepp/fda
scalation_1.3/scalation_models/src/main/scala/apps/process/Bank2.scala
Scala
mit
3,396
package spark.executor import java.nio.ByteBuffer import org.apache.mesos.{Executor => MesosExecutor, MesosExecutorDriver, MesosNativeLibrary, ExecutorDriver} import org.apache.mesos.Protos.{TaskState => MesosTaskState, TaskStatus => MesosTaskStatus, _} import spark.TaskState.TaskState import com.google.protobuf.ByteS...
joeywen/spark_cpp_api
core/src/main/scala/spark/executor/MesosExecutorBackend.scala
Scala
bsd-3-clause
2,250
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
cloud-fan/spark
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ArithmeticExpressionSuite.scala
Scala
apache-2.0
28,300
package spark import org.apache.spark.SparkEnv import org.apache.spark.broadcast.Broadcast import org.apache.spark.util.SizeEstimator object SparkMemoryUtilities { /** * Helper for dropping broadcast variables directly from the BlockManager created for each * local Spark process. */ def dropBroadcastVar...
adarob/eXpress-d
src/main/scala/spark/SparkMemoryUtilities.scala
Scala
apache-2.0
458
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
goldmedal/spark
mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala
Scala
apache-2.0
20,851
package models import com.datastax.driver.core.DataType._ import com.datastax.driver.core.Row import com.datastax.driver.core.querybuilder.QueryBuilder import com.datastax.driver.core.querybuilder.QueryBuilder.{eq => ceq} import com.datastax.driver.core.schemabuilder.SchemaBuilder import service.{CFKeys, ConfigCassan...
allixender/text2map
app/models/GeoName.scala
Scala
apache-2.0
4,850
package com.github.play2war.plugin.runners import java.io.File import com.github.play2war.plugin.it.{Java8, CargoContainerManager, Servlet30Container} object Jetty91xRunner extends App { val cargoContainer = new CargoContainerManager with Servlet30Container with Java8 { override def containerUrl = "http://rep...
swatikiran123/play2-war-plugin
project-code/integration-tests/src/test/scala/com/github/play2war/plugin/runners/Jetty91xRunner.scala
Scala
apache-2.0
696
//----------------------------------------------------------------------- // FILE : BinaryHelpers.scala // SUBJECT : Various helper methods to simplify the manipulation of binary data. // AUTHOR : (C) Copyright 2011 by Simone Willett <sgwillet@uvm.edu> and Peter C. Chapin <PChapin@vtc.vsc.edu> // //----------------...
pchapin/sprocket
src/edu/uvm/rtadmin/BinaryHelpers.scala
Scala
bsd-3-clause
7,071
package models import java.util.Date import com.github.tototoshi.slick.PostgresJodaSupport._ import org.joda.time.DateTime import play.api.db.slick.Config.driver.simple._ import scala.slick.lifted.Tag case class Person(id: Option[Long] = None, firstName: String, lastName: Option[String], birthDate: Option[DateTime]...
silbermm/proximal
app/models/People.scala
Scala
apache-2.0
8,490
package julienrf.json.derived /** Adapter function to transform case classes member names during the derivation process * * A NameAdapter can be used to customize the derivation process, allowing to apply a transformation function * to case classes member names when deriving serializers/deserializers * * For...
julienrf/play-json-derived-codecs
library/src/main/scala/julienrf/json/derived/NameAdapter.scala
Scala
mit
1,839
package org.example.actor import akka.actor.{Actor, ActorRef, Props} /** * Created by kailianghe on 1/7/15. */ case class StartProcessFileMsg() class WordCounterActor(filename: String) extends Actor { private var running = false private var totalLines = 0 private var lineProcessed = 0 private var result = ...
hekailiang/akka-play
actor-samples/src/main/scala/org/example/actor/WordCounterActor.scala
Scala
apache-2.0
1,096
package mongolia import com.mongodb.{ DBObject, BasicDBList } import org.bson.types._ import scuff._ import java.util.{ Date, UUID, TimeZone, Locale } import scala.reflect.ClassTag object BsonCodecs { implicit val NoneCdc = new Codec[None.type, BsonValue] { val NullBsonValue = new BsonValue { def raw = null } ...
nilskp/mongolia
src/main/scala/mongolia/BsonCodecs.scala
Scala
mit
18,779
package com.twitter.finagle.memcached.integration import com.twitter.conversions.time._ import com.twitter.finagle.builder.{ClientBuilder, Server, ServerBuilder} import com.twitter.finagle.memcached.Client import com.twitter.finagle.memcached.protocol.text.Memcached import com.twitter.finagle.memcached.protocol.{Comma...
stevegury/finagle
finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/ProxySpec.scala
Scala
apache-2.0
3,954
import org.junit.Test import selfassembly.examples._ case class Person5(name: String, age: Int, var parent: Person5) class CycleSpec { @Test def testInt() { val ts: Show[Int] = implicitly[Show[Int]] val s = ts.show(42) assert(s == "42") } @Test def testCaseClass() { // joe has a very interestin...
phaller/selfassembly
src/test/scala/selfassembly/test5-cycle.scala
Scala
bsd-3-clause
537
package lila.chat import lila.hub.actorApi.shutup.PublicSource import lila.user.User sealed trait AnyChat { def id: Chat.Id def lines: List[Line] val loginRequired: Boolean def forUser(u: Option[User]): AnyChat def isEmpty = lines.isEmpty def userIds: List[User.ID] } sealed trait Chat[L <: Line] exte...
luanlv/lila
modules/chat/src/main/Chat.scala
Scala
mit
3,648
package com.twitter.finagle.exp.mysql import com.twitter.util.Future /** * A PreparedStatement represents a parameterized * sql statement which may be applied concurrently * with varying parameters. */ trait PreparedStatement { /** * Executes the prepared statement with the * given `params`. */ def a...
kristofa/finagle
finagle-mysql/src/main/scala/com/twitter/finagle/mysql/PreparedStatement.scala
Scala
apache-2.0
725
/* * Copyright (C) 2007-2008 Artima, Inc. All rights reserved. * * 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 requir...
peachyy/scalastu
functional-objects/ex9/Rational.scala
Scala
apache-2.0
1,732