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 |
|---|---|---|---|---|---|
// Jubatus: Online machine learning framework for distributed environment
// Copyright (C) 2014-2015 Preferred Networks and Nippon Telegraph and Telephone Corporation.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License version 2.1... | jubatus/jubaql-server | processor/src/test/scala/us/jubat/jubaql_server/processor/SchemaDStreamSpec.scala | Scala | lgpl-2.1 | 6,502 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.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... | monixio/monix | monix-execution/shared/src/test/scala/monix/execution/AckSuite.scala | Scala | apache-2.0 | 25,054 |
/*
* -╥⌐⌐⌐⌐ -⌐⌐⌐⌐-
* ≡╢░░░░⌐\\░░░φ ╓╝░░░░⌐░░░░╪╕
* ╣╬░░` `░░░╢┘ φ▒╣╬╝╜ ░░╢╣Q
* ║╣╬░⌐ ` ╤▒▒▒Å` ║╢╬╣
* ╚╣╬░⌐ ╔▒▒▒▒`«╕ ╢╢╣▒
* ╫╬░░╖ .░ ╙╨╨ ╣╣╬░φ ╓φ░╢╢Å
* ╙╢░░░░⌐"░░░╜ ╙Å░░░░⌐░░░░╝`
* ``˚¬ ⌐ ˚˚⌐´
*
* ... | Flipkart/connekt | busybees/src/main/scala/com/flipkart/connekt/busybees/streams/flows/dispatchers/HttpDispatcher.scala | Scala | mit | 3,548 |
package life
import com.badlogic.gdx.backends.lwjgl._
object Main extends App {
val cfg = new LwjglApplicationConfiguration
cfg.title = "life"
cfg.width = 1420
cfg.height = 880
cfg.forceExit = false
new LwjglApplication(new Life, cfg)
}
| samyatchmenoff/emergence | life/desktop/src/main/scala/Main.scala | Scala | mit | 263 |
package mesosphere.marathon.core.launcher.impl
import java.util
import java.util.Collections
import mesosphere.marathon.core.base.ConstantClock
import mesosphere.marathon.{ MarathonTestHelper, MarathonSchedulerDriverHolder, MarathonSpec }
import mesosphere.marathon.core.launcher.TaskLauncher
import mesosphere.mesos.p... | sepiroth887/marathon | src/test/scala/mesosphere/marathon/core/launcher/impl/TaskLauncherImplTest.scala | Scala | apache-2.0 | 2,467 |
import sbt._
import Keys._
import org.scalatra.sbt._
import org.scalatra.sbt.PluginKeys._
import com.mojolly.scalate.ScalatePlugin._
import ScalateKeys._
object YuzuBuild extends Build {
val Organization = "org.insightcentre"
val Name = "ColloqWN Editor"
val Version = "0.0.1-SNAPSHOT"
val ScalaVersion = "2.10.... | jmccrae/cwn-editor | project/build.scala | Scala | apache-2.0 | 2,204 |
package mesosphere.marathon.api.v2.json
import mesosphere.marathon.Protos.Constraint
import mesosphere.marathon.core.readiness.ReadinessCheckTestHelper
import mesosphere.marathon.core.health.HealthCheck
import mesosphere.marathon.state.AppDefinition.VersionInfo.OnlyVersion
import mesosphere.marathon.state.PathId._
imp... | timcharper/marathon | src/test/scala/mesosphere/marathon/api/v2/json/AppDefinitionFormatsTest.scala | Scala | apache-2.0 | 16,366 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/package.scala | Scala | apache-2.0 | 1,556 |
package de.zalando.play.swagger.sbt
import java.io.File
import de.zalando.BuildInfo
import de.zalando.apifirst.Application.StrictModel
import de.zalando.swagger.SwaggerParser
import de.zalando.swagger.strictModel.SwaggerModel
import sbt.Keys._
import sbt.{Defaults, _}
/**
* @since 24.05.2016.
*/
//noinspection S... | zalando/play-swagger | plugin/src/main/scala/de/zalando/play/swagger/sbt/ApiFirstSwaggerParser.scala | Scala | mit | 2,241 |
object Success
| twitter-forks/sbt | sbt/src/sbt-test/project/scripted-plugin/changes/Success.scala | Scala | bsd-3-clause | 15 |
package com.geishatokyo.sqlgen.process
import java.io.File
import java.nio.file.Paths
import com.geishatokyo.sqlgen.SQLGenException
import com.geishatokyo.sqlgen.core.Workbook
/**
* Created by takezoux2 on 2017/07/05.
*/
trait OutputProc[DataType] extends Proc with OutputSupport{
def dataKey: Key[MultiData[Da... | geishatokyo/sql-generator | src/main/scala/com/geishatokyo/sqlgen/process/OutputProc.scala | Scala | mit | 884 |
import akka.actor.{ Actor, ActorSelection }
import akka.persistence.{ AtLeastOnceDelivery, PersistentActor }
sealed trait Cmd
case class SayHello(deliveryId: Long, s: String) extends Cmd
case class ReceiveHello(deliveryId: Long) extends Cmd
sealed trait Evt
case class HelloSaid(s: String) extends Evt
case class Hello... | ironfish/reactive-application-development-scala | chapter6_003_atleastonce/src/main/scala/AtLeastOnce.scala | Scala | apache-2.0 | 1,199 |
/*
* Copyright 2015 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... | keithhall/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600j/v2/J2.scala | Scala | apache-2.0 | 768 |
package org.jetbrains.plugins.scala
package codeInspection.parameters
import com.intellij.codeInspection.{LocalInspectionTool, ProblemHighlightType, ProblemsHolder}
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.psi.{PsiElement, PsiElementVisitor}
import org.jetbrains.plugins.scala.codeInspection.Inspect... | LPTK/intellij-scala | src/org/jetbrains/plugins/scala/codeInspection/parameters/NameBooleanParametersInspectionBase.scala | Scala | apache-2.0 | 4,070 |
/*
* 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 ... | ueshin/apache-spark | sql/catalyst/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Relation.scala | Scala | apache-2.0 | 8,229 |
package stormlantern.consul.client.dao
//[
// {
// "Node": "foobar",
// "Address": "10.1.10.12",
// "ServiceID": "redis",
// "ServiceName": "redis",
// "ServiceTags": null,
// "ServiceAddress": "",
// "ServicePort": 8000
// }
//]
case class ServiceInstance(
node: String,
address: String,
... | dlouwers/reactive-consul | client/src/main/scala/stormlantern/consul/client/dao/IndexedServiceInstances.scala | Scala | mit | 818 |
import leon.Utils._
import leon.Annotations._
/*
Add the missing postcondition.
*/
object SearchLinkedList {
sealed abstract class List
case class Cons(head : BigInt, tail : List) extends List
case class Nil() extends List
def size(list : List) : BigInt = (list match {
case Nil() => 0
case Cons(_, ... | epfl-lara/leon | testcases/graveyard/tutorials/11_Ex10_SearchLinkedList.scala | Scala | gpl-3.0 | 1,122 |
/*
* Ported from https://github.com/junit-team/junit
*/
package org.junit.internal
import org.junit.Assert
class InexactComparisonCriteria private(val fDelta: AnyRef)
extends ComparisonCriteria {
def this(delta: Double) =
this(delta.asInstanceOf[AnyRef])
def this(delta: Float) =
this(delta.asInsta... | nicolasstucki/scala-js-junit | runtime/src/main/scala/org/junit/internal/InexactComparisonCriteria.scala | Scala | bsd-3-clause | 756 |
package models;
import java.util.UUID
case class YoSubscriber(
id: UUID,
username: String
) | sne11ius/playlog | app/models/YoSubscriber.scala | Scala | gpl-3.0 | 101 |
package com.perevillega.sesms
/**
*
* User: pvillega
*/
class Esms {
}
| pvillega/S-ESMS | src/main/scala/com/perevillega/sesms/Esms.scala | Scala | lgpl-3.0 | 76 |
package com.twitter.util
import org.openjdk.jmh.annotations._
// ./sbt 'project util-benchmark' 'jmh:run DurationBenchmark'
@State(Scope.Benchmark)
class DurationBenchmark extends StdBenchAnnotations {
private[this] val d1 = Duration.fromNanoseconds(1)
private[this] val d2 = Duration.fromNanoseconds(2)
private... | twitter/util | util-benchmark/src/main/scala/com/twitter/util/DurationBenchmark.scala | Scala | apache-2.0 | 1,193 |
/*
* Copyright 2015 Roberto Tyley
*
* 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... | rtyley/play-git-hub | src/main/scala/com/madgag/scalagithub/model/Label.scala | Scala | gpl-3.0 | 1,003 |
package models
case class InputTopListEntry(name: String, count: Int)
| MeiSign/Fillable | app/models/InputTopListEntry.scala | Scala | apache-2.0 | 72 |
/*
* Distributed as part of Scalala, a linear algebra library.
*
* Copyright (C) 2008- Daniel Ramage
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the ... | scalala/Scalala | src/main/scala/scalala/generic/math/CanExp.scala | Scala | lgpl-2.1 | 3,577 |
trait C[A]
object Test {
def ImplicitParamCA[CC[A], A](implicit ev: C[A]) {implicitly[C[A]]} // must use this exact syntax...
// error: could not find implicit value for parameter e: C[A]
}
// [[syntax trees at end of typer]]
// abstract trait C#5[A#9116 >: Nothing#5832 <: Any#52] extends scala#33.AnyRef#2780;
// f... | loskutov/intellij-scala | testdata/scalacTests/pos/t3582.scala | Scala | apache-2.0 | 695 |
package edu.gemini.spModel.dataset
import edu.gemini.spModel.core.catchingNonFatal
import edu.gemini.spModel.pio.xml.PioXmlFactory
import edu.gemini.spModel.pio.{PioParseException, ParamSet, Param}
import edu.gemini.spModel.pio.codec._
import java.time.temporal.{TemporalAccessor, TemporalQuery}
import java.time.{Zone... | arturog8m/ocs | bundle/edu.gemini.pot/src/main/scala/edu/gemini/spModel/dataset/DatasetCodecs.scala | Scala | bsd-3-clause | 3,048 |
package tryp
package state
package core
import shapeless.{HList, Coproduct}
import cats.Functor
import cats.data.WriterT
import org.log4s.Logger
trait TransResultElem
trait Sendable
extends TransResultElem
sealed trait LoopSendable
extends TransResultElem
trait Message
extends Sendable
with LoopSendable
object ... | tek/pulsar | state-core/src/data.scala | Scala | mit | 4,425 |
package arena.game.gameoflife
import scala.swing._
import scala.swing.event._
object SwingMain extends SimpleSwingApplication {
def top = new MainFrame {
title = "Conway's Game of Life"
val startStopButton = new Button("Stop")
val fasterButton = new Button("+")
val slowerButton = new Button("-")
... | quedexco/arena-scala | src/main/scala/arena/game/gameoflife/SwingMain.scala | Scala | apache-2.0 | 1,959 |
package text.parser
import text.normalizer._
import text.{StringNone, StringOption, StringSome}
import util.Config
import util.primitive._
import scala.collection.mutable
import scala.collection.mutable.ListBuffer
import scala.io.Source
import scala.util.matching.Regex
import scala.util.matching.Regex.Match
/**
* ... | ynupc/scalastringcourseday7 | src/main/scala/text/parser/SentenceQuotationParser.scala | Scala | apache-2.0 | 4,674 |
/*
* 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 ... | jinglining/flink | flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/utils/UserDefinedTableAggFunctions.scala | Scala | apache-2.0 | 7,292 |
package mesosphere.marathon
import org.rogach.scallop.ScallopConf
import java.net.InetSocketAddress
import mesosphere.util.BackToTheFuture
import scala.concurrent.duration._
trait ZookeeperConf extends ScallopConf {
private val userAndPass = """[^/@]+"""
private val hostAndPort = """[A-z0-9-.]+(?::\\d+)?"""
pr... | quamilek/marathon | src/main/scala/mesosphere/marathon/ZookeeperConf.scala | Scala | apache-2.0 | 2,412 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
/**
* All doc-comments marked as "MDN" are by... | scala-js/scala-js | library/src/main/scala-old-collections/scala/scalajs/js/Any.scala | Scala | apache-2.0 | 23,677 |
package com.github.challenge
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.WordSpec
import problem.ProblemInfo
import org.scalatest.concurrent.Conductors
abstract class ProblemTester[A <: problem.Problem] extends WordSpec with ShouldMatchers with Conductors {
type problemAndSolution = (A, String... | challenge-helper/challenge-helper | src/main/scala/com/github/challenge/ProblemTester.scala | Scala | apache-2.0 | 1,810 |
/*******************************************************************************
* Copyright 2010 Olaf Sebelin
*
* This file is part of Verdandi.
*
* Verdandi is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Found... | osebelin/verdandi | src/main/scala/verdandi/model/persistence/StorageBackend.scala | Scala | gpl-3.0 | 9,889 |
package com.tenderowls.match3.server.data
case class Score(data: Map[ColorCell, Int]) extends AnyVal { a =>
def exists(f: Int => Boolean): Boolean =
data.values.exists(f)
def inc(cell: ColorCell): Score = {
val entry = (cell, a.data.get(cell).fold(0)(_ + 1))
Score(a.data + entry)
}
def +(b: Scor... | fomkin/match3 | server/src/main/scala/com/tenderowls/match3/server/data/Score.scala | Scala | lgpl-3.0 | 799 |
package com.waltsu.wdht.storage
import com.waltsu.wdht.testhelpers.CleanDatabase
import org.junit.runner.RunWith
import org.specs2.mutable
import org.specs2.runner.JUnitRunner
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext}
@RunWith(classOf[JUnitRunner])
class StoreEngineSpec(imp... | waltsu/wdht | src/test/scala/com/waltsu/wdht/storage/StorageEngineSpec.scala | Scala | mit | 1,181 |
package org.scalaide.ui.internal.preferences
import scala.tools.nsc.Settings
import org.eclipse.core.resources.IProject
import org.eclipse.core.runtime.IPath
import org.scalaide.core.internal.ScalaPlugin
import org.scalaide.core.internal.project.CompileScope
import org.scalaide.ui.internal.preferences.IDESettings.Box... | dragos/scala-ide | org.scala-ide.sdt.core/src/org/scalaide/ui/internal/preferences/ScopesSettings.scala | Scala | bsd-3-clause | 1,526 |
/*
* 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 ... | ueshin/apache-spark | core/src/main/scala/org/apache/spark/ui/WebUI.scala | Scala | apache-2.0 | 9,061 |
package models
import reactivemongo.bson
import reactivemongo.bson.{BSONDocument, BSONDocumentReader, Macros}
case class Ranking(
season: String,
region: String,
division: String,
position: Int,
team: String,
... | soniCaH/footbalisto-api | app/models/Ranking.scala | Scala | apache-2.0 | 1,480 |
/*
* Copyright (c) 2015-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | snowplow/scala-weather | src/main/scala/com.snowplowanalytics/weather/providers/darksky/requests.scala | Scala | apache-2.0 | 2,570 |
package org.grimrose.scala
import scala.concurrent.{ ExecutionContext, Future }
import _root_.generated._
class PhotosynthServiceClient(implicit val ctx: ExecutionContext) extends SoapClient {
type CollectionId = String
def ping(): Future[Option[String]] = {
this.service.ping().map(_.PingResult)
}
def ... | grimrose/shibuya-java-14 | src/main/scala/org/grimrose/scala/PhotosynthServiceClient.scala | Scala | mit | 1,316 |
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "realtimepermit"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm,
"net.debasishg" %% "redisclient" % "2.10"
)
v... | jeroenr/notimelikerealtime | crud_app/project/Build.scala | Scala | apache-2.0 | 499 |
/*
* This file is part of P2pCore.
*
* Copyright (C) 2012 Timur Mehrvarz, timur.mehrvarz(at)gmail.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation <http://www.gnu.org/licenses/>, eith... | mehrvarz/P2pCore | src/RelayStress.scala | Scala | gpl-3.0 | 1,449 |
package com.github.gdefacci.briscola.game
import com.github.gdefacci.ddd._
import com.github.gdefacci.briscola.player._
sealed trait Seed
object Seed {
case object bastoni extends Seed
case object coppe extends Seed
case object denari extends Seed
case object spade extends Seed
val values = Set(bastoni, ... | gdefacci/briscola | ddd-briscola/src/main/scala/com/github/gdefacci/briscola/game/model.scala | Scala | bsd-3-clause | 4,376 |
package com.twitter.finagle.http.codec
import org.jboss.netty.channel.{
SimpleChannelUpstreamHandler, Channels,
ChannelHandlerContext, MessageEvent}
import org.jboss.netty.handler.codec.http.{HttpHeaders, HttpRequest}
/**
* A simple channel handler to respond to "Expect: Continue" from
* clients. It responds un... | adriancole/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/codec/RespondToExpectContinue.scala | Scala | apache-2.0 | 1,029 |
package com.bstek.designer.core.execution
import com.intellij.execution.application.{ApplicationConfigurationType, ApplicationConfiguration}
import com.intellij.openapi.project.Project
/**
* Created with IntelliJ IDEA.
* User: robin
* Date: 13-10-18
* Time: 下午4:33
* To change this template use File | Settings | ... | OuYuBin/IDEADorado | dorado-core/src/com/bstek/designer/core/execution/DoradoApplicationConfiguration.scala | Scala | apache-2.0 | 569 |
package gitbucket.core.api
import gitbucket.core.util.RepositoryName
import gitbucket.core.model.CommitComment
import java.util.Date
/**
* https://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent
*/
case class ApiPullRequestReviewComment(
id: Int, // 29724692
// "diff_hunk": "@@ -1 ... | noc06140728/gitbucket | src/main/scala/gitbucket/core/api/ApiPullRequestReviewComment.scala | Scala | apache-2.0 | 2,401 |
def f1(x: Int) = println("x : " + x)
def f2(x: Int) { println("x : " + x) }
| grzegorzbalcerek/scala-book-examples | examples/Procedures1.scala | Scala | mit | 76 |
/**
* 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... | timve/gatling | gatling-core/src/test/scala/io/gatling/core/config/ProtocolSpec.scala | Scala | apache-2.0 | 1,730 |
package cmwell.analytics.main
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import cmwell.analytics.data.{DataWriterFactory, IndexWithCompleteDocument}
import cmwell.analytics.downloader.PartitionedDownloader
import cmwell.analytics.util.{DiscoverEsTopology, FindContactPoints}
import com.fasterxml... | bryaakov/CM-Well | tools/dataConsistencyTool/extract-index-from-es/src/main/scala/cmwell/analytics/main/CopyIndexesWithMapping.scala | Scala | apache-2.0 | 3,431 |
package org.scalatra.ssgi
import org.scalatest.matchers.MustMatchers
import org.scalatest.{WordSpec}
class CookieSpec extends WordSpec with MustMatchers {
"a Cookie" should {
"render a simple name value pair" in {
val cookie = Cookie("theName", "theValue")
cookie.toCookieString must startWith("theN... | scalatra/ssgi | core/src/test/scala/org/scalatra/ssgi/CookieSpec.scala | Scala | bsd-2-clause | 2,413 |
package com.nummulus.amqp.driver.akka
import org.scalatest.FlatSpecLike
import org.scalatest.Matchers
import org.scalatest.OneInstancePerTest
import org.scalatest.mock.MockitoSugar
import com.nummulus.amqp.driver.MessageProperties
import com.rabbitmq.client.AMQP
import com.rabbitmq.client.Channel
import com.rabbitmq.... | nummulus/amqp-driver | amqp-driver/src/test/scala/com/nummulus/amqp/driver/akka/AkkaRabbitConsumerTest.scala | Scala | apache-2.0 | 1,149 |
package com.softwaremill.play24.dao
import com.softwaremill.play24.models.{CoffeeTable, Coffee}
import slick.driver.H2Driver.api._
import scala.concurrent.Future
class CoffeeDao(db: Database, supplierDao: SupplierDao) {
val query = TableQuery[CoffeeTable]
def all: Future[Seq[Coffee]] = db.run(query.result)
/... | guersam/macwire | examples/play24/app/com/softwaremill/play24/dao/CoffeeDao.scala | Scala | apache-2.0 | 601 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.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... | monifu/monifu | monix-reactive/jvm/src/test/scala/monix/reactive/issues/Issue908Suite.scala | Scala | apache-2.0 | 4,305 |
import collection.mutable.Stack
import org.scalatest._
class ExampleSpec extends FunSuite with Matchers {
test( "Stack Test" ) {
val stack = new Stack[Int]
stack.push(1)
stack.push(2)
assert( stack.pop() == 2, ": A Stack should pop values in last-in-first-out order" )
assert( stack.pop() == 1, ... | nasa-nccs-cds/BDWPS | test/scalatest.scala | Scala | gpl-2.0 | 388 |
package org.airpnp.actor
import scala.actors.Actor
import scala.actors.Actor._
import scala.xml.Node
import org.airpnp.upnp.Device
import org.airpnp.Logging
import scala.util.Try
import scala.util.Failure
import scala.util.Success
class DeviceBuilder(private val download: String => Node) extends BaseActor {
overri... | provegard/ScAirPnp | src/main/scala/org/airpnp/actor/DeviceBuilder.scala | Scala | mit | 1,279 |
package org.clulab.openie
import java.io.InputStream
object ResourceUtils {
// methods for reading rules
def streamFromResource(path: String): InputStream = {
val stream = getClass.getClassLoader.getResourceAsStream(path)
stream
}
def readResource(path: String): String = {
val stream = streamF... | sistanlp/processors | openie/src/main/scala/org/clulab/openie/ResourceUtils.scala | Scala | apache-2.0 | 460 |
package challenge8a
import core._
sealed trait HttpValue[A] {
def fold[X](
explosion: Throwable => X,
fail: String => X,
ok: A => X
): X = this match {
case Explosion(exception) => explosion(exception)
case Fail(message) => fail(message)
case Ok(value) => ok(value)
}
def map[B](f: A =... | Kimply/scala-challenge | src/main/scala/challenge8a/HttpValue.scala | Scala | mit | 1,064 |
/*
Facsimile: A Discrete-Event Simulation Library
Copyright © 2004-2020, Michael J Allen.
This file is part of Facsimile.
Facsimile is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, either version 3 of the ... | MichaelJAllen/facsimile | core/src/main/scala/org/facsim/anim/cell/IncorrectFormatException.scala | Scala | lgpl-3.0 | 2,085 |
package com.twitter.inject.server
import com.google.inject.Module
import com.twitter.finagle.client.ClientRegistry
import com.twitter.finagle.{http, httpx}
import com.twitter.inject.Logging
import com.twitter.inject.app.App
import com.twitter.inject.modules.StatsReceiverModule
import com.twitter.server.Lifecycle.Warmu... | jaume-pinyol/finatra | inject/inject-server/src/main/scala/com/twitter/inject/server/TwitterServer.scala | Scala | apache-2.0 | 2,456 |
import scala.quoted._
import scala.quoted.staging._
import scala.quoted.autolift
object Test {
implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(getClass.getClassLoader)
def main(args: Array[String]): Unit = run {
'{
def p[T](arr: Array[T]): Unit = {
println(a... | som-snytt/dotty | tests/run-staging/quote-lift-Array.scala | Scala | apache-2.0 | 970 |
package cosbench_ng
import org.slf4j.LoggerFactory
import com.amazonaws.ClientConfiguration
import com.amazonaws.services.s3.{ AmazonS3, AmazonS3ClientBuilder }
import com.amazonaws.services.s3.model.{ GetObjectRequest, ObjectMetadata }
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration
impor... | vardhanv/cosbench_ng | common/src/main/scala/S3Actor.scala | Scala | mit | 8,559 |
package org.jetbrains.plugins.scala.worksheet.ui
import com.intellij.execution.impl.ConsoleViewImpl
import com.intellij.execution.ui.{ConsoleView, RunnerLayoutUi}
import com.intellij.openapi.project.{DumbAware, Project}
import com.intellij.openapi.wm.{ToolWindow, ToolWindowAnchor, ToolWindowFactory, ToolWindowManager}... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/worksheet/ui/WorksheetToolWindowFactory.scala | Scala | apache-2.0 | 3,624 |
package valfinding
class ClosureTest {
val fieldC = "captured field"
def useClosures(): Unit = {
val localValC = "Local val captured"
val shadowedInClosure = "This shouldn't be shown"
List("clParam1", "clParam2", "clParam3").map {closureParam /*{closure param decl}*/ =>
closureParam /*{closure ... | Kwestor/scala-ide | org.scala-ide.sdt.debug.tests/test-workspace/sfValFinding/src/Closures.scala | Scala | bsd-3-clause | 740 |
package module
import akka.cluster.VectorClock
import java.io.File
import java.nio.file.Files
import javafx.scene.{image => jfxsi}
import sun.audio.AudioPlayer
import scalafx.Includes._
import scalafx.beans.property.{ObjectProperty, ReadOnlyObjectWrapper, StringProperty}
import scalafx.collections.ObservableMap.Add... | wy4515/echo | player/src/main/scala/model/SongModel.scala | Scala | mit | 5,645 |
package lila.user
import scala._
case class Profile(
country: Option[String] = None,
location: Option[String] = None,
bio: Option[String] = None,
firstName: Option[String] = None,
lastName: Option[String] = None) {
def nonEmptyRealName = List(ne(firstName), ne(lastName)).flatten match {
cas... | Happy0/lila | modules/user/src/main/Profile.scala | Scala | mit | 703 |
package org.http4s
package parser
import cats.implicits._
import org.http4s.internal.parboiled2._
private[parser] abstract class Http4sHeaderParser[H <: Header](val input: ParserInput) extends Parser with AdditionalRules {
def entry: Rule1[H]
def parse: ParseResult[H] =
entry.run()(Parser.DeliveryScheme.Eit... | ZizhengTai/http4s | core/src/main/scala/org/http4s/parser/Http4sHeaderParser.scala | Scala | apache-2.0 | 396 |
/*
* Copyright (C) 2017. RandomCoder <randomcoder@randomcoding.co.uk>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any la... | randomcoder/gherkin-converter | src/main/scala/uk/co/randomcoding/cucumber/generator/html/FeatureHtml.scala | Scala | agpl-3.0 | 5,879 |
object Test {
import implicits.Not
class Foo
class Bar
implicit def foo: Foo = ???
implicitly[Foo]
implicitly[Not[Foo]] // error
implicitly[Not[Bar]]
}
| som-snytt/dotty | tests/neg/i5234a.scala | Scala | apache-2.0 | 167 |
/*
* Copyright 2014–2017 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... | drostron/quasar | frontend/src/main/scala/quasar/HomomorphicFunction.scala | Scala | apache-2.0 | 896 |
/*
* 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 ... | UndeadBaneGitHub/spark | resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackend.scala | Scala | apache-2.0 | 27,068 |
// This one blows up with a huge type in Scala 2.
// Reported by Jon Pretty in his talk on Scala type inference.
object Test {
val x = List(List, Vector)
val y: List[scala.collection.generic.SeqFactory[_]] = x
}
| lampepfl/dotty | tests/pos-special/jon.scala | Scala | apache-2.0 | 218 |
/**
* Copyright 2015 Frank Austin Nothaft
*
* 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 ... | bigdatagenomics/gnocchi | GnocchiFunSuite.scala | Scala | apache-2.0 | 1,031 |
/*
* 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 ... | ashokblend/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestLoadDataWithHiveSyntax.scala | Scala | apache-2.0 | 31,619 |
package org.salgo.sorting
import scala.annotation.tailrec
import scala.reflect.ClassTag
object BubbleSort extends GeneralFunctionalSortingAlgorithm {
override def sort[T <: Any : ClassTag](seq: Seq[T])(implicit ev: (T) => Ordered[T]): Seq[T] = {
this.sort(seq, Nil, Nil, continue = false)
}
@tailrec
priva... | ascensio/salgo | src/org.salgo/sorting/BubbleSort.scala | Scala | apache-2.0 | 822 |
package org.jetbrains.plugins.scala
package lang
package parser
package parsing
package patterns
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.parsing.expressions.PostfixExpr
/... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/patterns/Guard.scala | Scala | apache-2.0 | 1,168 |
package epic.features
import epic.parser.RefinedFeaturizer
import epic.framework.Feature
import breeze.util.Index
import epic.trees.Rule
import epic.parser.RuleTopology
import epic.trees.TreeInstance
import epic.trees.AnnotatedLabel
import scala.collection.mutable.HashMap
import breeze.linalg.Counter2
import breeze.li... | briantopping/epic | src/main/scala/epic/features/HackyLexicalProductionFeaturizer.scala | Scala | apache-2.0 | 5,421 |
package unfiltered
case class Cookie(name: String, value: String, domain: Option[String], path: Option[String], maxAge: Option[Int], secure: Option[Boolean]) {
def domain(d: String): Cookie = Cookie(name, value, Some(d), path, maxAge, secure)
def path(p: String): Cookie = Cookie(name, value, domain, Some(p), maxAg... | softprops/Unfiltered | library/src/main/scala/cookies.scala | Scala | mit | 610 |
/*
* 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 agree... | martindale/zipkin | zipkin-server/src/main/scala/com/twitter/zipkin/collector/sampler/adaptive/ZooKeeperAdaptiveLeader.scala | Scala | apache-2.0 | 5,205 |
/*
* Copyright 2012-2016 Netflix, 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... | wstrucke/edda | src/main/scala/com/netflix/edda/aws/DynamoDBElector.scala | Scala | apache-2.0 | 6,944 |
package cassandra
import com.datastax.driver.core.{Session, Cluster}
/**
*
*/
class CassandraConnector(val session : Session) {
val cluster = session.getCluster
def close = cluster.close
val metadata = cluster.getMetadata
}
object CassandraConnector {
def connect(node: String, port: Int): CassandraCon... | tupol/spark-learning | src/main/scala/cassandra/CassandraConnector.scala | Scala | apache-2.0 | 465 |
import control._
import java.io.File
import org.specs2.execute.Error.ThrowableException
import org.specs2.execute.{Result, AsResult}
import org.specs2.matcher.{Matcher, MatchersImplicits}
import scalaz.concurrent.Task
import scalaz.effect.IO
import scalaz.stream.Process
import scalaz._, Scalaz._
package object io exte... | etorreborre/lambdajam-2014 | src/main/scala/io/package.scala | Scala | mit | 2,459 |
package io.github.binaryfoo.gclog
import fastparse.all._
import org.scalatest.{FlatSpec, Matchers}
class EndsWithCurlyBracketTest extends FlatSpec with Matchers {
"abc}" should "be matched" in {
val Parsed.Success(value, _) = EndsWithCurlyBracket.!.parse("abc}")
value shouldBe "abc}"
}
"}" should "be ... | binaryfoo/gclog-parser | src/test/scala/io/github/binaryfoo/gclog/EndsWithCurlyBracketTest.scala | Scala | mit | 706 |
package cromwell
import java.util.UUID
import akka.actor.Props
import akka.testkit._
import com.typesafe.config.ConfigFactory
import cromwell.MetadataWatchActor.{FailureMatcher, Matcher}
import cromwell.SimpleWorkflowActorSpec._
import cromwell.core.{SimpleIoActor, WorkflowId, WorkflowSourceFilesWithoutImports}
impor... | ohsu-comp-bio/cromwell | engine/src/test/scala/cromwell/SimpleWorkflowActorSpec.scala | Scala | bsd-3-clause | 8,833 |
package dpla.ingestion3.mappers.providers
import dpla.ingestion3.mappers.utils.Document
import dpla.ingestion3.model._
import dpla.ingestion3.utils.FlatFileIO
import org.scalatest.{BeforeAndAfter, FlatSpec}
import scala.xml.{NodeSeq, XML}
class InMappingTest extends FlatSpec with BeforeAndAfter {
val shortName =... | dpla/ingestion3 | src/test/scala/dpla/ingestion3/mappers/providers/InMappingTest.scala | Scala | mit | 6,252 |
/*
* Buf.scala
* (FScape)
*
* Copyright (c) 2001-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU Affero General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.fscape.stream
import j... | Sciss/FScape-next | core/shared/src/main/scala/de/sciss/fscape/stream/Buf.scala | Scala | agpl-3.0 | 4,247 |
/*
* 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 ... | jinglining/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdHandlerTestBase.scala | Scala | apache-2.0 | 92,188 |
package com.dt.scala.pattern_match
/**
* Author: Wang Jialin
* Contact Information:
* WeChat: 18610086859
* QQ: 1740415547
* Email: 18610086859@126.com
* Tel: 18610086859
*/
import java.awt.Color
object Hello_Pattern_Match {
def main(args: Array[String]) {
val data =2
data match ... | slieer/scala-tutorials | src/main/scala/com/dt/scala/pattern_match/Hello_Pattern_Match.scala | Scala | apache-2.0 | 799 |
package com.twitter.finagle.thrift
import com.twitter.app.GlobalFlag
import com.twitter.conversions.storage._
import com.twitter.finagle.stats.{ClientStatsReceiver, Counter, StatsReceiver}
import com.twitter.finagle._
import com.twitter.scrooge._
import com.twitter.util._
import java.util.Arrays
import org.apache.thri... | sveinnfannar/finagle | finagle-thrift/src/main/scala/com/twitter/finagle/thrift/ThriftServiceIface.scala | Scala | apache-2.0 | 8,039 |
package com.twitter.service.cachet.test.unit
import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import javax.servlet.FilterChain
import limiter.{Limiter, LimitingService}
import org.specs._
import org.specs.mock._
import org.specs.mock.JMocker._
import com.twitter.service.cachet.test.mock._
object Li... | nkallen/cachet | src/test/scala/com/twitter/service/cachet/test/unit/LimiterSpec.scala | Scala | mit | 1,463 |
/*
* 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 | sql/src/test/scala/quasar/sql/Arbitraries.scala | Scala | apache-2.0 | 818 |
/*
* 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 ... | hvanhovell/spark | core/src/main/scala/org/apache/spark/scheduler/StageInfo.scala | Scala | apache-2.0 | 3,771 |
package mapalgebra
import java.util.concurrent.TimeUnit
import geotrellis.raster.{ IntArrayTile, Tile }
import org.openjdk.jmh.annotations._
// --- //
@BenchmarkMode(Array(Mode.AverageTime))
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Thread)
class CreationBench {
@Benchmark
def constant256: Tile = Int... | fosskers/mapalgebra | bench/geotrellis/src/main/scala/mapalgebra/Creation.scala | Scala | bsd-3-clause | 611 |
/*
* Copyright 2015 ligaDATA
*
* 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 ... | traytonwhite/Kamanja | trunk/Storage/HBase/src/main/scala/com/ligadata/keyvaluestore/HBaseAdapter.scala | Scala | apache-2.0 | 35,264 |
/*
* 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 ... | zimmermatt/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/aggfunctions/MinAggFunctionWithRetract.scala | Scala | apache-2.0 | 7,853 |
package org.example4.usage
// !!! NOTE:
// 1. wrong order of imports shouldn't be changed after refactoring
// though modified import (of moved class) should be inserted to a "proper place"
// 2. unused imports shouldn't be removed during refactoring
// We could do it (e.g. Java does it), but in Scala it might be ... | JetBrains/intellij-scala | scala/scala-impl/testdata/move/sortOnlyModifiedImport_DoNotTouchOther/after/org/example4/usage/Usage_SortOnlyModifiedImport_DoNotTouchOther.scala | Scala | apache-2.0 | 888 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package base
package types
/**
* @author Alexander Podkhalyuzin
* Date: 14.03.2008
*/
trait ScSequenceArg extends ScalaPsiElement {
} | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/api/base/types/ScSequenceArg.scala | Scala | apache-2.0 | 210 |
package fpinscala.state
import fpinscala.state.RNG._
import org.scalatest.{FlatSpec, Matchers}
/**
* Created with IntelliJ IDEA.
* Date: 15-08-05
* Time: 7:32 PM
* To change this template use File | Settings | File Templates.
*/
class StateSpec extends FlatSpec with Matchers{
behavior of "State.flatMap"
it sho... | hyleung/fpinscala | exercises/src/test/scala/fpinscala/state/StateSpec.scala | Scala | mit | 973 |
package sri.universal.apis
import scala.scalajs.js
import scala.scalajs.js.Promise
import scala.scalajs.js.annotation.JSImport
@js.native
@JSImport("react-native", "takeSnapshot")
object TakeSnapshot extends js.Object {
def apply(view: js.Any = ???,
options: SnapShotOptions = ???): Promise[js.Any] = js.... | scalajs-react-interface/universal | src/main/scala/sri/universal/apis/TakeSnapshot.scala | Scala | apache-2.0 | 571 |
package com.donoroncall.server.rest.undertow.handlers.authentication
import com.donoroncall.server.rest.controllers.authentication.AuthenticationController
import com.donoroncall.server.utils.STATUS_CODES
import com.google.inject.Inject
import io.undertow.server.{HttpHandler, HttpServerExchange}
import org.apache.comm... | donorcall01/DonorOnCall_Server | src/main/scala/com/donoroncall/server/rest/undertow/handlers/authentication/ProcessCompletion.scala | Scala | apache-2.0 | 2,387 |
Subsets and Splits
Filtered Scala Code Snippets
The query filters and retrieves a sample of code snippets that meet specific criteria, providing a basic overview of the dataset's content without revealing deeper insights.