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 |
|---|---|---|---|---|---|
/*
* Copyright (C) 2016 Lightbend Inc. <http://www.lightbend.com>
*/
package controllers
import play.api.{Configuration, Environment}
import play.api.mvc._
import uk.co.turingatemyhamster.shoppinglist.user.api.UserService
import scala.concurrent.{ExecutionContext, Future}
class Application(userService: UserService... | drdozer/shoppinglist | web-ui/app/controllers/Application.scala | Scala | apache-2.0 | 1,686 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | lrytz/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/lang/MathTest.scala | Scala | bsd-3-clause | 9,949 |
package unfiltered.response
/** Tells the binding implementation to treat the request as non-matching */
object Pass extends ResponseFunction[Any] {
type RF = ResponseFunction[Any]
def apply[T](res: HttpResponse[T]) = res
/** Promote given intent to one defined for all requests. Returns
* Pass where given i... | omarkilani/unfiltered | library/src/main/scala/response/pass.scala | Scala | mit | 3,295 |
package ipfix
import java.nio.ByteOrder
import akka.util.{ByteString, ByteIterator}
class ByteIterCounter(byteIter: ByteIterator) {
implicit val order = ByteOrder.BIG_ENDIAN
private var cnt = 0
def count = cnt
def hasNext: Boolean = byteIter.hasNext
def next() = { cnt += 1; byteIter.next() }
def getBy... | ConnorDillon/ipfix | src/main/scala/ipfix/ByteIterCounter.scala | Scala | gpl-3.0 | 1,410 |
// Copyright: 2010 - 2016 https://github.com/ensime/ensime-server/graphs
// Licence: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.indexer
import com.google.common.io.ByteStreams
import org.apache.commons.vfs2.FileObject
import scala.tools.scalap.scalax.rules.scalasig._
class ClassfileDepickler(file... | j-mckitrick/ensime-sbt | src/sbt-test/ensime-sbt/ensime-server/core/src/main/scala/org/ensime/indexer/ClassfileDepickler.scala | Scala | apache-2.0 | 1,502 |
package se.gigurra.leavu3.datamodel
import com.github.gigurra.heisenberg.MapData._
import com.github.gigurra.heisenberg.{Schema, Parsed}
case class SensorAngles(source: SourceData = Map.empty) extends SafeParsed[SensorAngles.type] {
val azimuth = parse(schema.azimuth).toDegrees
val elevation = parse(schema.elev... | GiGurra/leavu3 | src/main/scala/se/gigurra/leavu3/datamodel/SensorAngles.scala | Scala | mit | 512 |
package com.twitter.finagle
import com.twitter.util.{NonFatal, Future, Time}
/**
* A [[Filter]] acts as a decorator/transformer of a [[Service service]].
* It may apply transformations to the input and output of that service:
* {{{
* (* MyService *)
* [ReqIn -> (ReqOut -> RepIn) -> RepOut]
* }}}
* ... | jay-johnson/finagle | finagle-core/src/main/scala/com/twitter/finagle/Filter.scala | Scala | apache-2.0 | 7,083 |
package com.alvinalexander.macspeechserver
object Resources {
// male voices
val ALEX_VOICE = "Alex"
val DANIEL_VOICE = "Daniel"
val LEE_VOICE = "Lee"
val OLIVER_VOICE = "Oliver"
// female voices
val FIONA_VOICE = "Fiona"
val MOIRA_VOICE = "Moira"
val KAREN_VOIC... | alvinj/MacSpeechServer | src/main/scala/com/alvinalexander/macspeechserver/Resources.scala | Scala | gpl-3.0 | 1,234 |
package com.eevolution.context.dictionary.infrastructure.repository
import java.util.UUID
import com.eevolution.context.dictionary.domain._
import com.eevolution.context.dictionary.domain.model.Color
import com.eevolution.context.dictionary.infrastructure.db.DbContext._
import com.eevolution.utils.PaginatedSequence
i... | adempiere/ADReactiveSystem | dictionary-impl/src/main/scala/com/eevolution/context/dictionary/infrastructure/repository/ColorRepository.scala | Scala | gpl-3.0 | 2,621 |
/**
* Copyright 2011-2016 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... | GabrielPlassard/gatling | gatling-core/src/main/scala/io/gatling/core/action/If.scala | Scala | apache-2.0 | 1,738 |
/*
* sbt
* Copyright 2011 - 2018, Lightbend, Inc.
* Copyright 2008 - 2010, Mark Harrah
* Licensed under Apache License 2.0 (see LICENSE)
*/
package sbt
import java.io.{ File, IOException, PrintWriter, StringWriter }
import java.net.InetAddress
import java.time.LocalDateTime
import java.time.format.DateTimeFormat... | xuwei-k/xsbt | testing/src/main/scala/sbt/JUnitXmlTestsListener.scala | Scala | apache-2.0 | 10,651 |
/*
* 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/accounts/AC15.scala | Scala | apache-2.0 | 932 |
package controllers
import gov.dwp.carers.CADSHealthCheck
import monitoring.ProdHealthMonitor
import play.api.libs.json.{Json, Writes}
import play.api.mvc.{Action, Controller}
trait HealthController {
this: Controller =>
val healthMonitor = ProdHealthMonitor
implicit val healthWrites = new Writes[(String, CAD... | Department-for-Work-and-Pensions/RenderingService | app/controllers/HealthController.scala | Scala | mit | 938 |
package io.youi.path
case class LineTo(x: Double, y: Double) extends PathAction {
override def draw(context: Context, x: Double, y: Double, scaleX: Double, scaleY: Double): Unit = {
context.lineTo(x + (this.x * scaleX), y + (this.y * scaleY))
}
override def toString: String = s"LineTo(x: $x, y: $y)"
}
| outr/youi | ui/js/src/main/scala/io/youi/path/LineTo.scala | Scala | mit | 315 |
/*
* 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 ... | Intel-bigdata/OAP | oap-cache/oap/src/test/scala/org/apache/spark/sql/execution/datasources/oap/index/BitmapUsageSuite.scala | Scala | apache-2.0 | 4,605 |
package org.excala
import com.github.nscala_time.time.Imports._
object Implicits {
implicit val defaultTimeout = 200.millis
}
| edmundnoble/Excala | src/org/excala/Implicits.scala | Scala | bsd-3-clause | 130 |
package com.dragisak.typelevel
import org.scalatest.WordSpec
import org.scalatest.Matchers._
import NatToInt._
import Nat._
class NatSpec extends WordSpec {
"toInt converts Nat to Int" in {
toInt[Nat9] should be(9)
}
}
| dragisak/type-level | src/test/scala/com/dragisak/typelevel/NatSpec.scala | Scala | apache-2.0 | 233 |
import quoted.*
import scala.quoted.staging.*
object Test {
given Compiler = Compiler.make(getClass.getClassLoader)
def main(args: Array[String]): Unit = withQuotes {
val q = '{(q: Quotes) ?=>
val a = '{4}
${'{(q2: Quotes) ?=>
'{${a}}
}}
}
println(q.show)
}
}
| dotty-staging/dotty | tests/run-staging/quote-nested-5.scala | Scala | apache-2.0 | 308 |
package sisdn.admission.service
import akka.actor.ActorSystem
import akka.http.scaladsl.server._
import akka.stream.ActorMaterializer
import sisdn.admission.model.Student
import sisdn.admission.utils.JsonProtocol
object Main {
}
| mhashimm/sisdn-admission-service | src/main/scala/sisdn/admission/service/Main.scala | Scala | agpl-3.0 | 234 |
package edu.usc.irds.sparkler.storage.solr
import edu.usc.irds.sparkler.Constants
import edu.usc.irds.sparkler.storage.{StorageRDD, SparklerGroupPartition}
import edu.usc.irds.sparkler.model.{Resource, ResourceStatus, SparklerJob}
import org.apache.solr.client.solrj.{SolrClient, SolrQuery}
import org.apache.solr.clien... | USCDataScience/sparkler | sparkler-app/src/main/scala/edu/usc/irds/sparkler/storage/solr/SolrDeepRDD.scala | Scala | apache-2.0 | 3,658 |
/*
* 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 ... | pteichman/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/query/QueryRequest.scala | Scala | apache-2.0 | 1,039 |
/*
* Copyright 2017 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... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600j/v2/J7A.scala | Scala | apache-2.0 | 757 |
package org.apache.mesos.chronos.scheduler.mesos
import java.util.logging.Logger
import org.apache.mesos.chronos.scheduler.config.SchedulerConfiguration
import org.apache.mesos.chronos.scheduler.jobs._
import org.apache.mesos.chronos.scheduler.jobs.constraints.Constraint
import org.apache.mesos.chronos.utils.JobDeser... | wndhydrnt/chronos | src/main/scala/org/apache/mesos/chronos/scheduler/mesos/MesosJobFramework.scala | Scala | apache-2.0 | 12,934 |
/*
* Copyright 2016 The BigDL Authors.
*
* 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... | wzhongyuan/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/utils/tf/loaders/Placeholder.scala | Scala | apache-2.0 | 1,196 |
package com.scalegray.test
import org.scalatest._
import com.scalegray._
import io.jvm.uuid._
class NodeSpec extends FlatSpec {
"Node" should "return a UID" in {
val uid: Long = 9223372036854775807L
val stack = new Node(uid)
stack.getUID()
//assert(1 === 1)
}
}
| scalegray/concorde | src/test/scala/io/scalegray/test/NodeSpec.scala | Scala | mit | 287 |
package org.crashstars.common
import java.util.Properties
import org.springframework.core.io.support.PathMatchingResourcePatternResolver
/**
* Created by anavidad on 8/10/15.
*/
object ProjectProperties extends Properties with Logging {
private val patternResolver = new PathMatchingResourcePatternResolver()
p... | anavidad3/PoC-spark-scala-maven | src/main/scala/org/crashstars/common/ProjectProperties.scala | Scala | apache-2.0 | 631 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package reflect
... | scala/scala | src/reflect/scala/reflect/internal/JMethodOrConstructor.scala | Scala | apache-2.0 | 1,869 |
package mesosphere.marathon
package core.matcher.manager.impl
import java.util
import java.util.concurrent.TimeUnit
import akka.pattern.ask
import akka.testkit.TestActorRef
import akka.util.Timeout
import mesosphere.AkkaUnitTest
import mesosphere.marathon.core.instance.LocalVolumeId
import mesosphere.marathon.test.Se... | guenter/marathon | src/test/scala/mesosphere/marathon/core/matcher/manager/impl/OfferMatcherManagerActorTest.scala | Scala | apache-2.0 | 10,866 |
package scabot
package typesafe
import spray.json.{RootJsonFormat, DefaultJsonProtocol}
trait TypesafeApi extends TypesafeApiTypes with DefaultJsonProtocol with TypesafeApiActions { self: core.Core with core.HttpClient with core.Configuration => }
trait TypesafeApiTypes { self: core.Core with core.Configuration =>
... | SethTisue/scabot | typesafe/src/main/scala/scabot/typesafe/TypesafeApi.scala | Scala | bsd-3-clause | 1,157 |
/*
* 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 ... | vjagadish/samza-clone | samza-core/src/test/scala/org/apache/samza/storage/TestTaskStorageManager.scala | Scala | apache-2.0 | 11,929 |
/**
* 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... | nruppin/CM-Well | server/cmwell-imp/src/test/scala/cmwell/imp/IMPCassSpec.scala | Scala | apache-2.0 | 18,552 |
/*
* 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 ... | ptrendx/mxnet | scala-package/core/src/main/scala/org/apache/mxnet/NDArray.scala | Scala | apache-2.0 | 52,258 |
package eu.inn.metrics.loaders
import java.util.concurrent.TimeUnit
import com.codahale.metrics.{MetricRegistry, Slf4jReporter}
import scaldi.{Injectable, Injector}
import scala.concurrent.duration.Duration
class Slf4jReporterLoader(period: Duration)(implicit injector: Injector) extends MetricsReporterLoader with I... | InnovaCo/service-metrics | src/main/scala/eu/inn/metrics/loaders/Slf4jReporterLoader.scala | Scala | bsd-3-clause | 631 |
package com.pwootage.metroidprime.formats
import java.io.{ByteArrayOutputStream, DataOutputStream}
import java.nio.ByteBuffer
import com.pwootage.metroidprime.formats.io.PrimeDataFile
trait BinarySerializable {
def write(f: PrimeDataFile): Unit
def read(f: PrimeDataFile): Unit
def read(bytes: Arr... | Pwootage/prime-patcher | src/main/scala/com/pwootage/metroidprime/formats/BinarySerializable.scala | Scala | gpl-3.0 | 563 |
package testdata
import com.github.ghik.silencer.silent
object methodSuppression {
@silent
def method(): Unit = {
123
}
def other(): Unit = {
123
}
}
| ghik/silencer | silencer-plugin/testdata/methodSuppression.scala | Scala | apache-2.0 | 170 |
/*
* 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... | scottcutts/ct-calculations | src/test/scala/uk/gov/hmrc/ct/computations/CP14Spec.scala | Scala | apache-2.0 | 1,627 |
object Args {
def foo(x: => Int) = x
foo(1)
def bar(xs: Int*) = xs
bar()
bar(1)
bar(1, 2)
bar(List(1, 2): _*)
} | mdemarne/scalahost | tests/src/test/resources/ScalaToMeta/Args/Original.scala | Scala | bsd-3-clause | 125 |
package com.clarifi.reporting.util
import java.io.{File, OutputStream, InputStream}
object IOUtils {
/**
* Read all the data from the given InputStream
* and copy it to the given OutputStream.
* @return the number of bytes read and sent
*/
def copy(input:InputStream, output:OutputStream, defaultBuffe... | ermine-language/ermine-legacy | src/main/scala/com/clarifi/reporting/util/IOUtils.scala | Scala | bsd-2-clause | 1,130 |
package org.bitcoins.testkit.chain.fixture
import org.scalatest.Tag
/**
* If a test file uses ChainFixture as its FixtureParam, then
* using these tags will determine which fixture the test will get.
*
* Simply add taggedAs FixtureTag._ to your test before calling inFixtured.
*/
sealed abstract class ChainF... | bitcoin-s/bitcoin-s-core | testkit/src/main/scala/org/bitcoins/testkit/chain/fixture/ChainFixtureTag.scala | Scala | mit | 1,547 |
object Test {
val List(x, y, z: _ *,
) = 42 :: 17 :: Nil
def main(args: Array[String]): Unit = {
Console.println(x)
Console.println(y)
}
}
| som-snytt/dotty | tests/run/trailingCommas/trailingCommas.scala | Scala | apache-2.0 | 155 |
package hello
/***********************************************************************/
import org.springframework.boot._
import org.springframework.boot.autoconfigure._
import org.springframework.web.bind.annotation._
import org.springframework.context.annotation.Configuration._
import org.springframework.boot.autoc... | vireshjivane/hello-world | src/main/scala/hello/HelloWebApplication.scala | Scala | mit | 916 |
package KeYmaeraD
import scala.actors.Actor
import scala.actors.Actor._
import java.io.InputStream
import java.io.FileOutputStream
import java.io.File
import Nodes._
object TreeActions {
import RulesUtil._
import Procedures._
val myAddr = java.net.InetAddress.getLocalHost().getHostAddress()
var myPort = ... | keymaerad/KeYmaeraD | frontactor.scala | Scala | bsd-3-clause | 15,856 |
/*
* Copyright 2013 Julian Peeters
*
* 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... | julianpeeters/artisanal-pickle-maker | src/main/scala/resources/Position.scala | Scala | apache-2.0 | 673 |
package org.scalacheck.time
/** Stub trait since Scala Native does not have native support for java.time types. */
private[scalacheck] trait JavaTimeShrink
| rickynils/scalacheck | native/src/main/scala/org/scalacheck/time/JavaTimeShrink.scala | Scala | bsd-3-clause | 157 |
package fr.univnantes.vroom.core
import fr.univnantes.vroom.core.dto._
import fr.univnantes.vroom.core.dto.materiel.{MaterielDTO, MaterielFixeDTO, MaterielMobileDTO}
import fr.univnantes.vroom.core.dto.tarifs._
import fr.univnantes.vroom.core.persistable._
import fr.univnantes.vroom.core.persistable.materiel.MaterielM... | Callidon/v-room | src/main/scala/fr/univnantes/vroom/core/Systeme.scala | Scala | mit | 11,806 |
package io.github.hamsters
import scala.collection.immutable.Seq
import scala.meta._
class ShowMacro extends scala.annotation.StaticAnnotation {
inline def apply(defn: Any): Any = meta {
defn match {
//TODO handle object with existing companion
//case Seq(cls @ Defn.Class(_, name, _, ctor, templat... | dgouyette/hamsters | metas/shared/src/main/scala/io/github/hamsters/ShowMacro.scala | Scala | apache-2.0 | 1,098 |
package com.seanshubin.builder.domain
import akka.typed.ActorRef
import com.seanshubin.builder.domain.Event._
import com.seanshubin.uptodate.logic.SummaryReport
import scala.util.{Failure, Success, Try}
class DispatchResultHandler(actorRef: ActorRef[Event]) {
def foundLocalProjects(result: Try[Seq[String]]): Unit ... | SeanShubin/builder | domain/src/main/scala/com/seanshubin/builder/domain/DispatchResultHandler.scala | Scala | unlicense | 5,882 |
/*
* Copyright 2019 Spotify AB.
*
* 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 ... | spotify/scio | scio-google-cloud-platform/src/it/scala/com/spotify/scio/bigquery/types/BigQueryTypeIT.scala | Scala | apache-2.0 | 8,701 |
/*
* Copyright 2009-2011 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... | sortable/framework | core/json/src/test/scala/net/liftweb/json/SerializationExamples.scala | Scala | apache-2.0 | 12,082 |
package physical.habitat
import org.scalatestplus.mockito.MockitoSugar
import org.scalatest.{FlatSpec, PrivateMethodTester}
/**
*
* Created by Steven Hawes on 17/02/2016.
*/
class HabitatManagerTest extends FlatSpec with MockitoSugar with PrivateMethodTester {
/* val list = Array(
new Coordinate(-29.1125... | shawes/zissou | src/test/scala/physical/habitat/HabitatManagerTest.scala | Scala | mit | 1,868 |
package pt.up.fe.luisfonseca.cp.ui
import android.content.Intent
import android.os.Bundle
object Util {
/**
* Converts an intent into a {@link Bundle} suitable for use as fragment
* arguments.
*
* @param intent
* @return the bundle with the argument
*/
def intentToFragmentArg... | luismfonseca/cp-in-scala | src/pt/up/fe/luisfonseca/cp/ui/Util.scala | Scala | bsd-3-clause | 770 |
import scala.reflect.ClassTag
object Test extends App{
BooleanArrayClone;
ByteArrayClone;
ShortArrayClone;
CharArrayClone;
IntArrayClone;
LongArrayClone;
FloatArrayClone;
DoubleArrayClone;
ObjectArrayClone;
PolymorphicArrayClone;
}
object BooleanArrayClone{
val it : Array[Boolean] = Array(true, ... | scala/scala | test/files/run/arrayclone-new.scala | Scala | apache-2.0 | 2,303 |
object worksheet {import scala.runtime.WorksheetSupport._; def main(args: Array[String])=$execute{;$skip(62);
println("Welcome to the Scala worksheet")}
} | simula67/scala-coursera-martin-odersky | patmat/.worksheet/src/worksheet.scala | Scala | mpl-2.0 | 157 |
package pt.testing.whaa.ui.author
import android.app.ListFragment
import android.os.Bundle
import android.view.View
import android.widget.ListView
import org.scaloid.common._
import com.google.gson.Gson
import pt.testing.whaa.ui.ChangeToFragmentHandler
import pt.testing.whaa.models.Author
object Au... | luismfonseca/agile-scala-android | src/sbt-test/agile-scala-android/scaffold-recursive/src/main/scala/pt/testing/whaa/ui/author/AuthorListFragment.scala | Scala | mit | 1,613 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller, Hao Peng, Zhe Jin
* @version 1.3
* @date Mon Jul 27 01:27:00 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.analytics.classifier
import java.util.Random
import scala.collect... | NBKlepp/fda | scalation_1.3/scalation_modeling/src/main/scala/scalation/analytics/classifier/TANBayes.scala | Scala | mit | 22,195 |
package spire
package math
import spire.algebra.Order
/**
* Interface for a merging strategy object.
*/
trait Merge extends Any {
def merge[@sp A: Order: ClassTag](a:Array[A], b:Array[A]): Array[A]
}
/**
* Abstract class that can be used to implement custom binary merges with e.g. special collision behavior or... | non/spire | core/src/main/scala/spire/math/Merging.scala | Scala | mit | 4,861 |
package kmeans
import java.util.concurrent._
import scala.collection._
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import common._
import scala.math._
object KM extends KMeans
import KM._
@RunWith(classOf[JUnitRunner])
class KMeansSuite extends FunSuite {
d... | mitochon/hexercise | src/mooc/parprog/week3kmeans/src/test/scala/kmeans/KMeansSuite.scala | Scala | mit | 2,769 |
package mesosphere.marathon
package core.matcher.base
import mesosphere.marathon.core.instance.Instance
import mesosphere.marathon.core.launcher.InstanceOp
import mesosphere.marathon.state.PathId
import org.apache.mesos.{Protos => Mesos}
import scala.concurrent.Future
object OfferMatcher {
/**
* A InstanceOp ... | mesosphere/marathon | src/main/scala/mesosphere/marathon/core/matcher/base/OfferMatcher.scala | Scala | apache-2.0 | 3,447 |
package eu.execom.FabutPresentation.rest
import java.util._
import eu.execom.FabutPresentation.api._
import eu.execom.FabutPresentation.persistence._
import eu.execom.FabutPresentation.util._
import org.joda.time.DateTime
import org.json4s._
import org.scalatra._
import sun.misc.BASE64Encoder
abstract class Abstract... | idostanic/FabutPresentation | src/main/scala/eu/execom/FabutPresentation/rest/AbstractSecuredServlet.scala | Scala | apache-2.0 | 5,499 |
package aerospiker
import aerospiker.listener._
import cats.MonadError
import cats.data.Kleisli
import cats.syntax.either._
import com.aerospike.client.AerospikeException
import io.circe.{ Decoder, Encoder }
import scala.collection.generic.CanBuildFrom
trait Functions {
private type ME[F[_]] = MonadError[F, Throwa... | tkrs/aerospiker | core/src/main/scala/aerospiker/Functions.scala | Scala | mit | 3,974 |
// Copyright (c) 2020 Ben Zimmer. All rights reserved.
// Objects that represent flight paths and the various information
// to be tracked along with them.
package bdzimmer.orbits
import scala.collection.immutable.Seq
// This is sort of a parallel version of how flights
// are represented in Secondary
trait Flight... | bdzimmer/orbits | src/main/scala/bdzimmer/orbits/FlightParams.scala | Scala | bsd-3-clause | 3,207 |
package com.eevolution.context.dictionary.domain.api.service
import com.eevolution.context.dictionary.api
import com.eevolution.context.dictionary.domain.model.LdapProcessor
/**
* Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com
* This program is free software: you can redistribu... | adempiere/ADReactiveSystem | dictionary-api/src/main/scala/com/eevolution/context/dictionary/domain/api/service/LdapProcessorService.scala | Scala | gpl-3.0 | 1,233 |
package com.github.skozlov.turing
import com.github.skozlov.turing.CellState._
import com.github.skozlov.turing.Direction._
import com.github.skozlov.turing.State.NonTerminal
import scala.collection.mutable.ArrayBuffer
import com.github.skozlov.turing.Tape._
/**
* A sequence of the cells considered a component of a... | skozlov/turing | base/src/main/scala/com/github/skozlov/turing/Tape.scala | Scala | apache-2.0 | 6,623 |
package build
import java.io.{Reader, StringReader}
import models._
import org.apache.lucene.analysis.standard.StandardAnalyzer
import org.apache.lucene.codecs.Codec
import org.apache.lucene.document.Field.Store
import org.apache.lucene.document._
import org.apache.lucene.index.FieldInfo.IndexOptions
import org.apach... | grahamar/Giles | app/build/DocsIndexer.scala | Scala | apache-2.0 | 9,979 |
/**
* 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... | flange/drift-dev | kafka/00-kafka_2.11-0.10.1.0/libs/tmp/kafka/consumer/ConsumerFetcherThread.scala | Scala | apache-2.0 | 5,910 |
package jp.t2v.lab.play2.auth
import scala.concurrent.{ExecutionContext, Future}
import play.api.mvc.RequestHeader
trait AsyncIdContainer[Id] {
def startNewSession(userId: Id, timeoutInSeconds: Int)(implicit request: RequestHeader, context: ExecutionContext): Future[AuthenticityToken]
def remove(token: Authenti... | indykish/play2-auth | module/src/main/scala/jp/t2v/lab/play2/auth/AsyncIdContainer.scala | Scala | apache-2.0 | 1,463 |
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala
package xml
imp... | scala/scala-xml | shared/src/main/scala/scala/xml/MetaData.scala | Scala | apache-2.0 | 7,592 |
/**
* 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... | gf53520/kafka | core/src/test/scala/unit/kafka/admin/ConfigCommandTest.scala | Scala | apache-2.0 | 31,441 |
/*
* 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... | jedesah/Quasar | connector/src/main/scala/quasar/config/package.scala | Scala | apache-2.0 | 948 |
package net.janvsmachine.fpinscala
import org.scalatest.FlatSpec
class EitherTests extends FlatSpec {
import Either._
val ex = new Exception("Test exception")
val otherEx = new Exception("Other test exception")
"An error value" should "comply with spec" in {
val l: Either[Exception, String] = Left(ex)
... | stettix/fp-in-scala | src/test/scala/net/janvsmachine/fpinscala/EitherTests.scala | Scala | apache-2.0 | 1,160 |
/*§
===========================================================================
Chronos
===========================================================================
Copyright (C) 2015-2016 Gianluca Costa
===========================================================================
Licensed under the Apache Lic... | giancosta86/Chronos | src/main/scala/info/gianlucacosta/chronos/ast/expressions/ReferenceValue.scala | Scala | apache-2.0 | 1,191 |
package ls
import scala.language.postfixOps
abstract class Props(resource: String) {
import scala.util.control.Exception.allCatch
trait Provider {
def get(k: String): String
}
object Env extends Provider {
def get(k: String) = System.getenv(k)
}
abstract class FallbackProvider(val fallback: Pro... | softprops/ls | library/src/main/scala/props.scala | Scala | mit | 1,403 |
package slamdata.engine
import scalaz._
import scalaz.std.vector._
import scalaz.std.list._
import scalaz.std.indexedSeq._
import scalaz.std.anyVal._
import scalaz.syntax.monad._
import scalaz.std.option._
import SemanticError.{TypeError, MissingField, MissingIndex}
import NonEmptyList.nel
import Validation.{success... | sellout/slamengine-old | src/main/scala/slamdata/engine/types.scala | Scala | agpl-3.0 | 15,979 |
package embed.randP
import com.tencent.angel.worker.task.{BaseTask, TaskContext}
import org.apache.commons.logging.LogFactory
import org.apache.hadoop.io.{LongWritable, Text}
import scala.collection.mutable.ArrayBuffer
/**
* Created by chris on 9/19/17.
*/
class RTrainTask(val ctx:TaskContext) extends BaseTask[L... | LiteML/EmbedLib | src/main/scala/embed/randP/RTrainTask.scala | Scala | apache-2.0 | 1,353 |
package com.twitter.finagle.serverset2
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FunSuite
@RunWith(classOf[JUnitRunner])
class ServiceDiscovererTest extends FunSuite {
def ep(port: Int) = Endpoint(Array(null), "localhost", port, Int.MinValue, Endpoint.Status.Alive, ... | kingtang/finagle | finagle-serversets/src/test/scala/com/twitter/finagle/serverset2/ServiceDiscovererTest.scala | Scala | apache-2.0 | 971 |
/**
* 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... | crashlytics/kafka | core/src/main/scala/kafka/api/LeaderAndIsrRequest.scala | Scala | apache-2.0 | 7,967 |
class C {
class W
def getZ(w: W): Int = 123
def getZ(s: String): String = "text"
}
class A(f: C) {
private val w = new f.W
/*start*/f.getZ(w)/*end*/
}
//Int | ilinum/intellij-scala | testdata/typeInference/dependent/PrivateClassParameter.scala | Scala | apache-2.0 | 168 |
package controllers
import play.api.mvc.{Controller, Action}
import play.api.data.Form
import play.api.data.Forms._
import play.api.libs.json.Json
import models.Member
import models.CustomData
object ApiController extends Controller {
def exist(category: String, name: String) = Action {
val x = category match ... | mahata/webnikki | src/app/controllers/ApiController.scala | Scala | mit | 2,788 |
/*
* 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 | streaming/src/main/scala/org/apache/spark/streaming/api/python/PythonDStream.scala | Scala | apache-2.0 | 12,991 |
package utils.pageobjects.tests
import org.specs2.mutable._
import utils.WithApplication
import utils.pageobjects.{PageObjectsContext, CircumstancesPageFactory, UnknownPage, ClaimPageFactory}
import utils.pageobjects.s_eligibility.GBenefitsPage
import utils.pageobjects.circumstances.start_of_process.GCircsYourDetailsP... | Department-for-Work-and-Pensions/ClaimCapture | c3/test/utils/pageobjects/tests/PageFactorySpec.scala | Scala | mit | 1,385 |
object main extends App {
/*
* Sealed classes:
* A sealed class cannot have any new subclasses added
* expect the ones defined in the same file.
*
*/
sealed abstract class Expr
case class Var(name: String) extends Expr
case class Number(num: Double) extends Expr
case class UnOp(operator: Strin... | arcyfelix/Courses | 18-10-18-Programming-in-Scala-by-Martin-Odersky-Lex-Spoon-and-Bill-Venners/43-SealedClasses/src/main.scala | Scala | apache-2.0 | 952 |
package models.user
import play.api.libs.json._
import play.api.libs.functional.syntax._
import reactivemongo.bson._
import services.dao.UtilBson
case class ProviderUser(
id: String,
socialType: String,
token:Option[SkimboToken],
username: Option[String] = None,
name: Option[String] = None,
description: O... | Froggies/Skimbo | app/models/user/ProviderUser.scala | Scala | agpl-3.0 | 1,206 |
// Code generated by sbt-mavgen. Manual edits will be overwritten
package scavlink.message.enums
/**
* Navigation filter mode
*/
object UalbertaNavMode extends Enumeration {
val _UNKNOWN = Value(0)
val AHRS_INIT = Value(1)
/**
* AHRS mode
*/
val AHRS = Value(2)
/**
* INS/GPS initialization mode
... | nickolasrossi/scavlink | src/main/scala/scavlink/message/enums/UalbertaNavMode.scala | Scala | mit | 411 |
package inloopio.math.algebra
/**
* The basic interface including numerous convenience functions <p/> NOTE: All implementing classes must have a
* constructor that takes an int for cardinality and a no-arg constructor that can be used for marshalling the Writable
* instance <p/> NOTE: Implementations may choose to ... | dcaoyuan/inloopio-libs | inloopio-math/src/main/scala/inloopio/math/algebra/Vector.scala | Scala | bsd-3-clause | 12,352 |
/**
* 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... | mailgun/kafka-http | project/Build.scala | Scala | apache-2.0 | 5,288 |
package com.warningrc.test.scalatest
package spark {
package navigation {
private[spark] class Navigator {
protected[navigation] def useStarChart(): Unit = {
}
class LegOfJourney {
private[Navigator] val distance = 100
}
private[t... | warningrc/learn-java | scala-test/src/test/scala/com/warningrc/test/scalatest/ScalaPackageAdvanced.scala | Scala | apache-2.0 | 898 |
class SameBytecode {
def foo(a: Int, b: String) = 0
def foo(a: Int, b: Any) = 0
def a = foo(0, "")
def b = foo(a = 0, "")
def c = foo(0, b = "")
def d = foo(a = 0, b = "")
}
| scala/scala | test/files/jvm/named-args-in-order/SameBytecode.scala | Scala | apache-2.0 | 187 |
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
import com.intellij.psi.stubs.StubElement
import org.jetbrains.plugins.scala.lang.psi.api.base.types.ScTypeElement
import org.jetbrains.plugins.scala.lang.psi.api.base.{ScIdList, ScPatternList}
import org.jetbrains.plugins.scala.lang.psi.api.e... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/ScVariableStub.scala | Scala | apache-2.0 | 871 |
package scala.pickling.binary.`case`.`class`.int.string
import org.scalatest.FunSuite
import scala.pickling._, scala.pickling.Defaults._, binary._
import reflect.runtime.{universe => ru}
import ru._
case class Person(name: String, age: Int)
class BinaryCaseClassIntStringTest extends FunSuite {
test("main") {
v... | phaller/pickling | core/src/test/scala/pickling/run/binary-case-class-int-string.scala | Scala | bsd-3-clause | 711 |
/*
* 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 ... | pgandhi999/spark | core/src/test/scala/org/apache/spark/util/SizeEstimatorSuite.scala | Scala | apache-2.0 | 9,565 |
package org.jetbrains.plugins.scala
package script
import com.intellij.execution.configurations.{RunConfiguration, ConfigurationType, ConfigurationFactory}
import com.intellij.openapi.project.Project
import javax.swing.Icon
import java.lang.String
import config.ScalaFacet
/**
* User: Alexander Podkhalyuzin
* Date:... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/script/ScalaScriptRunConfigurationFactory.scala | Scala | apache-2.0 | 1,081 |
package org.jetbrains.plugins.scala
package lang
package refactoring
import com.intellij.lang.refactoring.RefactoringSupportProvider
import com.intellij.psi.PsiElement
import com.intellij.refactoring.RefactoringActionHandler
import com.intellij.refactoring.changeSignature.ChangeSignatureHandler
import org.jetbrains.p... | triggerNZ/intellij-scala | src/org/jetbrains/plugins/scala/lang/refactoring/ScalaRefactoringSupportProvider.scala | Scala | apache-2.0 | 2,167 |
package io.getquill.context.sql.norm
import io.getquill.ast._
object ExpandMappedInfix {
def apply(q: Ast): Ast = {
Transform(q) {
case Map(Infix("" :: parts, (q: Query) :: params, pure, quat), x, p) =>
Infix("" :: parts, Map(q, x, p) :: params, pure, quat)
}
}
}
| getquill/quill | quill-sql-portable/src/main/scala/io/getquill/sql/norm/ExpandMappedInfix.scala | Scala | apache-2.0 | 292 |
import io.floyd.events.EventsActor
import akka.testkit.TestActorRef
class TestEventsActor extends BaseUnitTestActor {
"EventsActor" should "increment value when create a child actor" in {
val actorRef = TestActorRef[EventsActor]
val actor = actorRef.underlyingActor
actorRef ! self
actor.nextValue.n... | floyd-io/floyd-scala | src/test/scala/events/TestEventsActor.scala | Scala | lgpl-3.0 | 648 |
/*
* 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
* distribute... | xerial/silk | silk-frame/src/main/scala/xerial/silk/frame/weaver/SQLiteWeaver.scala | Scala | apache-2.0 | 1,327 |
package moe.pizza.eveapi.endpoints
import moe.pizza.eveapi.generated.corp
import moe.pizza.eveapi._
import org.http4s.client.Client
class Corp(baseurl: String, apikey: Option[XmlApiKey])(implicit c: Client) {
def AccountBalance() =
new ApiRequest[corp.AccountBalance.Eveapi](baseurl, "corp/AccountBalance.xml.asp... | xxpizzaxx/pizza-eveapi | src/main/scala/moe/pizza/eveapi/endpoints/Corp.scala | Scala | mit | 935 |
package rere.ql.queries
import org.scalatest.FlatSpec
import rere.ql.types._
class DatabaseQueriesTest extends FlatSpec with ReqlMatchers {
import rere.ql.queries.all.r
import rere.ql.queries.db._
import rere.ql.queries.math._
import rere.ql.queries.values._
behavior of "DatabaseQueries"
it should "pro... | pbaun/rere | modules/ql/src/test/scala/rere/ql/queries/DatabaseQueriesTest.scala | Scala | apache-2.0 | 1,264 |
package akka.persistence.pg.journal
import java.util.concurrent.TimeUnit
import akka.actor.{ActorRef, ActorSystem, Status}
import akka.persistence.pg.PluginConfig
import akka.persistence.pg.journal.StoreActor.{Store, StoreSuccess}
import akka.pattern.ask
import akka.util.Timeout
import scala.concurrent.{ExecutionCo... | kwark/akka-persistence-postgresql | modules/akka-persistence-pg/src/main/scala/akka/persistence/pg/journal/WriteStrategy.scala | Scala | mit | 4,266 |
/**
* 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 ... | ksmpartners/ernie | ernie-engine/src/test/scala/com/ksmpartners/ernie/engine/report/MemoryReportManagerTest.scala | Scala | apache-2.0 | 10,654 |
package com.twitter.finagle.oauth2
import com.twitter.finagle.http.{HeaderMap, ParamMap}
import org.scalatest.FlatSpec
import org.scalatest.Matchers._
class ClientCredentialFetcherSpec extends FlatSpec {
it should "fetch Basic64" in {
val request = new Request.Authorization(
HeaderMap("Authorization" -> ... | finagle/finagle-oauth2 | src/test/scala/com/twitter/finagle/oauth2/ClientCredentialFetcherSpec.scala | Scala | apache-2.0 | 2,756 |
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.