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 spotlight.publish
import scala.annotation.tailrec
import scala.concurrent.duration.FiniteDuration
import akka.actor.ActorLogging
import akka.stream.actor.{ ActorSubscriber, MaxInFlightRequestStrategy, RequestStrategy }
import org.joda.{ time ⇒ joda }
import omnibus.akka.metrics.InstrumentedActor
import spotlig... | dmrolfs/lineup | core/src/main/scala/spotlight/publish/OutlierPublisher.scala | Scala | mit | 2,391 |
package co.blocke.scalajack
package delimited
case class AllPrim(i: Int, l: Long, d: Double, f: Float, c: Char, s: String, b: Boolean, bi: BigInt, bd: BigDecimal)
case class Inside(id: Int, desc: String)
case class Nested(thing: String, in: Inside, other: Inside = Inside(99, "dunno"))
case class ThreeStrings(a: Stri... | gzoller/ScalaJack | core/src/test/scala/co.blocke.scalajack/delimited/Model.scala | Scala | mit | 1,389 |
package special.collection
import scalan.{NeverInline, Internal}
class MonoidBuilderInst extends MonoidBuilder {
val intPlusMonoid = new IntPlusMonoid(0)
val longPlusMonoid = new LongPlusMonoid(0L)
@Internal
val intMaxMonoid = new IntMaxMonoid(0x80000000) // Int.MinValue cannot be used due to virtualization... | ScorexFoundation/sigmastate-interpreter | library-impl/src/main/scala/special/collection/MonoidInstances.scala | Scala | mit | 2,508 |
/*
* Copyright 2017 Dmytro Rashko
*
* 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... | dimetron/NetServer | src/main/scala/com/carmonit/server/HttpServer.scala | Scala | mit | 2,665 |
package de.uni_potsdam.hpi.coheel.io
object Sample {
val ANGELA_MERKEL_SAMPLE_TEXT_1 = """
|Angela Dorothea Merkel (German: [aŋˈɡeːla doʁoˈteːa ˈmɛʁkl̩] ( listen);[1] née Kasner; born 17 July 1954) is
|a German politician and a former research scientist who has been the leader of the Christian Democratic Union (... | stratosphere/coheel | src/main/scala/de/uni_potsdam/hpi/coheel/io/Sample.scala | Scala | apache-2.0 | 1,728 |
package org.apache.mesos.chronos.scheduler.mesos
import java.io.{FileInputStream, IOException}
import java.nio.file.attribute.PosixFilePermission
import java.nio.file.{Files, Paths}
import java.util.logging.Logger
import com.google.protobuf.ByteString
import mesosphere.chaos.http.HttpConf
import org.apache.mesos.Prot... | vixns/chronos | src/main/scala/org/apache/mesos/chronos/scheduler/mesos/SchedulerDriverBuilder.scala | Scala | apache-2.0 | 3,683 |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author John Miller
* @builder scalation.linalgebra.bld.BldMatrix
* @version 1.3
* @date Sun Sep 16 14:09:25 EDT 2012
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra
import java.io.PrintWrit... | NBKlepp/fda | scalation_1.3/scalation_mathstat/src/main/scala/scalation/linalgebra/MatrixD.scala | Scala | mit | 75,614 |
package com.github.mgoeminne.sitar.parser.acm
import com.github.mgoeminne.sitar.parser.{Citation}
import org.scalatest.{FlatSpec, Matchers}
class ACMthesisTest extends FlatSpec with Matchers
{
val p = parser.thesisParser
"Single author phd thesis citation" should "be correctly parsed" in {
val citation =... | mgoeminne/sitar | src/test/scala/com/github/mgoeminne/sitar/test/acm/ACMthesisTest.scala | Scala | mit | 869 |
/*
* Copyright 2016 Dennis Vriend
*
* 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... | dnvriend/study-category-theory | scalaz-test/src/test/com/github/dnvriend/fp/LexicalScopeTest.scala | Scala | apache-2.0 | 3,197 |
package scala.lms
package epfl
package test3
import test1._
import test2._
trait ParsersProg extends Parsers { this: Matching with Extractors =>
def toElem(c: Char): Elem
def acceptChar(c: Char) = acceptElem(toElem(c))
def acceptString(s: String) = acceptElems(s.toList.map(toElem))
val scala = accep... | astojanov/virtualization-lms-core | test-src/epfl/test3-parsers/TestParsers.scala | Scala | bsd-3-clause | 2,798 |
/*
* 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 ... | fhueske/flink | flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/FlinkSemiAntiJoinJoinTransposeRuleTest.scala | Scala | apache-2.0 | 13,280 |
/*
* 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 ... | shaoxuan-wang/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/CommonSubGraphBasedOptimizer.scala | Scala | apache-2.0 | 5,539 |
val nonon: Int = 45454
val nononon: Double = 5
2 + no/*caret*/
/*
nonon
nononon
*/ | triggerNZ/intellij-scala | testdata/completion/smart/infix/SmartRightExprInfix.scala | Scala | apache-2.0 | 82 |
package com.eclipsesource.schema
import com.eclipsesource.schema.internal.refs.{Ref, Refs}
import com.eclipsesource.schema.internal.validation.{VA, Validated}
import play.api.libs.json._
import scala.language.reflectiveCalls
import scalaz.Failure
import scalaz.{ReaderWriterState, Semigroup}
import scala.util.{Try, F... | eclipsesource/play-json-schema-validator | src/main/scala/com/eclipsesource/schema/internal/package.scala | Scala | apache-2.0 | 3,583 |
package im.tox.antox.wrapper
//Don't change this order (it will break the DB)
object MessageType extends Enumeration {
type MessageType = Value
val NONE = Value(0)
val OWN = Value(1)
val FRIEND = Value(2)
val FILE_TRANSFER = Value(3)
val FILE_TRANSFER_FRIEND = Value(4)
val ACTION = Value(5)
val GROUP_O... | afkgeek/Antox | app/src/main/scala/im/tox/antox/wrapper/MessageType.scala | Scala | gpl-3.0 | 394 |
/*
* Copyright 2014 The SIRIS Project
*
* 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... | simulator-x/core | src/simx/core/svaractor/semantictrait/base/SemanticTypeTrait.scala | Scala | apache-2.0 | 3,804 |
package com.thoughtworks.sbt.sbteo
import java.util.concurrent.atomic.AtomicReference
import sbt.Keys._
import sbt._
object SbteoPlugin extends sbt.AutoPlugin {
val sbteo = config("sbteo").hide
val start = TaskKey[SbteoServer]("start")
val stop = TaskKey[Unit]("stop")
//lazy val launcher = TaskKey[Seq[Stri... | thoughtworks/sbteo | src/main/scala/com/thoughtworks/sbt/sbteo/SbteoPlugin.scala | Scala | apache-2.0 | 1,969 |
package com.etsy.sahale
import java.util.List
import cascading.flow.{FlowStep, Flow, FlowStepStrategy}
// same approach as in Scalding
object FlowStepStrategies {
/**
* Returns a new FlowStepStrategy that runs both strategies in sequence.
* If either of the strategies is null it is skipped
*/
def plus[A... | etsy/Sahale | flowtracker/src/main/scala/FlowStepStrategies.scala | Scala | mit | 803 |
package ml.sparkling.graph.operators.measures.graph
import ml.sparkling.graph.api.operators.measures.{GraphIndependentMeasure}
import org.apache.spark.graphx.{Graph, VertexRDD}
import scala.reflect.ClassTag
/**
* Created by Roman Bartusiak (roman.bartusiak@pwr.edu.pl http://riomus.github.io).
*/
object FreemanCen... | sparkling-graph/sparkling-graph | operators/src/main/scala/ml/sparkling/graph/operators/measures/graph/FreemanCentrality.scala | Scala | bsd-2-clause | 692 |
package org.tearne.crosser.distribution.components
import scala.annotation.tailrec
import org.slf4j.LoggerFactory
import org.tearne.crosser.cross.Cross
import org.tearne.crosser.cross.Crosser
import org.tearne.crosser.distribution.PlantEmpirical
import org.tearne.crosser.distribution.PlantEmpiricalFactory
import org.... | tearne/Crosser | src/main/scala/org/tearne/crosser/distribution/components/DistributionCrosserComponent.scala | Scala | apache-2.0 | 1,730 |
/**
*
* Copyright (C) 2017 University of Bamberg, Software Technologies Research Group
* <https://www.uni-bamberg.de/>, <http://www.swt-bamberg.de/>
*
* This file is part of the Data Structure Investigator (DSI) project, which received financial support by the
* German Research Foundation (DFG) under grant no. L... | uniba-swt/DSIsrc | src/event/DsOliEvents.scala | Scala | gpl-3.0 | 2,889 |
import java.io.{InputStream, OutputStream}
import com.amazonaws.auth.profile.ProfileCredentialsProvider
import com.amazonaws.regions.{Region, Regions}
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient
import com.amazonaws.services.dynamodbv2.datamodeling._
import com.fasterxml.jackson.databind.ObjectMapper... | wouterkwakernaak/aws-lambda-scala | src/main/scala/TodoApp.scala | Scala | mit | 1,595 |
package com.stulsoft.ysps.pstrings
/**
* Created by Yuriy Stul on 9/12/2016.
*/
object Strings {
def main(args: Array[String]): Unit = {
println("==>main")
formatting()
compare()
outPutter()
counting()
println("<==main")
}
def formatting(): Unit = {
println("==>formatting")
... | ysden123/ysps | src/main/scala/com/stulsoft/ysps/pstrings/Strings.scala | Scala | mit | 1,360 |
/*
* Copyright 2013 http4s.org
*
* 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... | rossabaker/http4s | examples/blaze/src/main/scala/com/example/http4s/blaze/demo/server/service/GitHubService.scala | Scala | apache-2.0 | 2,612 |
package org.bitcoins.rpc
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import org.bitcoins.core.crypto.DoubleSha256Digest
import org.bitcoins.rpc.util.TestUtil
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{BeforeAndAfterAll, FlatSpec, MustMatchers}
import scala.concurrent.{Aw... | bitcoin-s/bitcoin-s-rpc-client | src/test/scala/org/bitcoins/rpc/MultipleRPCClientTest.scala | Scala | mit | 1,833 |
package slamdata.engine
import slamdata.engine.analysis._
import slamdata.engine.std._
import org.specs2.mutable._
class OptimizerSpec extends Specification with CompilerHelpers {
import StdLib._
import structural._
import set._
import LogicalPlan._
"simplify" should {
"inline trivial binding"... | mossprescott/quasar | src/test/scala/slamdata/engine/optimizer.scala | Scala | agpl-3.0 | 1,798 |
package concrete
import bitvectors.BitVector
import com.typesafe.scalalogging.LazyLogging
import concrete.util.{CacheOne, Interval}
final class BitVectorDomain(val offset: Int, val bitVector: BitVector, override val size: Int)
extends IntDomain with LazyLogging {
assert(size >= 2, "BitVectorSets must have at lea... | concrete-cp/concrete | src/main/scala/concrete/BitVectorDomain.scala | Scala | lgpl-2.1 | 7,982 |
/*
* 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/ResultIterator.scala | Scala | apache-2.0 | 3,995 |
/*
* Copyright (C) 2011 Mathias Doenitz
*
* 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... | spray/spray-can | server-example/src/main/scala/cc/spray/can/example/Main.scala | Scala | apache-2.0 | 1,143 |
package io.vamp.model.reader
import io.vamp.model.artifact._
import io.vamp.model.notification._
import io.vamp.model.reader.YamlSourceReader._
import io.vamp.model.validator.BreedTraitValueValidator
object BreedReader extends YamlReader[Breed] with ReferenceYamlReader[Breed] with TraitReader with ArgumentReader with... | magneticio/vamp | model/src/main/scala/io/vamp/model/reader/BreedReader.scala | Scala | apache-2.0 | 3,712 |
package com.github.okapies.finagle.gntp.util
object GntpBoolean {
def parseBoolean(s: String): Boolean =
s.toLowerCase match {
case "yes" | "true" => true
case "no" | "false" => false
case _ => throw new NumberFormatException("For input string: \\""+s+"\\"")
}
}
| okapies/finagle-gntp | src/main/scala/com/github/okapies/finagle/gntp/util/GntpBoolean.scala | Scala | bsd-2-clause | 292 |
/*
* 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 ... | bhoppi/zen | ml/src/test/scala/com/github/cloudml/zen/ml/recommendation/FMSuite.scala | Scala | apache-2.0 | 4,850 |
/*
* 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 ... | RSulzmann/openwhisk | core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/docker/DockerContainer.scala | Scala | apache-2.0 | 18,311 |
package capture
package server
import control.{LongRunning, Record}
import java.lang.ProcessBuilder
import java.io.{
InputStream,
OutputStream,
InputStreamReader,
BufferedReader
}
trait PostOperation extends LongRunning { self: Record =>
def debug(command: String) = {
println("[EXECUTING] %s" format com... | philcali/robot-vision | server/src/main/scala/PostRecord.scala | Scala | mit | 1,727 |
package collins.models
import java.sql.Timestamp
import java.util.Date
import org.squeryl.PrimitiveTypeMode._
import org.squeryl.Schema
import org.squeryl.annotations.Column
import org.squeryl.annotations.Transient
import org.squeryl.dsl.ast.LogicalBoolean
import play.api.libs.json.JsObject
import play.api.libs.json... | byxorna/collins | app/collins/models/AssetLog.scala | Scala | apache-2.0 | 10,169 |
/**
* Generated by API Builder - https://www.apibuilder.io
* Service version: 0.2.43
* apibuilder 0.15.33 app.apibuilder.io/flow/docker-hub/latest/play_2_8_client
*/
package io.flow.docker.hub.v0.models {
final case class Jwt(
token: String
)
final case class JwtForm(
username: String,
password:... | flowcommerce/dependency | generated/app/FlowDockerHubV0Client.scala | Scala | mit | 14,082 |
package colang.tokens
import colang.Strategy.Result
import colang.Strategy.Result.{NoMatch, Success}
import colang.{SourceCode, SourceCodeStream}
/**
* Represents a sequence of whitespace characters (' ', '\\t', and '\\n').
* @param hasLineBreaks true if this sequence contains at least one line break
*/
case cl... | merkispavel/colang | src/main/scala/colang/tokens/Whitespace.scala | Scala | mit | 869 |
package io.github.shogowada.scalajs.reactjs.example.router
import java.util.regex.{Matcher, Pattern}
import io.github.shogowada.scalajs.reactjs.example.{BaseTest, TestTargetServers}
import org.openqa.selenium.Alert
class RouterTest extends BaseTest {
val server = TestTargetServers.router
"given I am at home pa... | shogowada/scalajs-reactjs | example/test/src/it/scala/io/github/shogowada/scalajs/reactjs/example/router/RouterTest.scala | Scala | mit | 3,784 |
package chess
import ornicar.scalalib.test.OrnicarValidationMatchers
import org.specs2.mutable.Specification
import org.specs2.matcher.Matcher
import format.Visual
trait ChessTest
extends Specification
with OrnicarValidationMatchers {
implicit def stringToBoard(str: String): Board = Visual << str
impli... | cxd4/scalachess | src/test/scala/ChessTest.scala | Scala | mit | 2,044 |
/*
* 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 ... | pronix/spark | mllib/src/main/scala/org/apache/spark/mllib/regression/impl/GLMRegressionModel.scala | Scala | apache-2.0 | 3,462 |
package controllers
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import org.joda.time.DateTime
import model.blog.{ PostEnriched, StaticPage }
import model.ui.{ BreadcrumbItem, MetaTags, SidebarContainer }
import play.api.data.Forms.nonEmptyText
import play.api.data.{ Form,... | ExNexu/scablo | app/controllers/BlogController.scala | Scala | bsd-2-clause | 12,740 |
// Databricks notebook source
// MAGIC %md
// MAGIC
// MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/)
// COMMAND ----------
// MAGIC %md
// MAGIC Archived YouTube video of this live unedited lab-lecture:
// MAGIC
// MAGIC [![Archived YouTube video of this live un... | lamastex/scalable-data-science | db/2/2/019_DistLAlgForLinRegIntro.scala | Scala | unlicense | 22,119 |
/*
* Copyright (c) 2010 Pedro Matiello <pmatiello@gmail.com>
*
* Test programs for very deep recursion.
*/
package pistache.integration
import pistache.picalculus._
class Summation(list:List[Int]) {
var sum = 0
def step(list:List[Int]):Agent = Agent {
val add = Action{ sum += list.head }
If (!list.is... | pmatiello/pistache | test/pistache/integration/Summation.scala | Scala | mit | 647 |
package fpgatidbits.ocm
import Chisel._
// a definitions and helpers for FPGA On-Chip Memory (OCM)
// (typically "BRAM" for Xilinx and "embedded memory" for Altera)
// a collection of values that define the OCM
// for now we require all ports to have the same dimensions
class OCMParameters(b: Int, rWidth: Int, wWidt... | maltanar/fpga-tidbits | src/main/scala/fpgatidbits/ocm/OCMController.scala | Scala | bsd-2-clause | 8,174 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.it.http
import akka.stream.scaladsl.Source
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.libs.streams.Accumulator
import play.api.mvc.{ Results, EssentialAction }
import play.api.test._
import play.it._
im... | Shenker93/playframework | framework/src/play-integration-test/src/test/scala/play/it/http/HttpPipeliningSpec.scala | Scala | apache-2.0 | 2,811 |
package dotty.tools
package languageserver
package decompiler
import java.net.URI
import java.nio.file._
import java.util.concurrent.CompletableFuture
import dotty.tools.tasty.UnpickleException
import dotc.fromtasty.TastyFileUtil
import org.eclipse.lsp4j.jsonrpc.services._
@JsonSegment("tasty")
trait TastyDecompi... | som-snytt/dotty | language-server/src/dotty/tools/languageserver/decompiler/TastyDecompilerService.scala | Scala | apache-2.0 | 1,276 |
trait T extends java.lang.Iterable[String] {
override def spliterator(): java.util.Spliterator[String] = {
super[Iterable].spliterator
super.spliterator
null
}
def foo = {
super[Iterable].spliterator
super.spliterator
}
def iterator: java.util.Iterator[String] = java.util.Collections.empt... | scala/scala | test/files/neg/trait-defaults-super.scala | Scala | apache-2.0 | 359 |
/**
* Copyright 2015 ICT.
*
* 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
... | DataSysLab/netflow | common/src/main/scala/cn/ac/ict/acs/netflow/NetFlowException.scala | Scala | apache-2.0 | 1,052 |
package org.openurp.edu.grade.course.domain.impl
import java.util.Date
import org.beangle.data.dao.EntityDao
import org.openurp.edu.base.code.model.ExamStatus
import org.openurp.edu.grade.code.model.GradeType
import org.openurp.edu.grade.code.model.GradeType.{ DelayGa, EndGa, Makeup, MakeupGa }
import org.openurp.edu... | openurp/edu-core | grade/core/src/main/scala/org/openurp/edu/grade/course/domain/impl/DefaultScoreCalculator.scala | Scala | gpl-3.0 | 7,863 |
package com.bstek.designer.core.actions
import com.intellij.openapi.actionSystem.{DataConstants, AnAction, AnActionEvent}
import com.bstek.designer.core.component.DoradoProjectComponentImpl
import com.intellij.openapi.project.Project
import com.intellij.execution.application.{ApplicationConfiguration, ApplicationConfi... | OuYuBin/IDEADorado | dorado-core/src/com/bstek/designer/core/actions/UpdateConfigRulesAction.scala | Scala | apache-2.0 | 1,675 |
/**
* Copyright 2013-2015, AlwaysResolve Project (alwaysresolve.org), MOYD.CO LTD
* This file incorporates work covered by the following copyright and permission notice:
*
* Copyright 2012 silenteh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complianc... | Moydco/AlwaysResolveDNS | src/main/scala/records/AAAA.scala | Scala | apache-2.0 | 3,341 |
package almhirt.httpx.spray
import almhirt.common._
import spray.routing.RequestContext
import spray.http._
import spray.httpx.marshalling.Marshaller
import almhirt.problem.CauseIsProblem
import almhirt.problem.CauseIsThrowable
import almhirt.problem.HasAThrowable
package object service {
def determineStatusCode(pr... | chridou/almhirt | ext/almhirt-httpx-spray-service/src/main/scala/almhirt/httpx/spray/service/package.scala | Scala | apache-2.0 | 2,326 |
/*
* Copyright (c) 2012, 2013, 2014, 2015, 2016 SURFnet BV
* 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, thi... | BandwidthOnDemand/nsi-safnari | app/nl/surfnet/safnari/InitialReserveAlgorithm.scala | Scala | bsd-3-clause | 4,541 |
package com.gilt.thehand.rules.typed
import com.gilt.thehand.{Context, AbstractRuleSpec}
class LongLtSpec extends AbstractRuleSpec {
val testCases = Map(
LongLt(54) -> (
Set(Context(53), Context(BigDecimal("53")), Context(53.0), Context('6'), Context(true)),
Set(Context(54), Context(55), Context(Big... | gilt/the-hand | src/test/scala/com/gilt/thehand/rules/typed/LongLtSpec.scala | Scala | apache-2.0 | 1,024 |
package at.nonblocking.cliwix.integrationtest
import at.nonblocking.cliwix.core.CliwixCommandExecutionException
import at.nonblocking.cliwix.core.command.{CompanyInsertCommand, CompanyListCommand}
import at.nonblocking.cliwix.core.handler.DispatchHandler
import at.nonblocking.cliwix.core.transaction.CliwixTransaction
... | nonblocking/cliwix | cliwix-test-integration/src/test/scala/at/nonblocking/cliwix/integrationtest/CliwixTransactionTest.scala | Scala | agpl-3.0 | 2,110 |
/*
* Accio is a platform to launch computer science experiments.
* Copyright (C) 2016-2018 Vincent Primault <v.primault@ucl.ac.uk>
*
* Accio 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... | privamov/accio | accio/javatests/fr/cnrs/liris/accio/domain/Arbitraries.scala | Scala | gpl-3.0 | 1,176 |
package algebra.laws
import algebra._
import algebra.lattice.{Heyting, Bool, GenBool}
import cats.kernel.laws._
import org.scalacheck.{Arbitrary, Prop}
import org.scalacheck.Prop._
object LogicLaws {
def apply[A: Eq: Arbitrary] = new LogicLaws[A] {
def Equ = Eq[A]
def Arb = implicitly[Arbitrary[A]]
}
}
... | sritchie/algebra | laws/src/main/scala/algebra/laws/LogicLaws.scala | Scala | mit | 3,024 |
/*
* Copyright (c) 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.apache.org... | krahman/snowplow | 4-storage/kinesis-elasticsearch-sink/src/test/scala/com.snowplowanalytics.snowplow.storage.kinesis.elasticsearch/SnowplowElasticsearchTransformerSpec.scala | Scala | apache-2.0 | 8,069 |
/**
* 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... | richhaase/kafka | core/src/test/scala/integration/kafka/api/LegacyAdminClientTest.scala | Scala | apache-2.0 | 5,477 |
package my.game.pkg.actors
import my.game.pkg.base_actor.AcceleratableActor
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.g2d.Batch
import com.badlogic.gdx.scenes.scene2d.actions.Actions
// import scala.utils.Random
object AsteroidSize extends Enumeration {
... | raymank26/asteroids-scala | common/src/main/scala/asteroid.scala | Scala | gpl-3.0 | 1,013 |
package breeze.linalg.support
/*
Copyright 2012 David Hall
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... | wavelets/breeze | src/main/scala/breeze/linalg/support/CanIterateAxis.scala | Scala | apache-2.0 | 1,120 |
/*
* Copyright 2001-2013 Artima, 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 agre... | travisbrown/scalatest | src/test/scala/org/scalatest/events/LocationMethodSuiteProp.scala | Scala | apache-2.0 | 8,638 |
package +
class Foo
| lampepfl/dotty | tests/pos/i2292.scala | Scala | apache-2.0 | 21 |
package org.scalatra.cache
import javax.servlet.http.{ HttpServletResponse, HttpServletRequest }
trait KeyStrategy {
def key(implicit request: HttpServletRequest, response: HttpServletResponse): String
}
| lightvector/scalatra | cache/src/main/scala/org/scalatra/cache/KeyStrategy.scala | Scala | bsd-2-clause | 208 |
/*
* 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 ... | ueshin/apache-flink | flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/rules/datastream/DataStreamTemporalTableJoinRule.scala | Scala | apache-2.0 | 2,644 |
/*
* Copyright 2020 David Edwards
*
* 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... | davidledwards/zookeeper | zookeeper-client/src/main/scala/com/loopfor/zookeeper/Configuration.scala | Scala | apache-2.0 | 6,105 |
/*
* 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 ... | nickpan47/samza | samza-core/src/main/scala/org/apache/samza/job/JobRunner.scala | Scala | apache-2.0 | 5,893 |
package pl.jozwik.mvn2sbt
import com.typesafe.scalalogging.LazyLogging
import org.scalatest.{Matchers, WordSpecLike}
abstract class AbstractSpec extends WordSpecLike with Matchers with LazyLogging
| ajozwik/mvn2sbt | converter/src/test/scala/pl/jozwik/mvn2sbt/AbstractSpec.scala | Scala | apache-2.0 | 199 |
//package hr.element.beepo
//package core
//
//import net.liftweb.actor.LiftActor
//import send.sms.SMSSender
//import send.sms.Received
//import org.joda.time.DateTime
//
//
//sealed trait CheckerMsg
//case class Check(sms: Model.SmsIptRequest) extends CheckerMsg
//case class ReSend(id: Int) extends CheckerMsg
//objec... | element-doo/beepo | code/scala/core/src/main/scala/hr/element/beepo/core/Checker.scala | Scala | bsd-3-clause | 1,493 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.it.server
import akka.stream.Materializer
import javax.inject.Inject
import javax.inject.Provider
import play.api.inject.bind
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.libs.concurrent.ActorSystemProvider
import ... | benmccann/playframework | core/play-integration-test/src/it/scala/play/it/server/ServerReloadingSpec.scala | Scala | apache-2.0 | 10,581 |
package de.zalando.model
import de.zalando.apifirst.Application._
import de.zalando.apifirst.Domain._
import de.zalando.apifirst.ParameterPlace
import de.zalando.apifirst.naming._
import de.zalando.apifirst.Hypermedia._
import de.zalando.apifirst.Http._
import de.zalando.apifirst.Security
import java.net.URL
import Sec... | zalando/play-swagger | api-first-core/src/test/scala/model/resources.basic_extension_yaml.scala | Scala | mit | 2,294 |
/**
* 要得到一个序列的对偶很容易,比如:
val pairs = (1 to 10) zip (11 to 20)
假定你想要对这个序列做某中操作—比如,给对偶中的值求和,但是你不能直接使用:
pairs.map(_ + _)
函数_ + _ 接受两个Int作为参数,而不是(Int,Int)对偶。
编写函数adjustToPair,
该函数接受一个类型为(Int,Int)=>Int的函数作为参数,并返回一个等效的, 可以以对偶作为参数的函数。
举例来说就是:adjustToPair(_ * _)((6,7))应得到42。然后用这个函数通过map计算出各个对偶的元素之... | vernonzheng/scala-for-the-Impatient | src/Chapter12/exercise07.scala | Scala | mit | 840 |
/*
* Copyright (c) 2015 Contributor. All rights reserved.
*/
package org.scalaide.debug.internal.hcr
package ui
import scala.collection.mutable.Publisher
import scala.collection.mutable.Subscriber
import org.eclipse.jface.dialogs.MessageDialog
import org.scalaide.debug.internal.preferences.HotCodeReplacePreferences... | Kwestor/scala-ide | org.scala-ide.sdt.debug/src/org/scalaide/debug/internal/hcr/ui/HotCodeReplaceListener.scala | Scala | bsd-3-clause | 1,992 |
/*
* MnoClassifier learns MSISDN-Operator combinations to afterwards predict Operators.
* Copyright (C) 2013 MACH Connectivity GmbH
*
* 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... | mkroli/mnoclassifier | src/main/scala/com/github/mkroli/mnoclassifier/service/Shutdown.scala | Scala | gpl-2.0 | 1,655 |
package com.cloudray.scalapress.plugin.attachment
import javax.persistence.{ElementCollection, Table, Entity}
import com.cloudray.scalapress.section.Section
import com.cloudray.scalapress.media.AssetStore
import com.cloudray.scalapress.util.Scalate
import scala.beans.BeanProperty
import java.util
import scala.collecti... | vidyacraghav/scalapress | src/main/scala/com/cloudray/scalapress/plugin/attachment/AttachmentSection.scala | Scala | apache-2.0 | 1,783 |
/*
* 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
* distrib... | fusepoolP3/p3-silk | silk-core/src/main/scala/de/fuberlin/wiwiss/silk/output/DataWriter.scala | Scala | apache-2.0 | 1,239 |
/*
* Copyright 2013 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 ... | rocwzp/zipkin | zipkin-common/src/main/scala/com/twitter/zipkin/common/Dependencies.scala | Scala | apache-2.0 | 4,849 |
/***********************************************************************
* Copyright (c) 2013-2017 Commonwealth Computer Research, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and... | ronq/geomesa | geomesa-accumulo/geomesa-accumulo-raster/src/main/scala/org/locationtech/geomesa/raster/iterators/IteratorFunctions.scala | Scala | apache-2.0 | 6,561 |
package scavlink.link
import scavlink.message.enums.MavType
import scavlink.message.enums.MavType._
/**
* Helpful properties derived from the [[MavType]] value.
* @author Nick Rossi
*/
trait VehicleType {
def name: String
def isAir: Boolean
def isGround: Boolean
def isWater: Boolean
def isUnderwater: Boo... | nickolasrossi/scavlink | src/main/scala/scavlink/link/VehicleType.scala | Scala | mit | 1,369 |
package memnets.utils
import java.util.Optional
import java.util.function._
import scala.reflect.ClassTag
/** quick conversions helper. could integrate w/ JavaConverters better... */
object JavaUtils {
implicit def opt2optional[T](opt: Option[T]): Optional[T] = asJava(opt)
def asScala[T](col: java.util.Collec... | MemoryNetworks/memnets | api/src/main/scala/memnets/utils/JavaUtils.scala | Scala | apache-2.0 | 916 |
package aug.gui
import aug.gui.text.{Fragment, Line, TextPos}
import aug.io.{DefaultColorCode, TelnetColorBlue, TelnetColorDefaultBg}
import org.scalatest.FlatSpec
class LineTest extends FlatSpec {
"a line" should "highlight a fragment" in {
val line = Line(List(
Fragment("four", DefaultColorCode)
),... | austinmiller/augustmc | src/test/scala/aug.gui/LineTest.scala | Scala | apache-2.0 | 3,680 |
package constants
object ElasticSearch {
lazy val INDEX_TYPE_CONTENT = "content"
lazy val INDEX_TYPE_QUESTION = "question"
lazy val INDEX_TYPE_TOPIC = "topic"
lazy val INDEX_TYPE_TAG = "tag"
lazy val INDEX_TYPE_USER = "user"
lazy val INDEX_TYPE_COMMENT = "comment"
}
| lequangdzung/quora-clone | api-app/app/constants/ElasticSearch.scala | Scala | gpl-2.0 | 280 |
package latis.server
import javax.servlet.http.HttpServletResponse
import java.io.PrintWriter
import latis.util.LatisServiceException
import latis.util.DatasetNotFoundException
//import javax.xml.ws.http.HTTPException
class ErrorWriter(response: HttpServletResponse) {
def write(e: Throwable): Unit = e match {
... | dlindhol/LaTiS | src/main/scala/latis/server/ErrorWriter.scala | Scala | epl-1.0 | 1,882 |
package slick.jdbc
/** A DataSource that wraps the DriverManager API. It can be configured as a Java Bean and used
* both stand-alone and as a source for a connection pool. This implementation is design
* specifically to handle a non-JDBC Database URL in the format defined by the libpq standard.
*/
class Databas... | Radsaggi/slick | slick/src/main/scala/slick/jdbc/DatabaseUrlDataSource.scala | Scala | bsd-2-clause | 1,861 |
package org.workcraft.gui.docking
import org.flexdock.docking.defaults.AbstractDockable
import javax.swing.JComponent
import org.flexdock.docking.event.DockingEvent
import org.flexdock.docking.DockingPort
import javax.swing.JTabbedPane
import org.workcraft.gui.docking.tab.DockableTab
import org.flexdock.docking.Dockin... | mechkg/workcraft | Gui/src/main/scala/org/workcraft/gui/docking/DockableWindow.scala | Scala | gpl-3.0 | 2,922 |
package au.com.dius.pact.matchers
import java.util.Optional
import au.com.dius.pact.model.{BodyMismatch, DiffConfig, HttpPart}
trait BodyMatcher {
def matchBody(expected: HttpPart, actual: HttpPart, diffConfig: DiffConfig) : List[BodyMismatch]
def toScalaOption(body: Optional[String]) = {
if (body.isPresent... | flaregames/pact-jvm | pact-jvm-matchers/src/main/scala/au/com/dius/pact/matchers/BodyMatcher.scala | Scala | apache-2.0 | 357 |
// folder mustn't be included
trait B
| jrudolph/sbt-cross-building | src/sbt-test/sbt-cross-building/extra-source-dirs-0.12/src/main/scala-sbt-0.12/B.scala | Scala | bsd-2-clause | 38 |
package com.zobot.client.packet.definitions.serverbound.play
import com.zobot.client.packet.Packet
case class PlayerAbilities(flags: Any, flyingSpeed: Any, walkingSpeed: Any) extends Packet {
override lazy val packetId = 0x13
override lazy val packetData: Array[Byte] =
fromAny(flags) ++
fromAny(flyingSpe... | BecauseNoReason/zobot | src/main/scala/com/zobot/client/packet/definitions/serverbound/play/PlayerAbilities.scala | Scala | mit | 355 |
object MatMul {
type Matrix = Array[Array[Double]]
def matgen(n: Int) : Matrix = {
var a = Array.ofDim[Double](n, n);
val tmp = 1.0 / n / n
for (i <- 0 until n) {
for (j <- 0 until n) {
a(i)(j) = tmp * (i - j) * (i + j)
}
}
a
}
def matmul(a: Matrix, b: Matrix): Matrix =... | chalucha/benchmarks | matmul/matmul.scala | Scala | mit | 1,214 |
package org.jetbrains.plugins.scala.lang.formatting
import com.intellij.formatting.{Wrap, WrapType}
import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElement
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.lang.formatting.settings.ScalaCodeStyleSettings
import org.jetbrains.plugin... | double-y/translation-idea-plugin | src/org/jetbrains/plugins/scala/lang/formatting/ScalaWrapManager.scala | Scala | apache-2.0 | 9,107 |
package org.bitcoins.core.currency
import org.bitcoins.core.gen.CurrencyUnitGenerator
import org.bitcoins.core.number.Int64
import org.scalacheck.{ Prop, Properties }
import scala.util.Try
/**
* Created by chris on 6/23/16.
*/
class CurrencyUnitSpec extends Properties("CurrencyUnitSpec") {
property("Symmetrical... | Christewart/bitcoin-s-core | src/test/scala/org/bitcoins/core/currency/CurrencyUnitSpec.scala | Scala | mit | 3,689 |
package mesosphere.marathon
package state
import mesosphere.UnitTest
import mesosphere.marathon.core.instance.TestTaskBuilder
import mesosphere.marathon.core.pod.{ BridgeNetwork, ContainerNetwork }
import mesosphere.marathon.core.task.state.NetworkInfo
import mesosphere.marathon.state.Container.PortMapping
import meso... | natemurthy/marathon | src/test/scala/mesosphere/marathon/state/AppDefinitionPortAssignmentsTest.scala | Scala | apache-2.0 | 11,377 |
/*
* This file is part of Kiama.
*
* Copyright (C) 2011-2015 Anthony M Sloane, Macquarie University.
*
* Kiama 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 License, or ... | solomono/kiama | library/src/org/kiama/example/oberon0/L3/c/CTree.scala | Scala | gpl-3.0 | 1,581 |
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory
import scala.concurrent.duration._
/**
* Performance test for the ClinicalNote entity.
*/
class ClinicalNoteGatlingTes... | CardiacAtlasProject/CAPServer2.0 | xpacs/src/test/gatling/simulations/ClinicalNoteGatlingTest.scala | Scala | apache-2.0 | 3,507 |
package eventstore
package core
package operations
import scala.util.{ Failure, Success }
import org.specs2.mutable.Specification
import DeletePersistentSubscriptionError._
import PersistentSubscription.DeleteCompleted
import Inspection.Decision._
import TestData._
class DeletePersistentSubscriptionInspectionSpec ext... | EventStore/EventStore.JVM | core/src/test/scala/eventstore/core/operations/DeletePersistentSubscriptionInspectionSpec.scala | Scala | bsd-3-clause | 1,014 |
abstract class FooA {
type A <: Ax;
abstract class Ax;
abstract class InnerA {
type B <: A;
def doB : B;
}
}
trait FooB extends FooA {
type A <: Ax;
trait Ax extends super.Ax { def xxx : Int; }
abstract class InnerB extends InnerA {
// type B <: A;
val a : A = d... | yusuke2255/dotty | tests/neg/overrides.scala | Scala | bsd-3-clause | 1,750 |
package pl.writeonly.son2.path.glue
import pl.writeonly.son2.apis.config.RConfig
import pl.writeonly.son2.path.core.{DefaultsPath, ProvidersPath}
import pl.writeonly.son2.path.creators.PCreatorReaderPath
import pl.writeonly.son2.path.notation._
import pl.writeonly.son2.path.notations.CreatorNotationTapestry
import pl.... | writeonly/son2 | scallions-impl/scallions-path/src/test/scala/pl/writeonly/son2/path/glue/PCreatorReaderPathAssertSpec.scala | Scala | apache-2.0 | 1,387 |
package com.mesosphere.cosmos.handler
import com.mesosphere.cosmos.finch.EndpointHandler
import com.mesosphere.cosmos.http.RequestSession
import com.mesosphere.cosmos.rpc.v1.model.{CapabilitiesResponse, Capability}
import com.twitter.util.Future
private[cosmos] final class CapabilitiesHandler
extends EndpointHandle... | dcos/cosmos | cosmos-server/src/main/scala/com/mesosphere/cosmos/handler/CapabilitiesHandler.scala | Scala | apache-2.0 | 739 |
/*
* 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 ... | sgururajshetty/carbondata | integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonRelation.scala | Scala | apache-2.0 | 8,412 |
package debop4s.core.concurrent
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.{Future => JFuture, _}
import debop4s.core.AbstractCoreFunSuite
import debop4s.core.conversions.time._
import org.scalatest.concurrent.Eventually
import org.scalatest.time.{Millis, Seconds, Span}
import scala... | debop/debop4s | debop4s-core/src/test/scala/debop4s/core/concurrent/FuturePoolFunSuite.scala | Scala | apache-2.0 | 4,685 |
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.