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 |
|---|---|---|---|---|---|
package kornell.server.ws.rs.exception
import javax.ws.rs.core._
import javax.ws.rs.ext._
import kornell.core.error.exception.ServerErrorException
@Provider
class ServerErrorMapper extends ExceptionMapper[ServerErrorException] {
override def toResponse(see: ServerErrorException): Response = {
if (see.getCause !... | Craftware/Kornell | kornell-api/src/main/scala/kornell/server/ws/rs/exception/ServerErrorMapper.scala | Scala | apache-2.0 | 496 |
package cpup.mc.lib.inspecting
import cpup.mc.lib.network.CPupMessage
import cpup.mc.lib.util.Side
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.network.PacketBuffer
class RequestMessage(val typ: String, val id: List[Data]) extends CPupMessage[AnyRef] {
def this(player: EntityPlayer, buf: Pack... | CoderPuppy/cpup-mc | src/main/scala/cpup/mc/lib/inspecting/RequestMessage.scala | Scala | mit | 881 |
package org.openurp.edu.eams.teach.planaudit.service
import org.openurp.edu.teach.planaudit.GroupAuditResult
import org.openurp.edu.teach.plan.CourseGroup
import org.openurp.edu.teach.plan.PlanCourse
trait PlanAuditListener {
def startPlanAudit(context: PlanAuditContext): Boolean
def startGroupAudit(context: Pl... | openurp/edu-eams-webapp | core/src/main/scala/org/openurp/edu/eams/teach/planaudit/service/PlanAuditListener.scala | Scala | gpl-3.0 | 572 |
/*
* # Trove
*
* This file is part of Trove - A FREE desktop budgeting application that
* helps you track your finances, FREES you from complex budgeting, and
* enables you to build your TROVE of savings!
*
* Copyright © 2016-2019 Eric John Fredericks.
*
* Trove is free software: you can redistribute it ... | emanchgo/budgetfree | src/main/scala/trove/ui/tracking/MainAccountsView.scala | Scala | gpl-3.0 | 3,871 |
package cart
import akka.persistence.fsm.PersistentFSM
sealed trait CartState extends PersistentFSM.FSMState {
override def identifier: String = this.getClass.getName
}
case object Empty extends CartState
case object NonEmpty extends CartState
case object InCheckout extends CartState | apisarek/reactivescala-course | src/main/scala/cart/CartState.scala | Scala | mit | 291 |
package cakesolutions
import akka.actor.ActorSystem
import akka.testkit.{TestKit, TestActorRef}
import org.scalacheck._
import org.specs2.mutable.SpecificationLike
import org.specs2.ScalaCheck
class WorkerSpec extends TestKit(ActorSystem()) with SpecificationLike with ScalaCheck with Generators {
import Messages._... | carlpulley/concordance | src/test/scala/cakesolutions/WorkerSpec.scala | Scala | gpl-2.0 | 1,664 |
// scalac: -Werror -Xlint -nowarn
//
// nowarn should mean no warnings are emitted,
// irrespective of other flags, and also no
// warnings should be summarized.
//
class C {
def f = 1 → 2
def g: Unit = 1
}
| lrytz/scala | test/files/pos/t11952.scala | Scala | apache-2.0 | 213 |
package de.fosd.typechef.parser.test.parsers
import de.fosd.typechef.parser._
import de.fosd.typechef.featureexpr.{FeatureExpr, FeatureExprFactory}
import de.fosd.typechef.error.Position
class MyToken(val text: String, val feature: FeatureExpr) extends ProfilingToken {
def t() = text
def getText = text
def ge... | ckaestne/TypeChef | ParserFramework/src/test/scala/de/fosd/typechef/parser/test/parsers/MyToken.scala | Scala | lgpl-3.0 | 751 |
package chapter08
class Point(x: Double, y: Double)
class LabeledPoint(label: String, x: Double, y: Double) extends Point(x, y)
object Exercise05 {
def main(args: Array[String]) {
val point = new LabeledPoint("Black Thursday", 1929, 23007)
println(point)
}
} | paul-reiners/scala-for-the-impatient-solutions | src/main/scala/exercises/chapter08/Exercise05.scala | Scala | apache-2.0 | 273 |
/*
* 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 | external/kafka-0-10-sql/src/test/scala/org/apache/spark/sql/kafka010/KafkaRelationSuite.scala | Scala | apache-2.0 | 15,527 |
package com.arcusys.valamis.web.init.util
import com.liferay.portal.kernel.messaging.config.PluginMessagingConfigurator
import com.liferay.portal.kernel.portlet.PortletClassLoaderUtil
/**
* Created by pkornilov on 22.06.16.
*/
class CustomPluginMessagingConfigurator extends PluginMessagingConfigurator {
overri... | arcusys/Valamis | valamis-portlets-activator/src/main/scala/com/arcusys/valamis/web/init/util/CustomPluginMessagingConfigurator.scala | Scala | gpl-3.0 | 1,191 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | iesl/fuse_ttl | src/factorie-factorie_2.11-1.1/src/main/scala/cc/factorie/app/nlp/coref/Mention.scala | Scala | apache-2.0 | 16,762 |
/*
* 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/monix | monix-execution/jvm/src/test/scala/monix/execution/schedulers/AsyncSchedulerJVMSuite.scala | Scala | apache-2.0 | 5,491 |
package com.twitter.finagle.stats
/**
* BroadcastStatsReceiver is a helper object that create a StatsReceiver wrapper around multiple
* StatsReceivers (n).
*/
object BroadcastStatsReceiver {
def apply(receivers: Seq[StatsReceiver]): StatsReceiver = receivers.filterNot(_.isNull) match {
case Seq() => NullStats... | tdyas/util | util-stats/src/main/scala/com/twitter/finagle/stats/BroadcastStatsReceiver.scala | Scala | apache-2.0 | 4,202 |
package org.jetbrains.sbt.project.template.wizard.buildSystem
import org.jetbrains.sbt.project.SbtProjectSystem
import org.jetbrains.sbt.project.template.wizard.ScalaNewProjectWizardStep
final class SbtScalaNewProjectWizard extends BuildSystemScalaNewProjectWizard {
override def getName: String = SbtProjectSystem.I... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/sbt/project/template/wizard/buildSystem/SbtScalaNewProjectWizard.scala | Scala | apache-2.0 | 515 |
/*
* Copyright 2014 Dennis Vis
*
* 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... | talares/talares | src/talares/src/main/scala/org/talares/api/datatypes/items/PublishedItem.scala | Scala | apache-2.0 | 1,150 |
/*
* Copyright 2013 Josselin Pujo
*
* 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 ... | neuneu2k/assoba-template | template-maven-plugin/src/main/scala/fr/assoba/open/template/compiler/PathCompiler.scala | Scala | apache-2.0 | 1,232 |
/*
* 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 ... | WindCanDie/spark | mllib/src/main/scala/org/apache/spark/ml/feature/BucketedRandomProjectionLSH.scala | Scala | apache-2.0 | 8,645 |
package org.bfn.ninetynineprobs
import org.scalatest._
class P21Spec extends UnitSpec {
"insertAt" should "return a list with 1 element w/ an empty one and N=0" in {
assert(P21.insertAt(42, 0, List()) == List(42))
}
it should "add an element at the end if N=list.length" in {
assert(P21.insertAt(42, 3,... | bfontaine/99Scala | src/test/scala/P21Spec.scala | Scala | mit | 934 |
package org.jetbrains.plugins.scala
package lang
package psi
package api
package statements
import com.intellij.psi._
import com.intellij.psi.impl.source.PsiFileImpl
import com.intellij.psi.stubs.StubElement
import com.intellij.psi.tree.TokenSet
import org.jetbrains.plugins.scala.annotator.intention.ScalaImportTypeFix... | consulo/consulo-scala | src/org/jetbrains/plugins/scala/lang/psi/api/statements/ScAnnotationsHolder.scala | Scala | apache-2.0 | 4,061 |
package java.io
abstract class InputStream extends Closeable {
def read(): Int
def read(b: Array[Byte]): Int = read(b, 0, b.length)
def read(b: Array[Byte], off: Int, len: Int): Int = {
if (off < 0 || len < 0 || len > b.length - off)
throw new IndexOutOfBoundsException
if (len == 0) 0
else {... | cedricviaccoz/scala-native | javalib/src/main/scala/java/io/InputStream.scala | Scala | bsd-3-clause | 1,092 |
package pt.org.apec.services.users.common.json
import play.api.libs.json._
import play.api.libs.functional.syntax._
import pt.org.apec.services.users.common._
trait JsonProtocol {
implicit val userREgistrationFormat = Json.format[UserRegistration]
implicit val userCredentialsFormat = Json.format[UserCredentials]
... | ragb/apec-users-service | common/src/main/scala/pt/org/apec/services/users/common/json/JsonProtocol.scala | Scala | apache-2.0 | 2,194 |
object Test extends App{
BooleanArrayClone;
ByteArrayClone;
ShortArrayClone;
CharArrayClone;
IntArrayClone;
LongArrayClone;
FloatArrayClone;
DoubleArrayClone;
ObjectArrayClone;
PolymorphicArrayClone;
}
object BooleanArrayClone{
val it : Array[Boolean] = Array(true, false);
val cloned = it.clone... | som-snytt/dotty | tests/pending/run/arrayclone-old.scala | Scala | apache-2.0 | 2,272 |
/*
* Part of NDLA learningpath-api.
* Copyright (C) 2016 NDLA
*
* See LICENSE
*
*/
package no.ndla.learningpathapi.caching
import no.ndla.learningpathapi.UnitSuite
import org.mockito.Mockito._
class MemoizeTest extends UnitSuite {
class Target {
def targetMethod(value: String): String = s"Hei, $value"
... | NDLANO/learningpath-api | src/test/scala/no/ndla/learningpathapi/caching/MemoizeTest.scala | Scala | gpl-3.0 | 1,784 |
/*
* Sentries
* Copyright (c) 2012-2015 Erik van Oosten All rights reserved.
*
* The primary distribution site is https://github.com/erikvanoosten/sentries
*
* This software is released under the terms of the BSD 2-Clause License.
* There is NO WARRANTY. See the file LICENSE for the full text.
*/
package nl.gr... | erikvanoosten/sentries | src/main/scala/nl/grons/sentries/support/SentriesRegistry.scala | Scala | bsd-2-clause | 5,289 |
package com.pamu_nagarjuna.meetingroom.ui.commons
import android.support.v7.widget.Toolbar
import android.view.{ContextThemeWrapper, View}
import com.fortysevendeg.android.scaladays.ui.commons.ToolbarStyles
import com.fortysevendeg.macroid.extras.ResourcesExtras._
import com.pamu_nagarjuna.meetingroom.R
import macroid... | pamu/next-meeting | src/main/scala/com/pamu_nagarjuna/meetingroom/ui/commons/ToolbarLayout.scala | Scala | apache-2.0 | 1,685 |
package gitbucket.core.service
import gitbucket.core.model.Account
import gitbucket.core.util.Directory._
import gitbucket.core.util.SyntaxSugars._
import org.eclipse.jgit.merge.{MergeStrategy, Merger, RecursiveMerger}
import org.eclipse.jgit.api.{Git, MergeResult}
import org.eclipse.jgit.transport.RefSpec
import org.... | gencer/gitbucket | src/main/scala/gitbucket/core/service/MergeService.scala | Scala | apache-2.0 | 13,025 |
package text.search
/**
* @author ynupc
* Created on 2016/08/21
*/
object ApostolicoCrochemore extends Search {
override def indexOf[T](source: Array[T], target: Array[T]): Int = {
-1
}
override def indicesOf[T](source: Array[T], target: Array[T]): Array[Int] = {
Array()
}
}
| ynupc/scalastringcourseday6 | src/main/scala/text/search/ApostolicoCrochemore.scala | Scala | apache-2.0 | 308 |
package mesosphere.marathon
import mesosphere.chaos.AppConfiguration
import mesosphere.chaos.http.HttpConf
import mesosphere.marathon.core.event.EventConf
import mesosphere.marathon.core.plugin.PluginManagerConfiguration
import mesosphere.marathon.metrics.MetricsReporterConf
import org.rogach.scallop.ScallopConf
clas... | natemurthy/marathon | src/main/scala/mesosphere/marathon/AllConf.scala | Scala | apache-2.0 | 763 |
package org.sisioh.aws4s.dynamodb.document
import com.amazonaws.services.dynamodbv2.document.Attribute
import org.sisioh.aws4s.PimpedType
object AttributeFactory {
def create(attrName: String, value: AnyRef): Attribute = new Attribute(attrName, value)
}
class RichAttribute(val underlying: Attribute) extends AnyV... | everpeace/aws4s | aws4s-dynamodb/src/main/scala/org/sisioh/aws4s/dynamodb/document/RichAttribute.scala | Scala | mit | 439 |
/*
* 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.
*/
package org.scalajs.testsuite.javalib.lang
im... | gzm0/scala-js | test-suite/shared/src/test/scala/org/scalajs/testsuite/javalib/lang/ByteTest.scala | Scala | apache-2.0 | 3,126 |
package funsets
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
/**
* This class is a test suite for the methods in object FunSets. To run
* the test suite, you can either:
* - run the "test" command in the SBT console
* - right-click the file in eclipse and... | mmcc007/scala-principles | funsets/src/test/scala/funsets/FunSetSuite.scala | Scala | gpl-3.0 | 5,221 |
package org.jetbrains.plugins.scala
package lang.parser.parsing.patterns
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.CommonUtils
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
/**
* @author kfeodorov
* @since 01... | whorbowicz/intellij-scala | src/org/jetbrains/plugins/scala/lang/parser/parsing/patterns/InterpolationPattern.scala | Scala | apache-2.0 | 766 |
package com.timeout.docless.schema.derive
import com.timeout.docless.schema._
import JsonSchema._
import shapeless._
import io.circe._
import io.circe.syntax._
import shapeless.labelled.FieldType
import reflect.runtime.{universe => ru}
trait HListInstances {
implicit val hNilSchema: JsonSchema[HNil] = inlineInstanc... | timeoutdigital/docless | src/main/scala/com/timeout/docless/schema/derive/HListInstances.scala | Scala | mit | 1,560 |
package exercises
object Exercise22 {
def isSorted[A](as: Array[A], ordering: (A, A) => Boolean): Boolean = {
@annotation.tailrec
def go(n: Int): Boolean =
if (n >= as.length - 1) true
else if (!ordering(as(n), as(n + 1))) false
else go(n + 1)
go(0)
}
}
| tobal/scala-course | red-book/src/main/scala/exercises/Exercise22.scala | Scala | gpl-3.0 | 291 |
object Test extends App {
val x: Option[Int] = Macros.foo
println(x)
}
| lrytz/scala | test/files/run/t8048a/Test_2.scala | Scala | apache-2.0 | 75 |
package com.github.tminglei.bind
import org.scalatest._
import scala.collection.mutable.ListBuffer
class ProcessorsSpec extends FunSpec with Matchers {
describe("test pre-defined pre-processors") {
it("trim") {
val trim = Processors.trim
trim("", Map("" -> null), Options.apply()) should be (Map(""... | tminglei/form-binder | src/test/scala/com/github/tminglei/bind/ProcessorsSpec.scala | Scala | bsd-2-clause | 6,704 |
/*
* 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.async
package ru... | scala/async | src/test/scala/scala/async/run/ifelse3/IfElse3.scala | Scala | bsd-3-clause | 1,135 |
package inloopio.math.vector
/**
*
* @author Caoyuan Deng
*/
class TInputOutputPoint protected (_input: Vec, _output: Vec, val time: Long) extends InputOutputPoint(_input, _output)
object TInputOutputPoint {
def apply(input: Vec, output: Vec, time: Long) =
new TInputOutputPoint(input, output, time)
def app... | dcaoyuan/inloopio-libs | inloopio-math/src/main/scala/inloopio/math/vector/TInputOutputPoint.scala | Scala | bsd-3-clause | 584 |
/***********************************************************************
* Copyright (c) 2013-2022 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... | locationtech/geomesa | geomesa-index-api/src/test/scala/org/locationtech/geomesa/index/stats/MetadataBackedStatsTest.scala | Scala | apache-2.0 | 1,876 |
/*
* Copyright (C) 2011 Mathieu Mathieu Leclaire <mathieu.Mathieu Leclaire at openmole.org>
*
* 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
* (... | openmole/openmole | openmole/plugins/org.openmole.plugin.task.template/src/test/scala/org/openmole/plugin/task/template/TemplateFileTaskSpec.scala | Scala | agpl-3.0 | 1,931 |
package de.thomasvolk.easy.core
/*
* Copyright 2014 Thomas Volk
*
* 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
... | thomasvolk/easy | core/src/test/scala/de/thomasvolk/easy/core/PagePersistenceServiceTest.scala | Scala | apache-2.0 | 5,005 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundatio... | HuangLS/neo4j | community/cypher/cypher-compiler-2.3/src/main/scala/org/neo4j/cypher/internal/compiler/v2_3/pipes/ExpandIntoPipe.scala | Scala | apache-2.0 | 8,184 |
package im.actor.server.user
import akka.pattern.ask
import akka.util.Timeout
import im.actor.api.rpc.messaging.{ Message ⇒ ApiMessage }
import im.actor.api.rpc.peers.Peer
import im.actor.api.rpc.users.{ Sex, User ⇒ ApiUser }
import im.actor.api.rpc.{ AuthorizedClientData, Update }
import im.actor.server.file.Avatar
i... | dsaved/africhat-platform-0.1 | actor-server/actor-core/src/main/scala/im/actor/server/user/UserOffice.scala | Scala | mit | 12,820 |
/*
* Copyright 2017-2020 47 Degrees Open Source <https://www.47deg.com>
*
* 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 ... | frees-io/freestyle-rpc | modules/config/src/main/scala/higherkindness/mu/rpc/config/ConfigM.scala | Scala | apache-2.0 | 755 |
package com.airbnb.aerosolve.training
import java.io.{BufferedWriter, OutputStreamWriter}
import java.util.concurrent.ConcurrentHashMap
import com.airbnb.aerosolve.core.util.Util
import com.airbnb.aerosolve.core.models.MaxoutModel
import com.airbnb.aerosolve.core.{Example, FeatureVector}
import com.typesafe.config.Co... | aglne/aerosolve | training/src/main/scala/com/airbnb/aerosolve/training/MaxoutTrainer.scala | Scala | apache-2.0 | 9,217 |
package com.pragmaxim.scalajs.dom
import org.scalajs.dom
import org.scalajs.dom.KeyboardEvent
import scala.scalajs.js
import scala.scalajs.js.UndefOr
object KeyboardPolyfill {
/**
* Primarily it allows you to abandon onpress events that have cross-browser incompatible behavior and
* that are to be deprecate... | viagraphs/scalajs-keyboard-polyfill | src/main/scala/com/pragmaxim/scalajs/dom/Keyboard.scala | Scala | mit | 9,071 |
/*
* Copyright 2019 ABSA Group Limited
*
* 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... | AbsaOSS/spline | consumer-services/src/main/scala/za/co/absa/spline/consumer/service/repo/LabelRepository.scala | Scala | apache-2.0 | 1,051 |
package levar.data
import levar.Experiment
import levar.Prediction
import levar.Dataset.{ DatasetType, ClassificationType, RegressionType }
class TabularExperiment(dtype: DatasetType, name: String, idCol: Int, predCol: Int, arrays: Iterator[Array[String]]) {
require(idCol >= 0)
require(predCol >= 0)
require(idC... | peoplepattern/LeVar | levar-cli/src/main/scala/levar/data/TabularExperiment.scala | Scala | apache-2.0 | 594 |
package uk.co.seansaville.ninetyninescalaprobs.lists
import uk.co.seansaville.ninetyninescalaprobs.UnitSpec
class Problem5Spec extends UnitSpec {
"reverse" should "reverse any list" in {
assert(Problem5.reverse(List(1, 2, 3)) == List(3, 2, 1))
assert(Problem5.reverse(List(1)) == List(1))
assert(Problem... | seansaville/99scalaprobs | src/test/scala/uk/co/seansaville/ninetyninescalaprobs/lists/Problem5Spec.scala | Scala | mit | 356 |
package doobie.util
import scala.collection.generic.CanBuildFrom
import doobie.imports._
import doobie.util.analysis.Analysis
import scalaz.{ MonadPlus, Profunctor, Contravariant, Functor }
import scalaz.stream.Process
import scalaz.syntax.monad._
/** Module defining queries parameterized by input and output types.... | jamescway/doobie | core/src/main/scala/doobie/util/query.scala | Scala | mit | 9,473 |
object Whatever {
override def equals(x: Any) = true
}
object Test extends dotty.runtime.LegacyApp {
// this should make it abundantly clear Any is the best return type we can guarantee
def matchWhatever(x: Any): Any = x match { case n @ Whatever => n }
// when left to its own devices, and not under -Xfuture, ... | yusuke2255/dotty | tests/pending/run/t1503.scala | Scala | bsd-3-clause | 641 |
package spire.math.prime
import spire.implicits._
import org.scalatest.FunSuite
import spire.math.SafeLong
class PrimeTest extends FunSuite {
val largePrime = SafeLong("393050634124102232869567034555427371542904833")
val largeNonPrime = largePrime + 4
val tenPrimes = IndexedSeq(2, 3, 5, 7, 11, 13, 17, 19, 23, ... | guersam/spire | tests/src/test/scala/spire/math/prime/PrimeTest.scala | Scala | mit | 1,342 |
package org.jetbrains.plugins.scala.lang.psi
package stubs
package index
import com.intellij.psi.stubs.StubIndexKey
import org.jetbrains.plugins.scala.lang.psi.api.statements.ScFunction
/**
* User: Alexander Podkhalyuzin
* Date: 14.10.2008
*/
class ScFunctionNameIndex extends ScStringStubIndexExtension[ScFuncti... | loskutov/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/stubs/index/ScFunctionNameIndex.scala | Scala | apache-2.0 | 422 |
/*
* Copyright (c) 2012, The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, me... | iontorrent/Torrent-Variant-Caller-stable | public/scala/src/org/broadinstitute/sting/queue/function/InProcessFunction.scala | Scala | mit | 1,558 |
package tables
import models.Item
import play.api.db.slick.Config.driver.simple._
// An Item table with 4 columns: id, name, price, stock
class ItemsTable(tag: Tag) extends Table[Item](tag, "ITEMS") {
// This is the primary key column:
def id = column[Int]("ITEM_ID", O.PrimaryKey)
def name = column[String]("... | SofyanHadiA/simple-rest-scala | app/tables/ItemsTable.scala | Scala | mit | 471 |
package org.scaladebugger.api.profiles.traits.info.events
import com.sun.jdi._
import com.sun.jdi.event._
import org.scaladebugger.api.lowlevel.JDIArgument
import org.scaladebugger.api.profiles.traits.info.{InfoProducer, JavaInfo}
import org.scaladebugger.api.virtualmachines.ScalaVirtualMachine
/**
* Represents the ... | ensime/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/profiles/traits/info/events/EventInfoProducer.scala | Scala | apache-2.0 | 22,061 |
package rs.fon.kvizic.networkAnalysis.algorithm.clans
import rs.fon.kvizic.networkAnalysis.Actor
class Clique {
def isA(actors: List[Actor]): Boolean = {
val connected: List[Boolean] = for (actor <- actors; connects <- actors)
yield (actor == connects) || actor.getAllEndActors.contains(connects);
connected.... | dpavkov/network-analysis-metrics | src/main/scala/rs/fon/kvizic/networkAnalysis/algorithm/clans/Clique.scala | Scala | mit | 373 |
package chandu0101.scalajs.react.components.reactslick
import chandu0101.macros.tojs.JSMacro
import japgolly.scalajs.react._
import scala.scalajs.js
case class ReactSlick (
/* Additional class name for the inner slider div */
className: js.UndefOr[Int] = js.undefined,
/* Adjust the slide's height automat... | elacin/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/reactslick/ReactSlick.scala | Scala | apache-2.0 | 3,293 |
package model.slick.nsi
import slick.jdbc.PostgresProfile.api._
class RamActivities(tag: Tag) extends Table[(Int, String, Option[String], String, Boolean)](tag, "ramActivities") {
def activityID: Rep[Int] = column[Int]("activityID", O.PrimaryKey) // This is the primary key column
def activityName: Rep[String]... | apantin/scala.js.test | server/app/model/slick/nsi/RamActivities.scala | Scala | apache-2.0 | 716 |
/*
* 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 ... | bwsw/sj-platform | core/sj-crud-rest/src/test/scala-2.12/com/bwsw/sj/crud/rest/instance/destroyer/InstanceDestroyerTestSuit.scala | Scala | apache-2.0 | 7,352 |
package doobie.syntax
import scalaz._, Scalaz._
import doobie.imports._
import shapeless.test.illTyped
import org.specs2.mutable.Specification
object catchsqlspec extends Specification {
"catchsql syntax" should {
"work on aliased IConnection" in {
42.point[ConnectionIO].attemptSql
true
}
... | coltfred/doobie | core/src/test/scala/doobie/syntax/catchsql.scala | Scala | mit | 433 |
import net.mentalarray.doozie.Builders.WorkflowBuilder
import net.mentalarray.doozie.DBStore.JDBCConnection
import net.mentalarray.doozie.Logging
import net.mentalarray.doozie.Tasks.ScalaTask
/**
* Created by bgilcrease on 10/14/14.
*/
class TechnodeLookup extends WorkflowBuilder("TechnodeLookup") with Logging {
... | antagonist112358/tomahawk | examples/TechnodeLookupWorkflow.scala | Scala | apache-2.0 | 1,192 |
package im.actor.server.frontend
import java.net.InetAddress
import akka.stream.FlowShape
import kamon.metric.instrument.{ MinMaxCounter, Histogram }
import scala.util.{ Failure, Success }
import akka.actor._
import akka.stream.actor.ActorPublisher
import akka.stream.scaladsl._
import akka.util.ByteString
import i... | ljshj/actor-platform | actor-server/actor-frontend/src/main/scala/im/actor/server/frontend/MTProtoBlueprint.scala | Scala | mit | 3,346 |
package chandu0101.scalajs.react.components.materialui
import japgolly.scalajs.react._
import materialui.Mui
import scala.scalajs.js
import scala.scalajs.js.{Date => JDate}
/**
*
key: PropTypes.string,
style: PropTypes.js.Any,
ref: PropTypes.String,
hintText: PropTypes.String,
defaultDate: React.Pr... | coreyauger/scalajs-react-components | core/src/main/scala/chandu0101/scalajs/react/components/materialui/MuiDatePicker.scala | Scala | apache-2.0 | 3,694 |
trait Universe {
type Symbol >: Null <: AnyRef with SymbolApi
trait SymbolApi
type TypeSymbol >: Null <: TypeSymbolApi with Symbol
trait TypeSymbolApi
implicit class CompatibleSymbol(sym: Symbol) {
def asFreeType: TypeSymbol = ???
}
}
object Test extends App {
val u: Universe = ???
import u.*
... | dotty-staging/dotty | tests/pos/t8301.scala | Scala | apache-2.0 | 361 |
package patchless.circe.extras
import cats.syntax.either._
import io.circe.generic.extras.Configuration
import io.circe.generic.extras.auto._
import io.circe.parser.parse
import org.scalatest.{FreeSpec, Matchers}
import patchless.Patch
import shapeless.record.Record
class ConfigurablePatchJsonSpec extends FreeSpec wi... | jeremyrsmith/patchless | patchless-circe/src/test/scala/patchless/circe/extras/ConfigurablePatchJsonSpec.scala | Scala | apache-2.0 | 2,327 |
package doobie.contrib.postgresql
import doobie.imports._
import doobie.contrib.postgresql.pgtypes._
import java.net.InetAddress
import java.util.UUID
import java.util.concurrent.atomic.AtomicInteger
import org.postgis._
import org.postgresql.util._
import org.postgresql.geometric._
import org.specs2.mutable.Specifi... | jamescway/doobie | contrib/postgresql/src/test/scala/doobie/contrib/postgresql/pgtypes.scala | Scala | mit | 6,885 |
/*
* 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 ... | Panos-Bletsos/spark-cost-model-optimizer | mllib/src/test/scala/org/apache/spark/ml/regression/IsotonicRegressionSuite.scala | Scala | apache-2.0 | 6,750 |
package kafka.console
package object app extends Container with Data
| shnapz/service | core/src/main/scala/kafka/console/app/package.scala | Scala | apache-2.0 | 70 |
package net.nikore.etcd.apis
import akka.actor.ActorRefFactory
import net.nikore.etcd.EtcdJsonProtocol._
import spray.client.pipelining._
import spray.http.StatusCodes.ClientError
import spray.http._
import spray.httpx.SprayJsonSupport._
import scala.concurrent.Future
/**
* Defines a API mix-in trait for the EtcD ... | LiamHaworth/scala-etcd | src/main/scala/net/nikore/etcd/apis/MembersAPI.scala | Scala | apache-2.0 | 4,333 |
package org.odfi.indesign.module.inative.cmake
import org.odfi.indesign.core.harvest.Harvester
import org.odfi.indesign.core.harvest.fs.HarvestedFile
import java.io.File
class CMakeProjectHarvester extends Harvester {
this.onDeliverFor[HarvestedFile] {
case folder if (folder.isDirectory && new File(... | opendesignflow/indesign | indesign-native/src/main/scala/org/odfi/indesign/module/inative/cmake/CMakeProject.scala | Scala | gpl-3.0 | 527 |
/*
* Copyright 2014 Lars Edenbrandt
*
* 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... | slicebox/slicebox | src/main/scala/se/nimsa/sbx/app/routing/UserRoutes.scala | Scala | apache-2.0 | 4,650 |
/*
* Copyright 2013 Akiyoshi Sugiki, University of Tsukuba
*
* 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 a... | axi-sugiki/kumoi | src/kumoi/core/mr/DWorker.scala | Scala | apache-2.0 | 10,246 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.core.server
/**
* Indicates an issue with starting a server, e.g. a problem reading its
* configuration.
*/
final case class ServerStartException(message: String, cause: Option[Throwable] = None)
extends Exception(message, cause.or... | benmccann/playframework | transport/server/play-server/src/main/scala/play/core/server/ServerStartException.scala | Scala | apache-2.0 | 326 |
/*
* 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-core/src/main/scala/com/spotify/scio/schemas/instances/AllInstances.scala | Scala | apache-2.0 | 796 |
package models.base
import scalaz._
import Scalaz._
import scalaz.effect.IO
import scalaz.EitherT._
import scalaz.Validation
import scalaz.Validation.FlatMap._
import scalaz.NonEmptyList._
import cache._
import db._
import io.megam.auth.funnel.FunnelErrors._
import controllers.Constants._
import io.megam.common.uid.... | indykish/vertice_gateway | app/models/base/MasterKeys.scala | Scala | mit | 4,183 |
package autoproxy
import org.scalatest.FunSuite
class ParamDelegationSpec extends FunSuite {
test("can delegate to a raw parameter") {
@delegating class RawParamWrapper(@proxy pivot : Bippy)
val wrapper = new RawParamWrapper(SimpleBippy)
assert(wrapper.bippy(42) === "42")
}
test("can delegate to... | thecoda/autoproxy | core/src/test/scala/autoproxy/ParamDelegationSpec.scala | Scala | apache-2.0 | 2,660 |
/*
* @author Philip Stutz
* @author Sara Magliacane
*
* Copyright 2014 University of Zurich & VU University Amsterdam
*
* 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
*
* ... | uzh/fox | src/test/scala/com/signalcollect/psl/model/GroundedConstraintSpec.scala | Scala | apache-2.0 | 5,576 |
package org.jetbrains.plugins.scala
package lang
package psi
package types
import org.jetbrains.plugins.scala.lang.psi.types.api.{TypeSystem, TypeVisitor, ValueType}
import org.jetbrains.plugins.scala.lang.refactoring.util.ScTypeUtil.AliasType
import org.jetbrains.plugins.scala.project.ProjectContextOwner
import scal... | ilinum/intellij-scala | src/org/jetbrains/plugins/scala/lang/psi/types/ScType.scala | Scala | apache-2.0 | 3,968 |
/*
* Copyright (c) 2012-2014 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.... | 1974kpkpkp/snowplow | 3-enrich/scala-common-enrich/project/SnowplowCommonEnrichBuild.scala | Scala | apache-2.0 | 2,030 |
package com.atomist.project.archive
import com.atomist.project.edit.ProjectEditor
import com.atomist.project.generate.ProjectGenerator
import com.atomist.rug.runtime._
/**
* Convenience wrapper to hold the different Rug types
*/
object Rugs {
def Empty: Rugs = {
new Rugs(Nil, Nil, Nil, Nil, Nil)
}
}
cas... | atomist/rug | src/main/scala/com/atomist/project/archive/Rugs.scala | Scala | gpl-3.0 | 2,063 |
package example
import diode._
import scalatags.JsDom.all._
class TreeView(root: ModelRO[FileNode], parent: Seq[String], selection: ModelRO[Seq[String]], dispatcher: Dispatcher) {
val id = root().id
val path = parent :+ id
val childSeq = build
// recursively build the tree view
def build = {
... | ochrons/diode | examples/treeview/src/main/scala/example/TreeView.scala | Scala | mit | 996 |
/**
* Copyright (c) 2002-2012 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundati... | dksaputra/community | cypher/src/main/scala/org/neo4j/cypher/internal/executionplan/builders/TrailBuilder.scala | Scala | gpl-3.0 | 4,593 |
package com.nidkil.downloader.actor
import scala.concurrent.Future
import akka.actor.ActorLogging
import akka.actor.ActorRef
import akka.actor.ActorNotFound
import scala.util.{Failure, Success}
class ShutdownReaper(controller: ActorRef = null) extends Reaper with ActorLogging {
def allSoulsReaped() {
log.info(... | nidkil/akka-downloader | src/main/scala/com/nidkil/downloader/actor/ShutdownReaper.scala | Scala | apache-2.0 | 454 |
package org.template.recommendation
import io.prediction.controller.LServing
import scala.io.Source
import io.prediction.controller.Params // ADDED
// ADDED ServingParams to specify the blacklisting file location.
case class ServingParams(filepath: String) extends Params
class Serving(val params: ServingParams)
... | wenaz/PredictionIO | examples/scala-parallel-recommendation/custom-serving/src/main/scala/Serving.scala | Scala | apache-2.0 | 709 |
/*
* 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... | wvlet/airframe | airframe-http/.js/src/test/scala/wvlet/airframe/http/js/JSHttpClientTest.scala | Scala | apache-2.0 | 2,478 |
package modules
import java.io.InputStreamReader
import java.nio.charset.StandardCharsets
import java.nio.file.{Files, Paths}
import java.util.zip.ZipInputStream
import scala.collection.JavaConverters._
import scala.util.{Failure, Success, Try}
import scala.util.control.NonFatal
import resource._
import play.api.inj... | haruko-devs/haruko | app/modules/VerificationModule.scala | Scala | mit | 3,649 |
package io.buoyant.linkerd
import com.twitter.conversions.time._
import com.twitter.finagle.buoyant.DstBindingFactory
import com.twitter.finagle.naming.NameInterpreter
import com.twitter.finagle.param.Label
import com.twitter.finagle.stats.{BroadcastStatsReceiver, LoadedStatsReceiver}
import com.twitter.finagle.tracin... | hhtpcd/linkerd | linkerd/core/src/main/scala/io/buoyant/linkerd/Linker.scala | Scala | apache-2.0 | 7,649 |
package org.jetbrains.plugins.scala
package refactoring.extractMethod
/**
* Nikolay.Tropin
* 2014-05-20
*/
class ScalaExtractMethodInnerClass extends ScalaExtractMethodTestBase {
override def folderPath: String = super.folderPath + "innerClass/"
def testNoReturnSeveralOutput() = doTest()
def testReturnSever... | triggerNZ/intellij-scala | test/org/jetbrains/plugins/scala/refactoring/extractMethod/ScalaExtractMethodInnerClass.scala | Scala | apache-2.0 | 488 |
/*
* 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 ... | aokolnychyi/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/TypedFilterOptimizationSuite.scala | Scala | apache-2.0 | 4,104 |
/*
* Copyright (C) 2016 Vincibean <Andre Bessi>
*
* 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, either version 3 of the License, or
* (at your option) any later version.
*
* This... | Vincibean/ScalaForTheImpatient-Solutions | src/main/scala/org/vincibean/scala/impatient/chapter5/exercise3/Time.scala | Scala | gpl-3.0 | 1,358 |
package uk.gov.gds.common.mongo
import com.mongodb.WriteConcern
import uk.gov.gds.common.audit.TestAuditEventRepository
import com.mongodb.casbah.MongoDB
import com.mongodb.Bytes
object UnauthenticatedMongoDatabaseManagerForTests extends MongoDatabaseManager {
database.setWriteConcern(WriteConcern.MAJORITY)
data... | alphagov/gds-scala-common | mongo-utils/src/test/scala/uk/gov/gds/common/mongo/UnauthenticatedMongoDatabaseManagerForTests.scala | Scala | mit | 618 |
package com.vivint.ceph.model
import org.scalatest.{FunSpec, Matchers}
import play.api.libs.json._
class PlayJsonFormatsTest extends FunSpec with Matchers {
import PlayJsonFormats._
describe("LocationFormat") {
it("it goes in and out properly") {
Json.toJson(Location.empty).as[Location] shouldBe Locatio... | vivint-smarthome/ceph-on-mesos | src/test/scala/com/vivint/ceph/model/PlayJsonFormatsTest.scala | Scala | apache-2.0 | 766 |
/*
* 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.tools.nsc
packag... | lrytz/scala | src/compiler/scala/tools/nsc/typechecker/MethodSynthesis.scala | Scala | apache-2.0 | 13,048 |
package thesis.orderings
import thesis.matrixTypes._
import thesis.utils._
import thesis.rectangles._
abstract class Move {
def apply(m: MatrixMoves):ReverseMove
}
/**
* Object containing the different moves that can be used
*/
object Move {
/** Swap move
* Selects two random rows a and b such that b - a < 10 ... | GLeurquin/Faithful-visualization-of-categorical-datasets | src/main/scala/Orderings/Move.scala | Scala | mit | 4,466 |
/*
* Copyright 2008-present MongoDB, 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 ag... | rozza/mongo-java-driver | driver-scala/src/main/scala/org/mongodb/scala/internal/UnitObservable.scala | Scala | apache-2.0 | 953 |
/*
* Copyright (c) 2011, Daniel Spiewak
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of cond... | djspiewak/anti-xml | src/test/scala/com/codecommit/antixml/performance/XmlCounts.scala | Scala | bsd-3-clause | 3,011 |
package value_class_override_no_spec
// There are two versions of this tests: one with and one without specialization.
// The bug was only exposed *without* specialization.
trait T extends Any {
def x: Any
}
final class StringOps(val repr0: String) extends AnyVal with T {
def x = ()
}
| yusuke2255/dotty | tests/pos/valueclasses/value-class-override-no-spec.scala | Scala | bsd-3-clause | 292 |
/* sbt -- Simple Build Tool
* Copyright 2009, 2010 Mark Harrah
*/
package xsbt.boot
import java.io.File
// <boot.directory>
// [<scala-org>.]scala-<scala.version>/ [baseDirectoryName]
// lib/ [ScalaDirectoryName]
// <app.name>-<app.version>/ [appDirectoryName]
//
// see also ProjectP... | olove/xsbt | launch/src/main/scala/xsbt/boot/BootConfiguration.scala | Scala | bsd-3-clause | 4,313 |
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.