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 breeze.numerics
import breeze.optimize._
import breeze.generic.UFunc
import breeze.linalg._
import breeze.linalg.support.CanTraverseValues
import breeze.linalg.support.CanTraverseValues.ValuesVisitor
import breeze.macros.expand
import breeze.math._
import spire.implicits._
package object financial {
sealed ... | calippo/breeze | math/src/main/scala/breeze/numerics/financial/package.scala | Scala | apache-2.0 | 8,283 |
package es.weso.monads
import org.scalatest._
import org.scalatest.prop.PropertyChecks
import org.scalatest.prop.Checkers
import es.weso.monads.Result._
import Stream._
class ResultSpec
extends FunSpec
with Matchers
with Checkers {
describe("a Result") {
it("Should return a value") {
val bm : Resul... | labra/wiGenerator | src/test/scala/es/weso/monads/ResultSpec.scala | Scala | mit | 5,580 |
import java.lang.annotation.ElementType
object SCL8359 {
class A[T]
object A {
implicit class B[T](a: A[T]) {
def foo = 1
}
}
val e: A[ElementType] = new A
/*start*/e.foo/*end*/
}
//Int | katejim/intellij-scala | testdata/typeInference/bugs5/SCL8359.scala | Scala | apache-2.0 | 211 |
/*
* 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 ... | cloudml/zen | ml/src/main/scala/com/github/cloudml/zen/ml/clustering/algorithm/LDAAlgorithm.scala | Scala | apache-2.0 | 8,873 |
object Test {
trait A
trait B
trait Builder[From, To] {
def buildFrom(x: From): To
}
implicit val a2bBuilder = new Builder[A, B] {
override def buildFrom(x: A) = new B{}
}
implicit def a2b[From, To >: B](x: From)(implicit bl: Builder[From, To]): To = bl.buildFrom(x)
def f(b: B) = println(b)
def main(a... | ilinum/intellij-scala | testdata/implicits/implicitParameter/ImplicitWithImplicitParameter.scala | Scala | apache-2.0 | 491 |
package dotty.tools
package dotc
package typer
import core._
import ast._
import Contexts._, Types._, Flags._, Symbols._
import ProtoTypes._
import NameKinds.{AvoidNameKind, UniqueName}
import util.Spans._
import util.{Stats, SimpleIdentityMap}
import Decorators._
import config.Printers.{gadts, typr}
import annotation... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/typer/Inferencing.scala | Scala | apache-2.0 | 33,321 |
package controllers
import javax.inject.Inject
import com.mohiva.play.silhouette.api._
import com.mohiva.play.silhouette.api.exceptions.ProviderException
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
import com.mohiva.play.silhouette.impl.authenticators.JWTAuthenticator
import com.mohiva.play.... | anotherhale/play-silhouette-angular-seed | app/controllers/SocialAuthController.scala | Scala | apache-2.0 | 2,507 |
package coursier.cli.util
object Guard {
def apply(): Unit = {
val experimental =
Option(System.getenv("COURSIER_EXPERIMENTAL")).exists(s => s == "1" || s == "true") ||
java.lang.Boolean.getBoolean("coursier.experimental")
if (!experimental) {
System.err.println(
"Command disabled. ... | alexarchambault/coursier | modules/cli/src/main/scala/coursier/cli/util/Guard.scala | Scala | apache-2.0 | 469 |
/*******************************************************************************
Copyright (c) 2012-2013, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
**********************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/exceptions/ParserError.scala | Scala | bsd-3-clause | 1,348 |
import leon.annotation._
import leon.lang._
import leon.lang.synthesis._
object SortedListUnion {
sealed abstract class List
case class Cons(head: BigInt, tail: List) extends List
case object Nil extends List
def size(l: List): BigInt = (l match {
case Nil => BigInt(0)
case Cons(_, t) => BigInt(1) + s... | regb/leon | testcases/synthesis/current/SortedList/MergeSortGuided.scala | Scala | gpl-3.0 | 1,653 |
package com.teamisotope.techexpansion.mineral
import scala.collection.mutable
object MineralRegistry {
private val map: mutable.HashMap[String, Mineral] = new mutable.HashMap[String, Mineral]()
private val ids: mutable.HashMap[Int, Mineral] = new mutable.HashMap[Int, Mineral]()
private var currentId: Int = 0... | collaborationmods/TechExpansion | src/main/scala/com/teamisotope/techexpansion/mineral/MineralRegistry.scala | Scala | gpl-3.0 | 719 |
package rl
import collection.{ GenSeq, immutable, SortedMap }
import Imports._
object QueryString {
val DEFAULT_EXCLUSIONS = List("utm_source", "utm_medium", "utm_term", "utm_content", "utm_campaign", "sms_ss", "awesm")
def apply(rawValue: String) = {
rawValue.blankOption map { v ⇒
(v.indexOf('&') > -... | scalatra/rl | core/src/main/scala/rl/QueryString.scala | Scala | mit | 3,221 |
package com.codeboyyong.akkasample.util
import java.util.HashMap
import com.typesafe.config.ConfigFactory
import akka.actor.ActorSystem
object AkkaUtil {
def startAkkaRemoteSystem(host: String, port: String, name: String = "myRemoteActorSystem"): ActorSystem = {
val configureMap = new HashMap[String, Object]... | codeboyyong/akka-sample | akka-sample/src/main/scala/com/codeboyyong/akkasample/util/AkkaUtil.scala | Scala | apache-2.0 | 812 |
package com.github.tarao.nonempty.collection
import scala.collection.BuildFrom
import scala.collection.immutable
import scala.language.higherKinds
/** Methods inherited from `Iterable` that preserve non-emptiness.
*
* @define orderDependent
*
* Note: might return different results for different
... | tarao/nonempty-scala | src/main/scala/com/github/tarao/nonempty/collection/IterableOps.scala | Scala | mit | 16,508 |
package mesosphere.marathon
package storage
import akka.actor.{ActorSystem, Scheduler}
import akka.stream.Materializer
import mesosphere.marathon.core.storage.backup.PersistentStoreBackup
import mesosphere.marathon.core.storage.store.PersistenceStore
import mesosphere.marathon.core.storage.store.impl.cache.LoadTimeCac... | mesosphere/marathon | src/main/scala/mesosphere/marathon/storage/StorageModule.scala | Scala | apache-2.0 | 6,621 |
/*
* Copyright 2011-2022 GatlingCorp (https://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... | gatling/gatling | gatling-core/src/test/scala/io/gatling/core/check/css/CssExtractorSpec.scala | Scala | apache-2.0 | 5,566 |
package com.airbnb.aerosolve.training.pipeline
import com.airbnb.aerosolve.core.{FunctionForm, ModelRecord}
import org.junit.Assert._
import org.junit.Test
import org.slf4j.LoggerFactory
class ModelDebugTest {
val log = LoggerFactory.getLogger("ModelDebugTest")
@Test
def modelRecordToString : Unit = {
val r... | airbnb/aerosolve | training/src/test/scala/com/airbnb/aerosolve/training/pipeline/ModelDebugTest.scala | Scala | apache-2.0 | 724 |
package com.ponkotuy.proxy
import com.netaporter.uri.Uri
import com.ponkotuy.intercept.Interceptor
import io.netty.buffer.ByteBuf
import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.http.{HttpHeaders, HttpRequest}
import org.littleshoot.proxy.{HttpFilters, HttpFiltersAdapter, HttpFiltersSourceA... | kxbmap/MyFleetGirls | client/src/main/scala/com/ponkotuy/proxy/KCFiltersSource.scala | Scala | mit | 949 |
/*
* Copyright 2017 Datamountaineer.
*
* 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... | datamountaineer/stream-reactor | kafka-connect-common/src/test/scala/com/datamountaineer/streamreactor/common/sink/StringStructFieldsStringKeyBuilderTest.scala | Scala | apache-2.0 | 3,504 |
/*
* Copyright 2014–2017 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | drostron/quasar | marklogic/src/main/scala/quasar/physical/marklogic/cts/MatchDepth.scala | Scala | apache-2.0 | 1,837 |
/*
* 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/ast/rewriters/normalizeMatchPredicates.scala | Scala | apache-2.0 | 1,020 |
package synereo.client.modules
import diode.AnyAction._
import diode.ModelRO
import diode.react.ModelProxy
import japgolly.scalajs.react
import japgolly.scalajs.react._
import japgolly.scalajs.react.extra.router.RouterCtl
import japgolly.scalajs.react.vdom.prefix_<^._
import shared.dtos.CloseSessionRequest
import shar... | LivelyGig/ProductWebUI | sclient/src/main/scala/synereo/client/modules/MainMenu.scala | Scala | apache-2.0 | 10,609 |
package com.github.ellchow.scaramouch.collection
import scalaz.{ Ordering => _ , _ }, Scalaz._
import scalaz.stream._, Process._
import scalaz.concurrent._
import scala.collection.immutable.TreeMap
import com.github.ellchow.scaramouch.collection.ScalazStreamExtra._
object Join {
/* cogroup 2 processes - ASSUMES bot... | ellchow/scaramouch | scaramouch-collection/src/main/scala/com/github/ellchow/scaramouch/collection/Join.scala | Scala | apache-2.0 | 6,435 |
package Import
import Import.FileImport.FileImporter.{BrokenLines, PlayerList}
import Import.FileImport.FileImporter
import Import.ImportOptimizer.ImportOptimizer.FinalPlayers
import RestConnection.TeamRequest
import akka.actor.{ActorRef, Props, Actor}
/**
* Created by yannick on 13.02.16.
*/
object ImportManager... | yannick-cw/tournament_planer | hatplaner/src/main/scala/Import/ImportManager.scala | Scala | mit | 1,220 |
package org.jetbrains.plugins.scala
package lang.refactoring.changeSignature.changeInfo
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScClass
import org.jetbrains.plugins.scala.lang.refactoring.changeSignature.ScalaParameterInfo
import org.jetbrains.plugins.scala.lang.refactoring.util.ScalaNamesUtil... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/changeSignature/changeInfo/ParametersChangeInfo.scala | Scala | apache-2.0 | 2,415 |
/*
* Copyright (C) 2005, The Beangle Software.
*
* This program 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
* (at your option) any later version.
*
* This... | beangle/webmvc | support/src/main/scala/org/beangle/webmvc/support/action/RestfulService.scala | Scala | lgpl-3.0 | 1,581 |
/*
* Copyright DataGenerator Contributors
*
* 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... | mibrahim/DataGenerator | dg-common/src/main/scala/org/finra/datagenerator/common/Graph/AddInitialNodeDescription.scala | Scala | apache-2.0 | 997 |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\\
* @ @ *
* # # # # (c) 2017 CAB *
* # # # # # # ... | AlexCAB/MathAct | mathact_core/src/main/scala/mathact/core/sketch/infrastructure/instance/SketchInstance.scala | Scala | mit | 1,559 |
/**
* 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... | unix1986/universe | tool/kafka-0.8.1.1-src/core/src/test/scala/unit/kafka/admin/DeleteTopicTest.scala | Scala | bsd-2-clause | 24,766 |
package model
import play.api.libs.json._
/**
* Represents the Swagger definition for FavoriteImpl.
* @param additionalProperties Any additional properties this model may have.
*/
@javax.annotation.Generated(value = Array("org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen"), date = "2022-02-13T... | cliffano/swaggy-jenkins | clients/scala-play-server/generated/app/model/FavoriteImpl.scala | Scala | mit | 1,455 |
/* Taken from https://github.com/mattdesl/lwjgl-basics/blob/master/test/mdesl/test/FileDrop.java
* master - cdf5c33c5365848e7e052036e1ff549dfc6c109f.
* Rewritten to Scala for Java 8 by fehu.
*/
package feh.tec.cvis.gui
import java.awt.Container
import java.awt.datatransfer.{Transferable, Unsupported... | fehu/comp-vis | gui/src/main/scala/feh/tec/cvis/gui/FileDrop.scala | Scala | mit | 5,665 |
// This class represents an intermediate spread, where "long x" or "short x" has been defined, but the option that
// is bought or sold has not been defined yet. A SpreadBuilder must of followed by: of <Option> to do anything with it.
class SpreadBuilder {
var count : Integer = 0
var spread : Spread = null
de... | Nic0S/Options-DSL | src/SpreadBuilder.scala | Scala | apache-2.0 | 603 |
/*
* 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 ... | fanyon/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/datastream/DataStreamGroupWindowAggregate.scala | Scala | apache-2.0 | 12,466 |
import org.apache.spark.{SparkConf, SparkContext}
object TestSpark {
def main(args: Array[String]) {
val sc = new SparkContext(new SparkConf()
.setAppName("TestSpark")
.set("spark.executor.memory", "512M")
.set("spark.mesos.mesosExecutor.cores", "1")
.set("spark.speculation", "true")
... | saagie/platform-test | job-spark/src/main/scala/TestSpark.scala | Scala | gpl-2.0 | 465 |
/*
* 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 ... | RCheungIT/phoenix | phoenix-spark/src/main/scala/org/apache/phoenix/spark/DefaultSource.scala | Scala | apache-2.0 | 2,436 |
package tu.coreservice.action.way2think
/**
* Test class for Simulation.
* @author max talanov
* date 2012-05-28
* time: 11:38 PM
*/
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.FunSuite
import simulation.Simulation
import tu.model.knowledge.domain.{... | keskival/2 | coreservice.action.way2think/src/test/scala/tu/coreservice/action/way2think/SimulationTest.scala | Scala | gpl-3.0 | 2,245 |
package org.scalaide.core
package quickassist
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal
import org.junit.AfterClass
import org.junit.Assert
import org.junit.BeforeClass
import org.junit.Test
import testsetup.SDTTestUtils
import scala.util.control.Exception
import org.scalaide.core.internal.quickassis... | Kwestor/scala-ide | org.scala-ide.sdt.core.tests/src/org/scalaide/core/quickassist/ImplAbstractMemberTest.scala | Scala | bsd-3-clause | 5,901 |
package com.mpakhomov.actors
import java.net.InetSocketAddress
import java.text.DecimalFormat
import java.time.format.DateTimeFormatter
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import akka.io.{IO, Tcp}
import akka.util.{ByteString, Timeout}
import com.mpakhomov.actors.CandlestickAggregatorActor.{GetDa... | mpakhomov/akka-io-demo | src/main/scala/com/mpakhomov/actors/ServerActor.scala | Scala | apache-2.0 | 3,480 |
/*
* Copyright 2022 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/fset-faststream | app/config/microserviceWiring.scala | Scala | apache-2.0 | 1,525 |
package com.gx.mediator
import java.io.ByteArrayOutputStream
import org.scalatest.{FlatSpec, Matchers}
/**
* Copyright 2018 josephguan
*
* 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 Licens... | josephguan/scala-design-patterns | behavioral/mediator/src/test/scala/com/gx/mediator/MediatorSpec.scala | Scala | apache-2.0 | 1,333 |
package scalabpe.plugin.cache
import java.net.InetSocketAddress
import java.util.LinkedList
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.Executors
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
import jav... | bruceran/scalabpe | src/scalabpe/plugin/cache/redisnettyclient_cluster.scala | Scala | apache-2.0 | 22,336 |
package kornell.server.ep
import kornell.server.jdbc.repository.EnrollmentRepo
import java.math.BigDecimal
/**
* Simple Event Processing
*/
object EnrollmentSEP {
def onProgress(enrollmentUUID: String): Unit = {
EnrollmentRepo(enrollmentUUID).updateProgress()
}
def onAssessment(enrollmentUUID: String): ... | Craftware/Kornell | kornell-api/src/main/scala/kornell/server/ep/EnrollmentSEP.scala | Scala | apache-2.0 | 678 |
package edu.tum.cs.isabelle.impl
import java.nio.file.Path
import scala.concurrent.ExecutionContext
import edu.tum.cs.isabelle.api
@api.Implementation(identifier = "2014")
final class Environment protected(home: Path) extends api.Environment(home) {
isabelle.Isabelle_System.init(
isabelle_home = home.toAbsol... | wneuper/libisabelle | pide/2014/src/main/scala/impl/Environment.scala | Scala | mit | 3,216 |
/*
* 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 | sql/core/src/main/scala/org/apache/spark/sql/jdbc/DerbyDialect.scala | Scala | apache-2.0 | 1,876 |
/*
* Copyright (c) 2015-2017 EpiData, Inc.
*/
package cassandra
import com.chrisomeara.pillar.Migration
import com.chrisomeara.pillar.Migrator
import com.chrisomeara.pillar.Registry
import com.chrisomeara.pillar.Reporter
import com.chrisomeara.pillar.ReplicationOptions
import com.datastax.driver.core._
import java.i... | epidataio/epidata-community | play/app/cassandra/DB.scala | Scala | apache-2.0 | 4,368 |
import org.apache.hadoop.conf.Configuration
import org.apache.spark.{SparkContext, SparkConf}
import org.apache.spark.rdd.RDD
import org.bson.BSONObject
import com.mongodb.hadoop.{
MongoInputFormat, MongoOutputFormat,
BSONFileInputFormat, BSONFileOutputFormat}
import com.mongodb.hadoop.io.MongoUpdateWritable
impor... | StatisticalProject/CORDIR | sparkForet.scala | Scala | apache-2.0 | 3,488 |
package controllers
import com.madgag.playgithub.auth.{AuthController, Client}
import lib.GithubAppConfig
object Auth extends AuthController {
override val authClient: Client = GithubAppConfig.authClient
}
| guardian/gu-who | app/controllers/Auth.scala | Scala | apache-2.0 | 210 |
package sampler.distribution
import sampler.distribution.Distribution.from
import sampler.samplable.SamplableSyntax
import scala.annotation.tailrec
trait CommonDistributions
extends DistributionImplicits
with SamplableSyntax {
def always[T](value: T): Distribution[T] = Pure(value)
/** Uniform distr... | tearne/Sampler | sampler-core/src/main/scala/sampler/distribution/CommonDistributions.scala | Scala | apache-2.0 | 4,631 |
package io.youi
import scala.scalajs.js
@js.native
trait ElementFeatures extends js.Object {
def scrollIntoView(options: ScrollIntoViewOptions): Unit
}
| outr/youi | dom/src/main/scala/io/youi/ElementFeatures.scala | Scala | mit | 156 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package scalaguide.sql
// #named-database
// ###insert: package controllers
import javax.inject.Inject
import play.api.mvc.{BaseController, ControllerComponents}
import play.api.db.{Database, NamedDatabase}
// inject "orders" database inste... | Shruti9520/playframework | documentation/manual/working/scalaGuide/main/sql/code/ScalaInjectNamed.scala | Scala | apache-2.0 | 546 |
package models.actor
import models.binding._
import models.enums._
import models.provider._
import play.libs._
import play.api.libs.concurrent.Execution.Implicits._
import scala.concurrent._
import scala.concurrent.duration._
import scala.xml._
import akka.actor._
import akka.pattern._
import akka.util.Timeout
import ... | FlorianTopf/impex-portal | app/models/actor/RegistryService.scala | Scala | gpl-2.0 | 10,415 |
package archiver
import java.io.File
class FileMapping private(val mappings: Map[String, File], val permissions: Map[String, FilePermissions]) {
def size = mappings.size
def isEmpty = mappings.isEmpty
def append(fm: FileMapping) = new FileMapping(mappings ++ fm.mappings, permissions ++ fm.permissions)
def for... | hamnis/scala-archiver | src/main/scala/archiver/FileMapping.scala | Scala | apache-2.0 | 1,433 |
package org.example
class ProvidedTest | xeno-by/old-scalameta-sbt | sbt/src/sbt-test/project/provided/sub/src/test/scala/ProvidedTest.scala | Scala | bsd-3-clause | 39 |
package akka.s3
import java.net.URLEncoder
import akka.http.scaladsl.model.headers.{HttpOrigin, `Access-Control-Allow-Origin`, `Access-Control-Allow-Credentials`, ETag}
import akka.http.scaladsl.model.{StatusCodes, HttpEntity, Multipart, HttpRequest}
import akka.http.scaladsl.server.Directives._
import akka.http.sca... | akiradeveloper/akka-s3 | src/main/scala/akka/s3/api/PostObject.scala | Scala | apache-2.0 | 4,076 |
package com.github.swwjf.ws
import com.github.springtestdbunit.DbUnitTestExecutionListener
import com.github.springtestdbunit.annotation._
import com.github.springtestdbunit.assertion.DatabaseAssertionMode
import com.github.swwjf.WebServicesApplication
import com.github.swwjf.config.WSDBTestConfig
import org.junit.Tes... | andrei-l/scala-webapp-with-java-frameworks | webservices/src/test/scala/com/github/swwjf/ws/InfoEndpointTest.scala | Scala | mit | 5,669 |
package maker.project
import maker.task.tasks.UpdateTask
import maker.utils.FileUtils._
import java.io.BufferedWriter
import scala.collection.immutable.VectorBuilder
import org.eclipse.aether.artifact.Artifact
import maker.ScalaVersion
trait Bootstrapper{
self : Module =>
def updateMakerScript(marker : String... | cage433/maker | maker/src/maker/project/Bootstrapper.scala | Scala | bsd-2-clause | 1,589 |
import scala.reflect.macros.whitebox.Context
import scala.language.experimental.macros
import scala.language.postfixOps
import scala.annotation.StaticAnnotation
object kaseMacro {
// ======= DIFFERENCES WITH VANILLA CASE =======
// (this list is probably not exhaustive, since I didn't have time to study all detail... | lrytz/scala | test/macro-annot/run/kase/macro_kase_1.scala | Scala | apache-2.0 | 20,437 |
package optimizers
import breeze.linalg.{DenseVector, Vector}
import models.{Model, Regularizer, RealFunction, Loss}
import org.apache.spark.rdd.RDD
import vectors.LabelledPoint
trait Optimizer[-LossType<:Loss[_,_], DataType, AlphasType, VType] extends Serializable {
def optimize(model: Model[LossType], data: DataT... | sforte/cacao | src/main/scala/optimizers/Optimizer.scala | Scala | apache-2.0 | 771 |
import play.api._
import play.api.mvc.Results.InternalServerError
import play.api.Logger
import play.api.mvc.RequestHeader
import play.api.mvc.SimpleResult
import play.api.mvc.Result
import play.api.mvc.Results._
import play.api.mvc.Handler
object Global extends GlobalSettings {
override def onStart(app: Applicatio... | knoldus/Play-Starter-Template | app/Global.scala | Scala | apache-2.0 | 733 |
object HelloWorld {
def main(args: Array[String]) {
assert(org.eclipse.core.runtime.adaptor.EclipseStarter.PROP_BUNDLES != null)
println("Hello, world!")
}
}
| digimead/sbt-osgi-manager | src/sbt-test/osgi-manager/workWithPluginAOP/src/main/scala/Hello.scala | Scala | apache-2.0 | 172 |
/*
* 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 ... | himanshudhami/PredictionIO | core/src/main/scala/org/apache/predictionio/workflow/EngineServerPluginsActor.scala | Scala | apache-2.0 | 1,820 |
package de.dominicscheurer.fsautils
import Types._
import Conversions._
object RegularExpressions {
sealed abstract class RE extends FSA_DSL {
type MutableMap[A,B] = scala.collection.mutable.Map[A,B]
type Map[A,B] = scala.collection.immutable.Map[A,B]
def MutableMap[A,B]() : MutableMap[A,... | rindPHI/FSAUtils | src/de/dominicscheurer/fsautils/RegularExpressions.scala | Scala | mit | 9,930 |
import java.io.{File, FilenameFilter}
import flaky._
import flaky.history.{Git, History, HistoryReport}
import org.apache.commons.vfs2.VFS
object RenderHtml extends App with Unzip {
println("Creating report")
private val reportsDir = new File("target/flakyreports")
private val dirWithReports = new File("src/tes... | otrebski/sbt-flaky | src/test/scala/RenderHtml.scala | Scala | apache-2.0 | 1,256 |
object Bug {
def foo(): Unit = {
val v = {
lazy val s = 0
s
}
}
}
| yusuke2255/dotty | tests/untried/pos/t5796.scala | Scala | bsd-3-clause | 90 |
//: ----------------------------------------------------------------------------
//: Copyright (C) 2014 Verizon. All Rights Reserved.
//:
//: Licensed under the Apache License, Version 2.0 (the "License");
//: you may not use this file except in compliance with the License.
//: You may obtain a copy of the Licen... | jedesah/remotely | core/src/main/scala/transport/netty/Transport.scala | Scala | apache-2.0 | 6,838 |
/**
* 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-it/src/it/scala/cmwell/it/SparqlTests.scala | Scala | apache-2.0 | 5,332 |
package techex.domain
import org.joda.time.Instant
import techex.data.{EnterObservation, ExitObservation}
import scalaz.Scalaz._
import scalaz.{Tree, _}
object areas {
val somewhere = Area("somewhere")
val foyer = Area("foyer")
val toiletAtSamf = Area("toilet @ Samfundet")
val toiletAtSeminar... | kantega/tech-ex-2015 | backend/src/main/scala/techex/domain/areas.scala | Scala | mit | 8,111 |
/**
* Copyright (C) 2012-2013 Kaj Magnus Lindberg (born 1979)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later vers... | debiki/debiki-server-old | modules/debiki-core/src/test/scala/com/debiki/core/PagePartsDeletionTest.scala | Scala | agpl-3.0 | 3,366 |
package com.twitter.finagle.factory
import com.twitter.finagle._
import com.twitter.finagle.client.LatencyCompensation
import com.twitter.util.{Duration, Future, Timer}
object TimeoutFactory {
/**
* A class eligible for configuring a [[com.twitter.finagle.Stackable]]
* [[com.twitter.finagle.factory.TimeoutFa... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/factory/TimeoutFactory.scala | Scala | apache-2.0 | 2,530 |
package org.sofi.deadman.test.view
import org.sofi.deadman.component.view._
import org.sofi.deadman.messages.command._
import org.sofi.deadman.messages.query._
import org.sofi.deadman.test.TestSystem
import scala.concurrent.duration._
final class AggregateViewTest extends TestSystem {
// View
private val viewAct... | SocialFinance/deadman-switch | core/src/test/scala/org/sofi/deadman/test/view/AggregateViewTest.scala | Scala | bsd-3-clause | 1,187 |
package org.locationtech.geomesa.jobs.mapreduce
import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat
import org.apache.accumulo.core.client.security.tokens.{AuthenticationToken, PasswordToken}
import org.apache.accumulo.core.security.Authorizations
import org.apache.hadoop.mapreduce.Job
import org.loca... | drackaer/geomesa | geomesa-jobs/src/main/scala/org/locationtech/geomesa/jobs/mapreduce/InputFormatBaseAdapter.scala | Scala | apache-2.0 | 3,022 |
package com.automatak.dnp3.codegen
import java.lang.reflect.{Constructor, Method, Field}
object JNIMethod {
val classOfBool = classOf[java.lang.Boolean]
val classOfShort = classOf[java.lang.Short]
val classOfInt = classOf[java.lang.Integer]
val classOfLong = classOf[java.lang.Long]
val classOfFloat = class... | thiagoralves/OpenPLC_v2 | dnp3/java/codegen/src/main/scala/com/automatak/dnp3/codegen/JNIMethod.scala | Scala | gpl-3.0 | 6,559 |
/*
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 to in writing, software
distr... | jzmq/scalding | scalding-core/src/main/scala/com/twitter/scalding/typed/KeyedList.scala | Scala | apache-2.0 | 13,656 |
package me.eax.examples.thrift.tests
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
import me.eax.examples.thrift.game._
import me.eax.examples.thrift.tests.gen._
import org.apache.thrift.protocol._
import org.apache.thrift.transport._
import org.scalatest._
import org.scalatest.prop._
class BinaryProt... | afiskon/scala-thrift-example | src/test/scala/me/eax/examples/thrift/tests/BinaryProtocol.scala | Scala | mit | 1,721 |
package pl.setblack.lsa.cryptotpyrc
import scala.concurrent.Future
trait CryptoKey {
def export : Future[String]
}
trait PrivateKey extends CryptoKey
trait PublicKey extends CryptoKey
case class KeyPair[PUBLIC, PRIVATE](pub : PUBLIC, priv: PRIVATE) {
} | lightserver/cryptotpyrc | app/shared/src/main/scala/pl/setblack/lsa/cryptotpyrc/CryptoKey.scala | Scala | bsd-3-clause | 260 |
/*
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 to in writing, software
distr... | twitter/summingbird | summingbird-online/src/main/scala/com/twitter/summingbird/online/OnlineDefaultConstants.scala | Scala | apache-2.0 | 2,270 |
/* =========================================================================================
* Copyright © 2013-2014 the kamon project <http://kamon.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 th... | kamon-io/sigar-loader | project/SigarRepack.scala | Scala | apache-2.0 | 5,341 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | hequn8128/flink | flink-libraries/flink-gelly-scala/src/test/scala/org/apache/flink/graph/scala/test/TestGraphUtils.scala | Scala | apache-2.0 | 1,961 |
import language.higherKinds
trait T {
def t = 0
}
trait Foo {
def coflatMap[A <: T](f: A): A
}
object O extends Foo {
def coflatMap[A <: T](f: A) = {
val f2 = coflatMap(f) // inferred in 2.9.2 / 2.10.0 as [Nothing]
f2.t // so this does't type check.
f2
}
}
// Why? When a return t... | yusuke2255/dotty | tests/untried/pos/t7200b.scala | Scala | bsd-3-clause | 1,835 |
/* 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... | hlin117/factorie | src/main/scala/cc/factorie/app/topics/lda/LDA.scala | Scala | apache-2.0 | 26,418 |
package ueb02
/**
* Einfach vorwärts verkettete Liste von Ganzzahlen à la LISP.
* Eine Liste mit den Elementen 1, 2 und 3 kann gebildet werden durch new List(1, new List(2, new List(3,null)))
*
* Der Konstruktor entspricht dem CONS-Operation von LISP.
*
* @param head Inhalt eines Listenknotens
* @param tail Vor... | sebastian-dasse/uni-scala | ScalaKurs(Knabe)_S/src/ueb02/List.scala | Scala | mit | 789 |
package sttp.client3.impl.zio
import sttp.capabilities.Effect
import sttp.client3.testing.SttpBackendStub
import sttp.client3.{Request, Response, SttpBackend}
import sttp.model.StatusCode
import sttp.monad.MonadError
import zio.{Has, RIO, Ref, Tag, UIO, URIO, ZLayer}
trait SttpClientStubbingBase[R, P] {
type SttpC... | softwaremill/sttp | effects/zio1/src/main/scala/sttp/client3/impl/zio/SttpClientStubbingBase.scala | Scala | apache-2.0 | 3,699 |
package com.shocktrade.controlpanel.runtime
import scala.concurrent.{ExecutionContext, Future}
/**
* Represents an evaluatable value or expression
* @author Lawrence Daniels <lawrence.daniels@gmail.com>
*/
trait Evaluatable {
def eval(rc: RuntimeContext, scope: Scope)(implicit ec: ExecutionContext): Future[T... | ldaniels528/shocktrade.js | app/client/control_panel/src/main/scala/com/shocktrade/controlpanel/runtime/Evaluatable.scala | Scala | apache-2.0 | 333 |
package com.twitter.scrooge.ast
sealed abstract class Definition extends DefinitionNode {
val sid: SimpleID
}
case class ConstDefinition(
sid: SimpleID,
fieldType: FieldType,
value: RHS,
docstring: Option[String]
) extends Definition
case class Typedef(sid: SimpleID, fieldType: FieldType, annotations: Map... | elipoz/scrooge | scrooge-generator/src/main/scala/com/twitter/scrooge/AST/Definition.scala | Scala | apache-2.0 | 2,084 |
package sryza
import java.awt.event._
import java.awt.geom.AffineTransform
import java.awt.image.{AffineTransformOp, BufferedImage}
import java.awt._
import javax.imageio.ImageIO
import javax.swing.JPanel
import java.io.File
class NodesPanel(val cluster: Cluster) extends JPanel {
import NodesPanel._
setPreferredS... | sryza/clusters | src/main/scala/sryza/NodesPanel.scala | Scala | apache-2.0 | 3,929 |
package io.getquill.context.sql.idiom
import io.getquill.Spec
import io.getquill.context.sql.testContext._
import io.getquill.context.sql.SqlQuery
import scala.util.Try
import io.getquill.context.sql.norm.SqlNormalize
class VerifySqlQuerySpec extends Spec {
"fails if the query can't be translated to applicative jo... | getquill/quill | quill-sql/src/test/scala/io/getquill/context/sql/idiom/VerifySqlQuerySpec.scala | Scala | apache-2.0 | 1,904 |
package scintuit.contrib.play.data.api
import play.api.libs.json._
import play.api.libs.functional.syntax._
import scintuit.data.api.transaction._
import scintuit.contrib.play.data.raw
object transaction {
object TransactionFormats extends TransactionFormats
trait TransactionFormats {
import raw.transactio... | drbild/scintuit | contrib/play-json/src/main/scala/scintuit/contrib/play/data/api/transaction.scala | Scala | apache-2.0 | 4,506 |
package net.bhardy.braintree.scala.search
class KeyValueNode[T <: SearchRequest[T]](nodeName:String, parent:T) extends SearchNode[T](nodeName, parent) {
def is(value: AnyRef): T = {
parent.addKeyValueCriteria(nodeName.toString, value.toString)
}
} | benhardy/braintree-scala | src/main/scala/search/KeyValueNode.scala | Scala | mit | 257 |
/*
@meta {
"processorId": "org.helgoboss.scala_bundle:1.0.0",
"projectId": "org.helgoboss:app-info:1.0-SNAPSHOT",
"dependencies": [
"com.weiglewilczek.scala-lang-osgi:scala-library:2.9.1"
],
"transformers": [
"org.helgoboss.my_oss:1.0.0"
]
}
*/
package org.helgoboss.app_info
imp... | helgoboss/app-info | org.helgoboss.app-info.scala | Scala | mit | 521 |
/*
* Copyright 2017 Nicolas Rinaudo
*
* 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... | nrinaudo/kantan.mongodb | core/src/test/scala/kantan/mongodb/OptionCodecTests.scala | Scala | apache-2.0 | 811 |
package com.stevens.spark
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.hadoop.io._
import com.stevens.minhash._
object ShingleCounter extends App {
val shingleLength = args(0).toInt
val corpusSequence = args(1)
val outputLocati... | steven-s/minhash-document-clusters | src/main/scala/com/stevens/spark/ShingleCounter.scala | Scala | mit | 1,049 |
/*
* 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.partest
i... | martijnhoekstra/scala | src/partest/scala/tools/partest/CompilerTest.scala | Scala | apache-2.0 | 2,298 |
/*
* 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 ... | actuaryzhang/spark | sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala | Scala | apache-2.0 | 12,552 |
package edu.berkeley.nlp.coref
import scala.collection.JavaConverters._
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.HashMap
import scala.util.Random
import edu.berkeley.nlp.futile.util.Counter
import edu.berkeley.nlp.futile.util.Iterators
import edu.berkeley.nlp.futile.util.Logger
impor... | timfeu/berkeleycoref-thesaurus | src/main/java/edu/berkeley/nlp/coref/DocumentGraph.scala | Scala | gpl-3.0 | 18,850 |
package com.twitter.finatra.multiserver.Add1HttpServer
import com.twitter.finatra.http.HttpServer
import com.twitter.finatra.http.filters.CommonFilters
import com.twitter.finatra.http.routing.HttpRouter
import com.twitter.finatra.thrift.ThriftClientExceptionMapper
class Add1Server extends HttpServer {
override val ... | joecwu/finatra | inject-thrift-client-http-mapper/src/test/scala/com/twitter/finatra/multiserver/Add1HttpServer/Add1Server.scala | Scala | apache-2.0 | 537 |
/*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | hmrc/pensions-lifetime-allowance-frontend | app/models/SummarySectionModel.scala | Scala | apache-2.0 | 685 |
package com.xenopsconsulting.gamedayapi
import fetchstrategies.{DefaultFetchStrategy, FetchStrategy}
import xml.{Node, Elem}
import java.util.Date
case class EpgGame(gameNode: Node) {
def id():String = (gameNode \\ "@id").text
def gameday():String = (gameNode \\ "@gameday").text
def ind(): String = (gameNode \... | ecopony/scala-gameday-api | src/main/scala/com/xenopsconsulting/gamedayapi/EpgGame.scala | Scala | mit | 1,048 |
/**
* Licensed to Big Data Genomics (BDG) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The BDG licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use ... | tdanford/adam | adam-core/src/main/scala/org/bdgenomics/adam/projections/Projection.scala | Scala | apache-2.0 | 2,582 |
package im.actor.api.rpc
import akka.actor._
import cats.data.Xor
import im.actor.api.rpc.CommonRpcErrors.InvalidAccessHash
import im.actor.api.rpc.peers._
import im.actor.server.acl.ACLUtils
import im.actor.server.api.rpc.service.groups.GroupRpcErrors
import im.actor.server.db.DbExtension
import im.actor.server.group... | ljshj/actor-platform | actor-server/actor-rpc-api/src/main/scala/im/actor/api/rpc/PeerHelpers.scala | Scala | mit | 9,639 |
package pl.tk.scalaconstructs.typeclasses
import java.net.URL
import java.nio.file.{Paths, Path}
/**
* Created by tomaszk on 17.02.14.
*/
object ImplicitClasses {
implicit class UrlWithDownloadMethod(url:URL) {
def download(where:Path) {
println(s"Downloading $url to ${where.toAbsolut... | almendar/scala-constructs-learn | src/main/scala/pl/tk/scalaconstructs/typeclasses/ImplicitClasses.scala | Scala | apache-2.0 | 482 |
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.