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 |
|---|---|---|---|---|---|
import stainless.collection._
object Example {
def tails[T] (l: List[T]) : List[List[T]] = l match {
case Cons(_, tl) => Cons(tl, tails(tl))
case Nil() => List(Nil())
}
}
| epfl-lara/stainless | frontends/benchmarks/coq/ListExample.scala | Scala | apache-2.0 | 184 |
package respite
import sbt.Keys._
import sbt._
object Dependencies {
object Versions {
val ScalaVersion = "2.10.3"
val ScalatraVersion = "2.2.2"
}
object Compile {
import Versions._
val scalatra = "org.scalatra" %% "scalatra" % ScalatraVersion
val sca... | mefellows/respite | project/Dependencies.scala | Scala | mit | 3,719 |
/*
* Copyright (C) 2012 The Regents of The University California.
* 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 License at
*
* http://www.apache.org/licenses/LICENS... | sameeragarwal/blinkdb | src/main/scala/shark/memstore2/MemoryTable.scala | Scala | apache-2.0 | 2,854 |
package com.github.mdr.mash.view.render
import java.nio.file.Paths
import java.time.Clock
import java.time.temporal.ChronoUnit
import com.github.mdr.mash.view.render.IncrementalHistorySearchRenderer.renderHistorySearchState
import com.github.mdr.mash.repl.IncrementalHistorySearchState
import com.github.mdr.mash.repl.... | mdr/mash | src/test/scala/com/github/mdr/mash/view/render/IncrementalHistorySearchRendererTest.scala | Scala | mit | 1,797 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | JerryYanWan/BigDL | spark/dl/src/main/scala/com/intel/analytics/bigdl/nn/TimeDistributed.scala | Scala | apache-2.0 | 7,545 |
package com.rasterfoundry.database
import com.rasterfoundry.database.Implicits._
import com.rasterfoundry.datamodel.Datasource
import doobie._
import doobie.implicits._
import doobie.implicits.javasql._
import doobie.postgres.circe.jsonb.implicits._
import doobie.postgres.implicits._
import java.util.UUID
object Pr... | raster-foundry/raster-foundry | app-backend/db/src/main/scala/ProjectLayerDatasourcesDao.scala | Scala | apache-2.0 | 944 |
package nodes.images
import breeze.linalg._
import breeze.stats._
import org.scalatest.FunSuite
import pipelines.Logging
import utils._
import utils.TestUtils._
import scala.util.Random
class ImageBenchMarkSuite extends FunSuite with Logging {
case class TestParam(name: String, size: (Int, Int, Int), kernelSize: ... | tomerk/keystone | src/test/scala/nodes/images/ImageBenchMarkSuite.scala | Scala | apache-2.0 | 4,705 |
package com.realizationtime.btdogg.utils
import java.nio.file.{Files, Path}
import java.nio.file.StandardCopyOption.REPLACE_EXISTING
import com.realizationtime.btdogg.BtDoggConfiguration
import com.realizationtime.btdogg.commons.ParsingResult
import com.typesafe.scalalogging.Logger
object FileUtils {
private val ... | bwrega/btdogg | src/main/scala/com/realizationtime/btdogg/utils/FileUtils.scala | Scala | mit | 1,243 |
import akka.actor.{ActorSystem, Actor, ActorRef, Props, PoisonPill}
import scala.concurrent.duration._
case object Ping
case object Pong
object Pinger {
case object Pong
}
object Ponger {
case object Ping
}
class Pinger extends Actor {
var countdown = 50
def receive = {
case Pong =>
println(s"${s... | sushruta/Akka-Exploration | tutorial/pingpong/src/main/scala/PingPong.scala | Scala | mit | 1,019 |
/*
* OpenSRS -- a Scala library for using the OpenSRS API
* Copyright (C) 2016 James Edwin Cain (user opensrs, domain jcain.net)
*
* This file is part of the net.jcain.opensrs library. This Library is free
* software; you may redistribute it or modify it under the terms of the
* license contained in the file LIC... | jec/OpenSRS | src/test/scala/net/jcain/opensrs/response/BadRequestSpec.scala | Scala | bsd-3-clause | 2,073 |
/*
* Copyright (C) 2009-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package play.api.mvc
import java.io._
import java.nio.file.Files
import java.util.Locale
import javax.inject.Inject
import akka.actor.ActorSystem
import akka.stream._
import akka.stream.scaladsl.{ Flow, Sink, StreamConverters }
import akka.... | Shenker93/playframework | framework/src/play/src/main/scala/play/api/mvc/BodyParsers.scala | Scala | apache-2.0 | 34,784 |
/**
* Copyright 2015 Mohiva Organisation (license at mohiva dot 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 req... | cemcatik/play-silhouette | silhouette/test/com/mohiva/play/silhouette/impl/util/PlayCacheLayerSpec.scala | Scala | apache-2.0 | 1,997 |
package controllers
import javax.inject._
import models._
import play.api.data.Form
import play.api.data.Forms._
import play.api.data.validation.Constraints._
import play.api.i18n._
import play.api.libs.json.Json
import play.api.mvc._
import scala.concurrent.{ExecutionContext, Future}
class PersonController @Inject... | play2-maven-plugin/play2-maven-test-projects | play28/scala/slick-example/app/controllers/PersonController.scala | Scala | apache-2.0 | 2,518 |
package net.revenj
import net.revenj.patterns.{EventStoreAspect, ReportAspect}
import org.specs2.ScalaCheck
import org.specs2.mutable.Specification
class AspectCheck extends Specification with ScalaCheck {
"services loading" >> {
"will load report aspect" >> {
val plugins = new ServicesPluginLoader(Thread... | ngs-doo/revenj | scala/revenj-core/src/test/scala/net/revenj/AspectCheck.scala | Scala | bsd-3-clause | 682 |
package pl.touk.nussknacker.engine.management.periodic
import com.typesafe.scalalogging.LazyLogging
import pl.touk.nussknacker.engine.canonicalgraph.CanonicalProcess
import pl.touk.nussknacker.engine.management.periodic.CronSchedulePropertyExtractor.CronPropertyDefaultName
import java.time.Clock
trait ScheduleProper... | TouK/nussknacker | engine/flink/management/periodic/src/main/scala/pl/touk/nussknacker/engine/management/periodic/SchedulePropertyExtractor.scala | Scala | apache-2.0 | 1,300 |
package com.overviewdocs.models
import java.time.Instant
import org.specs2.mutable.Specification
import com.overviewdocs.test.factories.{PodoFactory=>factory}
class ImportJobSpec extends Specification {
"CloneImportJob" should {
"give progress=0 at step 0" in {
CloneImportJob(factory.cloneJob()).progress... | overview/overview-server | common/src/test/scala/com/overviewdocs/models/ImportJobSpec.scala | Scala | agpl-3.0 | 6,224 |
/*
* Copyright 2001-2010 Stephen Colebourne
*
* 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... | aparo/scalajs-joda | src/main/scala/org/joda/time/base/AbstractDuration.scala | Scala | apache-2.0 | 6,363 |
package com.lrs.common.dao
import com.lrs.common.models._
import org.mongodb.scala.model.Accumulators._
import org.mongodb.scala.model.Aggregates._
import org.mongodb.scala.model.Filters._
import org.mongodb.scala.model.FindOneAndReplaceOptions
import org.mongodb.scala.model.Projections._
import org.mongodb.scala.{Doc... | edmundgmail/HighwaySystem | highway-common/src/main/scala/com/lrs/common/dao/MongoUtils.scala | Scala | apache-2.0 | 3,409 |
package de.fuberlin.wiwiss.silk.plugins.transformer.linguistic
import de.fuberlin.wiwiss.silk.runtime.plugin.Plugin
import com.rockymadden.stringmetric.phonetic.{RefinedNysiisAlgorithm, NysiisAlgorithm}
import de.fuberlin.wiwiss.silk.linkagerule.input.SimpleTransformer
@Plugin(
id = "NYSIIS",
categories = Array("... | fusepoolP3/p3-silk | silk-core/src/main/scala/de/fuberlin/wiwiss/silk/plugins/transformer/linguistic/NysiisTransformer.scala | Scala | apache-2.0 | 741 |
/*
* 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... | arktekk/anti-xml | src/test/scala/com/codecommit/antixml/util/VectorCaseSpecs.scala | Scala | bsd-3-clause | 11,937 |
package kogu.practice.fpinscala.applicative
trait Functor[F[_]] {
def map[A, B](fa: F[A])(f: A => B): F[B]
def distribute[A, B](fab: F[(A, B)]): (F[A], F[B]) =
(map(fab)(_._1), map(fab)(_._2))
def codistribute[A, B](e: Either[F[A], F[B]]): F[Either[A, B]] = e match {
case Left(fa) => map(fa)(Left(_))
... | kogupta/scala-playground | src/main/scala/kogu/practice/fpinscala/applicative/Functor.scala | Scala | apache-2.0 | 1,016 |
package almhirt.snapshots
import akka.actor._
import almhirt.common._
import almhirt.aggregates.{ AggregateRootId, AggregateRootVersion, AggregateRoot }
import almhirt.context.AlmhirtContext
import almhirt.akkax._
object InMemorySnapshotRepository {
def propsRaw(readonly: Boolean): Props = Props(new InMemorySnapsho... | chridou/almhirt | almhirt-core/src/main/scala/almhirt/snapshots/InMemorySnapshotRepository.scala | Scala | apache-2.0 | 2,458 |
/*
* Copyright 2020 Precog Data
*
* 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 ... | quasar-analytics/quasar | qsu/src/main/scala/quasar/qsu/Bucketing.scala | Scala | apache-2.0 | 3,646 |
/*
* Copyright (c) 2014. Regents of the University of California
*
* 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 require... | fnothaft/avocado | avocado-core/src/main/scala/edu/berkeley/cs/amplab/avocado/partitioners/Partitioner.scala | Scala | apache-2.0 | 1,479 |
package mockingbird
import com.twitter.app.Flag
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.param.{Stats, Label}
import com.twitter.finagle.stats.Counter
import com.twitter.finagle.{Http, Service}
import com.twitter.server.TwitterServer
import com.twitter.util.{Await, FuturePool}
imp... | wslulciuc/mockingbird | src/jvm/mockingbird/Api.scala | Scala | mit | 1,714 |
import buccaneer.{Formatter, ManConfig}
class FormatterSpec extends DefaultTestSuite {
"A Formatter" should {
val config = ManConfig.man(textWidth = 10, indentation = 0, columnSpacing = 1)
// "have an identity" in {
// forAll { (v: Vector[Char]) =>
// (Formatter(v) absorb Formatter.e... | AvramRobert/buccaneer | src/test/scala/FormatterSpec.scala | Scala | apache-2.0 | 2,697 |
package circumflex
package cluster
import core._, xml._, cache._
import java.io.File
import java.util.regex.Pattern
import org.apache.commons.io.FileUtils
/*! Server tasks are configured for execution at deploy time.
They report their output into `currentMonitor`. */
trait ServerTask extends ElemHolder {
val _titl... | inca/circumflex | cluster/src/main/scala/task.scala | Scala | bsd-2-clause | 3,029 |
package com.github.opengrabeso.collections
import java.util.NoSuchElementException
object CyclicVector {
def empty[T] = new CyclicVector[T](Vector.empty, 0, 0)
}
case class CyclicVector[T](private val data: Vector[T], private val headIndex: Int, size: Int) {
def modIndex(i: Int) = if (data.nonEmpty) i % data.si... | OndrejSpanel/Stravamat | shared/src/main/scala/com/github/opengrabeso/collections/CyclicVector.scala | Scala | gpl-2.0 | 865 |
/*
* 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 ... | apache/forrest | whiteboard/f9/src/main/scala/org/apache/forrest/f9/task/InitTask.scala | Scala | apache-2.0 | 2,001 |
package com.wavesplatform.lang.v1.estimator.v3
import com.wavesplatform.lang.ExecutionError
import com.wavesplatform.lang.v1.FunctionHeader
import com.wavesplatform.lang.v1.task.TaskM
import monix.eval.Coeval
import shapeless.{Lens, lens}
private[v3] case class EstimatorContext(
funcs: Map[FunctionHeader, (Coeval... | wavesplatform/Waves | lang/shared/src/main/scala/com/wavesplatform/lang/v1/estimator/v3/EstimatorContext.scala | Scala | mit | 775 |
package sc.ala.rubyist
/**
* Intに対する拡張機能
*/
object Times {
/**
* n回繰り返す
* (0もしくは負値の場合は一度も実行されない)
*
* @example {{{
* def foo: Unit = ...
* 5 times { foo }
* }}}
*/
implicit class Times(val n: Int) extends AnyVal {
def times[A](f: => A): Unit = { for(_ <- 1 to n) f }
}
}
| maiha/rubyist | src/main/scala/sc/ala/rubyist/Times.scala | Scala | mit | 375 |
// See LICENSE for license details.
package junctions
import Chisel._
import cde.{Parameters, Field}
import scala.collection.mutable.HashMap
case object PAddrBits extends Field[Int]
case object VAddrBits extends Field[Int]
case object PgIdxBits extends Field[Int]
case object PgLevels extends Field[Int]
case object P... | masc-ucsc/cmpe220fall16 | riscv_cores/zscale_modified/junctions/src/main/scala/addrmap.scala | Scala | apache-2.0 | 4,399 |
package controllers
import java.io.File
import java.net.URLDecoder
import java.util.UUID
import akka.actor._
import akka.pattern.ask
import akka.util.Timeout
import notebook.NBSerializer.Metadata
import notebook._
import notebook.server._
import play.api.Play.current
import play.api._
import play.api.http.HeaderNames... | meh-ninja/spark-notebook | app/controllers/Application.scala | Scala | apache-2.0 | 24,205 |
/*
* Copyright (C) 2015 Stratio (http://stratio.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 required by app... | danielcsant/sparta | serving-core/src/main/scala/com/stratio/sparta/serving/core/dao/ErrorDAO.scala | Scala | apache-2.0 | 1,609 |
/*
* 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 agreed to... | datamountaineer/stream-reactor | kafka-connect-azure-documentdb/src/test/scala/com/datamountaineer/streamreactor/connect/azure/documentdb/config/DocumentDbSinkSettingsTest.scala | Scala | apache-2.0 | 5,943 |
/*
* 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-cli/src/main/scala/com/loopfor/zookeeper/cli/Reader.scala | Scala | apache-2.0 | 3,017 |
/*
* Copyright (c) 2014-2018 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... | Wogan/monix | monix-reactive/shared/src/main/scala/monix/reactive/subjects/AsyncSubject.scala | Scala | apache-2.0 | 3,842 |
package org.jetbrains.plugins.scala.failed.typeInference
import org.jetbrains.plugins.scala.PerfCycleTests
import org.jetbrains.plugins.scala.base.{ScalaLightCodeInsightFixtureTestAdapter, SimpleTestCase}
import org.junit.experimental.categories.Category
/**
* @author Roman.Shein
* @since 28.03.2016.
*/
@Catego... | whorbowicz/intellij-scala | test/org/jetbrains/plugins/scala/failed/typeInference/VarArgsInCurlyBracesTest.scala | Scala | apache-2.0 | 621 |
package net.liftmodules.ng.js
import net.liftweb._
import http.js._
import json._
import JsCmds._
import JE._
/**
* Contains utility for generating a JsCmd that will convert one JSON object into another. This utility is meant
* to be optimal for minor changes to a model object. Large model changes will not benefi... | joescii/lift-ng | src/main/scala/net/liftmodules/ng/js/JsonDeltaFuncs.scala | Scala | apache-2.0 | 2,715 |
package com.github.wakfudecrypt.types.data
import com.github.wakfudecrypt._
@BinaryDecoder
case class RegistrationEvent(
_0_int32: Int,
_1_int32: Int,
_2_int32: Int,
_3_array_int64: Array[Long],
_4_int32: Int,
_5_int32: Int
)
object RegistrationEvent extends BinaryDataCompanion[RegistrationEvent] {
ove... | jac3km4/wakfudecrypt | types/src/main/scala/com/github/wakfudecrypt/types/data/RegistrationEvent.scala | Scala | mit | 344 |
package com.sksamuel.elastic4s.searches.aggs
import com.sksamuel.elastic4s.script.Script
import com.sksamuel.exts.OptionImplicits._
case class ScriptedMetricAggregation(name: String,
initScript: Option[Script] = None,
mapScript: Option[Script] ... | Tecsisa/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/searches/aggs/ScriptedMetricAggregation.scala | Scala | apache-2.0 | 1,457 |
/*
* Copyright (c) 2012-2019 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... | RetentionGrid/snowplow | 3-enrich/scala-common-enrich/project/BuildSettings.scala | Scala | apache-2.0 | 3,483 |
package com.avsystem.scex.compiler
import java.{lang => jl, util => ju}
import com.avsystem.scex.parsing.ScalaParsingCommons
/**
* Created: 31-10-2014
* Author: ghik
*/
class ScalaParsingCommonsTest extends ScexFunSuite {
import com.avsystem.scex.parsing.ScalaParsingCommons._
def success(parser: Parser[Stri... | pnf/scex | scex-derived/src/test/scala/com/avsystem/scex/compiler/ScalaParsingCommonsTest.scala | Scala | apache-2.0 | 908 |
/*
* 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... | jedesah/Quasar | sparkcore/src/test/scala/quasar/physical/sparkcore/fs/hdfs/HdfsPackageSpec.scala | Scala | apache-2.0 | 1,377 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2014 Matthias Langer (t3l@threelights.de)
*
* 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.apa... | bashimao/ltudl | blaze/src/main/scala/edu/latrobe/blaze/modules/SquaredErrorConstraint.scala | Scala | apache-2.0 | 4,193 |
/*
* Copyright 2016 Alexey Kuzin <amkuzink@gmail.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 required by applicab... | leviathan941/choiceroulette | guiapp/src/main/scala/choiceroulette/gui/controls/preferences/PreferencesController.scala | Scala | apache-2.0 | 1,397 |
/*
* 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-examples/src/test/scala/com/spotify/scio/examples/cookbook/BigQueryTornadoesTest.scala | Scala | apache-2.0 | 1,481 |
package im.actor.server.office
import akka.util.Timeout
import im.actor.api.rpc.messaging._
import im.actor.api.rpc.peers.{ Peer, PeerType }
import im.actor.server.group.{ GroupExtension, GroupOffice }
import scala.concurrent.{ ExecutionContext, Future }
trait PeerProcessor[State <: ProcessorState, Event <: AnyRef] ... | luoxiaoshenghustedu/actor-platform | actor-server/actor-core/src/main/scala/im/actor/server/office/PeerProcessor.scala | Scala | mit | 1,564 |
package org.littlewings.hazelcast.configurationtest
import com.hazelcast.core.{Hazelcast, HazelcastInstance}
import com.hazelcast.config.ClasspathXmlConfig
import org.scalatest.{BeforeAndAfterAll,FunSpec}
import org.scalatest.Matchers._
class HazelcastConfigurationSpec extends FunSpec with BeforeAndAfterAll {
// テ... | kazuhira-r/hazelcast-examples | hazelcast-configuration/src/test/scala/org/littlewings/hazelcast/configurationtest/HazelcastConfigurationSpec.scala | Scala | mit | 3,249 |
package gg.uhc.hosts.endpoints.users
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
class UsersRoute(showPermissionsForUser: ShowPermissionsForUser) {
// GET /{username}/permissions list -> lists all permissions for given username
def apply(): Route =
pathPrefix(Segment... | Eluinhost/hosts.uhc.gg | src/main/scala/gg/uhc/hosts/endpoints/users/UsersRoute.scala | Scala | mit | 412 |
package com.sksamuel.elastic4s.requests.searches.queries.nested
import com.sksamuel.elastic4s.EnumConversions
import com.sksamuel.elastic4s.json.{XContentBuilder, XContentFactory}
import com.sksamuel.elastic4s.requests.searches.queries.{NestedQuery, QueryBuilderFn}
object NestedQueryBodyFn {
def apply(q: NestedQuer... | stringbean/elastic4s | elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/queries/nested/NestedQueryBodyFn.scala | Scala | apache-2.0 | 909 |
// Copyright (C) 2011-2012 the original author or authors.
// See the LICENCE.txt file distributed with this work for additional
// information regarding copyright ownership.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You ... | chrisjwwalker/cjww-diagnostics | app/controllers/ExternalServicesController.scala | Scala | apache-2.0 | 859 |
import scala.tools.nsc.doc.model._
import scala.tools.partest.ScaladocModelTest
import language._
object Test extends ScaladocModelTest {
override def code = """
import scala.reflect.macros.blackbox.Context
import language.experimental.macros
object Macros {
def impl(c: Context) = c.literalUnit
... | scala/scala | test/scaladoc/run/t6812.scala | Scala | apache-2.0 | 568 |
/*
* 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 ... | Swrrt/Samza | samza-core/src/main/scala/org/apache/samza/container/SamzaContainer.scala | Scala | apache-2.0 | 42,452 |
/*
* 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 | external/kafka/src/main/scala/org/apache/spark/streaming/kafka/Broker.scala | Scala | apache-2.0 | 1,959 |
package com.lightning.walletapp.lnutils
import spray.json._
import android.os.Environment._
import com.lightning.walletapp.ln._
import com.lightning.walletapp.lnutils.ImplicitJsonFormats._
import com.lightning.walletapp.lnutils.JsonHttpUtils.to
import com.lightning.walletapp.ln.wire.LocalBackups
import android.support... | btcontract/lnwallet | app/src/main/java/com/lightning/walletapp/lnutils/LocalBackup.scala | Scala | apache-2.0 | 3,216 |
/*
* 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/model/exchange/sift/GeneralQuestionsAnswers.scala | Scala | apache-2.0 | 2,356 |
/*
* Copyright (c) 2012-2018 Broad Institute, Inc.
*
* This file is part of Pilon.
*
* Pilon is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* Pilon is distributed in the hope that it will... | B-UMMI/INNUca | src/pilon_v1.23/pilon/src/main/scala/org/broadinstitute/pilon/Region.scala | Scala | gpl-3.0 | 1,821 |
package edu.rice.habanero.benchmarks.banking
import akka.actor.{ActorRef, CustomStash, Props}
import akka.util.Timeout
import edu.rice.habanero.actors.{AkkaActor, AkkaActorState}
import edu.rice.habanero.benchmarks.banking.BankingConfig._
import edu.rice.habanero.benchmarks.{Benchmark, BenchmarkRunner, PseudoRandom}
... | shamsmahmood/savina | src/main/scala/edu/rice/habanero/benchmarks/banking/BankingAkkaBecomeExtActorBenchmark.scala | Scala | gpl-2.0 | 4,041 |
/* Data Structures: Options
An Option is a container that may or may
not hold something. Think of it as a List
that holds *at most* one element.
It provides a safe alternative to the use of null,
and should be used instead of null whenever possible
*/
| agconti/scala-school | 01-intro-to-scala/slides/slide032.scala | Scala | mit | 259 |
/*
* P27.scala
* Copyright (C) 2017 n3xtchen <echenwen@gmail.com>
*
* Distributed under terms of the GPL-2.0 license.
*/
package nextchen
import P26.combinations
object P27 {
// scala> group3(List("Aldo", "Beat", "Carla", "David", "Evi", "Flip", "Gary", "Hugo", "Ida"))
// res0: List[List[List[String]]] = List... | n3xtchen/s-99 | src/main/scala/nextchen/P27.scala | Scala | mit | 1,333 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/friesian/src/main/scala/com/intel/analytics/bigdl/friesian/serving/utils/recall/RecallUtils.scala | Scala | apache-2.0 | 2,533 |
package dbtarzan.gui.table
import scala.collection.mutable.ListBuffer
import dbtarzan.db.Row
/* The checked rows in the table. Filled up every time the user chcecks or unchecks a row */
class CheckedRowsBuffer {
val selected = new ListBuffer[Row]()
def add(row : Row) : Unit = selected += row
def remove(row : Row... | aferrandi/dbtarzan | src/main/scala/dbtarzan/gui/table/CheckedRowsBuffer.scala | Scala | apache-2.0 | 388 |
/*
Copyright (c) 2013-2016 Karol M. Stasiak
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, merge, publish, distr... | KarolS/units | units/src/main/scala/io/github/karols/units/utils/TimeUtils.scala | Scala | mit | 3,757 |
import scala.language.higherKinds
class D[T]
class C[F[_]](val i: Int)
object C {
def apply[F[_]](implicit cf: C[F]): Int = cf.i
implicit def c0[F[_]]: C[F] = new C[F](0)
implicit def c1: C[D] = new C[D](1)
}
object Test extends App {
assert(C[D] == 1) // Works in Dotty ...
}
| martijnhoekstra/scala | test/files/run/t10545.scala | Scala | apache-2.0 | 289 |
/*
MET-API
Copyright (C) 2014 met.no
Contact information:
Norwegian Meteorological Institute
Box 43 Blindern
0313 OSLO
NORWAY
E-mail: met-api@met.no
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... | metno/metapi-elements | test/TestUtil.scala | Scala | gpl-2.0 | 1,488 |
package capitulo09
import java.io.FileInputStream
import java.io.FileOutputStream
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import scala.collection.mutable.ArrayBuffer
/**
* A trait Serializ... | celioeduardo/scala-impatient | src/test/scala/capitulo09/Serializacao.scala | Scala | mit | 1,357 |
import stainless.lang._
object ObjectHierarchyMutation3 {
case class A(var x: Int, var y: Int, var z: Int)
case class B(a1: A, a2: A, a3: A)
def update(b: B): Int = {
b.a2.y = 17
b.a2.y
} ensuring(res => res == 17)
def f(): Int = {
val b = B(A(10, 11, 12), A(11, 12, 13), A(13, 14, 15))
upd... | epfl-lara/stainless | frontends/benchmarks/imperative/valid/ObjectHierarchyMutation3.scala | Scala | apache-2.0 | 372 |
/*
This code is intended to be run in the Scala shell.
Launch the Scala Spark shell by running ./bin/spark-shell from the Spark directory.
You can enter each line in the shell and see the result immediately.
The expected output in the Spark console is presented as commented lines following the
relevant code
The... | PacktPublishing/Machine-Learning-with-Spark | Chapter-08/scala-shell-code_08.scala | Scala | mit | 9,394 |
package concrete.constraint.linear
import org.scalatest.Matchers
import org.scalatest.FlatSpec
import concrete.IntDomain
import concrete.Variable
import concrete.ParameterManager
import concrete.Problem
import concrete.constraint.AdviseCount
import concrete.Assignment
class LinearTest extends FlatSpec with Matchers {... | concrete-cp/concrete | src/test/scala/concrete/constraint/linear/LinearTest.scala | Scala | lgpl-2.1 | 1,662 |
/**
* Copyright (c) 2013, The National Archives <digitalpreservation@nationalarchives.gov.uk>
* http://www.nationalarchives.gov.uk
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozi... | valydia/csv-validator | csv-validator-core/src/test/scala/uk/gov/nationalarchives/csv/validator/schema/v1_1/SwitchRuleSpec.scala | Scala | mpl-2.0 | 4,607 |
/*
* 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 ... | sahilTakiar/spark | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala | Scala | apache-2.0 | 22,329 |
/*
* Copyright 2011 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 t... | folone/util | util-logging/src/test/scala/com/twitter/logging/QueueingHandlerTest.scala | Scala | apache-2.0 | 6,014 |
package io.getquill
import com.orientechnologies.orient.core.record.impl.ODocument
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery
import com.typesafe.config.Config
import io.getquill.context.ExecutionInfo
import io.getquill.context.orientdb.OrientDBSessionContext
import io.getquill.util.{ ContextLog... | getquill/quill | quill-orientdb/src/main/scala/io/getquill/OrientDBSyncContext.scala | Scala | apache-2.0 | 3,188 |
/*
* Copyright (c) 2016 SnappyData, Inc. 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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | vjr/snappydata | cluster/src/main/scala/org/apache/spark/memory/SnappyMemoryUtils.scala | Scala | apache-2.0 | 1,344 |
package org.hello.bar
object Bar {
private val timing = System.currentTimeMillis
def showTiming: Long = this.timing
def main(args:Array[String]) {
println("Bar")
}
}
| sadikovi/sbt-multi-project-example | bar/src/main/scala/Bar.scala | Scala | mit | 194 |
package es.imim.phi.collector.test
import es.imim.phi.collector.engine.ExtractionEngine
import es.imim.phi.collector.ops.lda_api.OPSLDAScala
import java.io.PrintWriter
import java.io.File
object testeTOXshortList extends App {
ExtractionEngine.initEngine("/opt/collector")
//val opsAPI = new OPSLDAScala13("https... | OriolLopezMassaguer/Collector | app/es/imim/phi/collector/test/testeTOX_shortList.scala | Scala | gpl-3.0 | 925 |
object Test {
val f : PartialFunction[_, Int] = { case a : Int => a } // undefined param
def foo[A](pf: PartialFunction[A, Int]): Unit = {};
foo { case a : Int => a } // undefined param
val g : PartialFunction[Int, _] = { case a : Int => a } // okay
}
// Another variation, seen in the wild with Specs2.
class X ... | AlexSikia/dotty | tests/untried/neg/t6258.scala | Scala | bsd-3-clause | 562 |
/***********************************************************************
* 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-utils/src/main/scala/org/locationtech/geomesa/utils/text/StringSerialization.scala | Scala | apache-2.0 | 6,436 |
/**
* Copyright (C) 2013 Orbeon, Inc.
*
* 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
* 2.1 of the License, or (at your option) any later version.
*
* This program i... | joansmith/orbeon-forms | src/main/scala/org/orbeon/oxf/fr/FormRunnerErrorSummary.scala | Scala | lgpl-2.1 | 6,206 |
/*
* 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 ... | sparklingpandas/sparklingml | src/test/scala/com/sparklingpandas/sparklingml/param/SharedParamsCodeGenTest.scala | Scala | apache-2.0 | 1,226 |
/*
* Copyright (c) 2013-2015 Erik van Oosten
*
* 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 ... | maciej/metrics-scala | src/test/scala/nl/grons/metrics/scala/CounterSpec.scala | Scala | apache-2.0 | 2,783 |
package com.twitter.inject.conversions
import scala.collection.compat.BuildFrom
import scala.collection.mutable.{HashSet => MutableHashSet}
import scala.language.higherKinds
object iterable {
implicit class RichIterable[Elem, From[Elem] <: Iterable[Elem]](val self: From[Elem])
extends AnyVal {
/**
... | twitter/finatra | inject/inject-utils/src/main/scala/com/twitter/inject/conversions/iterable.scala | Scala | apache-2.0 | 907 |
import com.trolltech.qt.gui._
class MyMainWindow extends QWidget
{
def showWindow =
{
setWindowTitle("Scala Jambi Test")
resize(250, 250)
move(300, 300)
show()
}
}
object MainApp
{
def main(args: Array[String])
{
val app = new QApplication(args)
new MyMainWindow().showWindow
app.... | Dmohit/qtj-plotter | scala_examples/scala_hello.scala | Scala | gpl-3.0 | 331 |
package mesosphere.marathon.integration
import java.io.File
import mesosphere.marathon.integration.setup.{ ProcessKeeper, IntegrationFunSuite }
import org.scalatest.{ GivenWhenThen, BeforeAndAfter, Matchers }
class MarathonCommandLineHelpTest
extends IntegrationFunSuite
with Matchers
with BeforeAndAfter
... | sepiroth887/marathon | src/test/scala/mesosphere/marathon/integration/MarathonCommandLineHelpTest.scala | Scala | apache-2.0 | 657 |
/*
* Copyright 2014 Joshua R. Rodgers
*
* 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... | Mr-Byte/ccSCADA | src/main/scala/com/theenginerd/ccscada/tileentity/PeripheralTileEntity.scala | Scala | apache-2.0 | 1,585 |
package org.gark87.yajom.example.test
import org.gark87.yajom.base.DefaultMapper
import org.gark87.yajom.example.to.{Child, Person}
import org.gark87.yajom.example.from.{Kid, Employee}
import org.gark87.yajom.macros.Facade._
import java.util
class CollectionsMapper extends DefaultMapper {
implicit def toEmployee(fr... | gark87/yajom | yajom-example/src/org/gark87/yajom/example/test/CollectionsTest.scala | Scala | mit | 1,785 |
package lila.mod
import akka.actor.ActorSelection
import lila.analyse.{ Analysis, AnalysisRepo }
import lila.db.BSON.BSONJodaDateTimeHandler
import lila.db.Types.Coll
import lila.evaluation.Statistics
import lila.evaluation.{ AccountAction, Analysed, GameAssessment, PlayerAssessment, PlayerAggregateAssessment, PlayerF... | Enigmahack/lila | modules/mod/src/main/AssessApi.scala | Scala | mit | 7,589 |
package scala.meta.converter
import scala.collection.immutable.Seq
import scala.meta.TreeConverterTestBaseWithLibrary
import scala.meta._
import scala.{Seq => _}
// tests that require library loading
class TreeConverterDeclTestSlow extends TreeConverterTestBaseWithLibrary {
def testExistentialType() {
doTest(
... | ilinum/intellij-scala | test/scala/meta/converter/TreeConverterDeclTestSlow.scala | Scala | apache-2.0 | 1,411 |
/* __ *\\
** ________ ___ / / ___ __ ____ Scala.js Test Suite **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ |/_// /_\\ \\ http://scala-js.org/ **
** /____/\\___/... | mdedetrich/scala-js | test-suite/js/src/test/scala/org/scalajs/testsuite/javalib/lang/StringBufferJSTest.scala | Scala | bsd-3-clause | 1,400 |
/*
Copyright 2014 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... | nvoron23/scalding | scalding-macros/src/main/scala/com/twitter/scalding/macros/impl/ordered_serialization/runtime_helpers/TraversableHelpers.scala | Scala | apache-2.0 | 6,549 |
package net.giovannibotta
/**
* @author giovanni
* @since 5/6/14
*/
object Hello extends App {
println("This is a test of Scala running on JDK 8")
}
| giovannibotta/scala-sandbox | stuff/src/main/scala/net/giovannibotta/Hello.scala | Scala | apache-2.0 | 155 |
/*
* Copyright 2016 The BigDL Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | intel-analytics/BigDL | scala/dllib/src/test/scala/com/intel/analytics/bigdl/dllib/utils/tf/loaders/MeanLoadTFSpec.scala | Scala | apache-2.0 | 1,190 |
/**
* Licensed to the Minutemen Group under one or more contributor license
* agreements. See the COPYRIGHT file distributed with this work for
* additional information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in complian... | mohiva/silhouette | modules/authenticator/src/main/scala/silhouette/authenticator/Format.scala | Scala | apache-2.0 | 1,818 |
package com.insweat.hssd.lib.util.logging
import scala.collection.immutable.HashMap
import java.util.Date
final case class Record(
name: String,
level: Int,
msg: String,
kwargs: HashMap[String, Any]) {
val timestamp = new Date()
val exception = kwargs.get("exception"... | insweat/hssd | com.insweat.hssd.lib/src/com/insweat/hssd/lib/util/logging/Record.scala | Scala | lgpl-3.0 | 619 |
package twitter4s.api
import http.client.method.GetMethod
import http.client.request.{HttpRequestBuilderCallback, HttpRequestHelpers}
import twitter4s.request._
import scala.concurrent.ExecutionContext
object TwitterApi extends HttpRequestHelpers {
val baseUrl = "https://api.twitter.com/"
val adsBaseUrl = "http... | SocialOrra/social4s | twitter4s/src/main/scala/twitter4s/api/TwitterApi.scala | Scala | apache-2.0 | 12,667 |
package parser.px.analyzers.predefs
import parser.Source
import parser.px.Analyzer
import parser.px.analyzers.SimpleAnalyzer
/**
* A simple analyzer used to just parse the data and see whether it complies to the PX grammar.
* It echoes what it parses to the output as a one line file.
*/
protected class P... | Y-P-/data-processing-binding | Parser/src/parser/px/analyzers/predefs/PrintAnalyzer.scala | Scala | gpl-3.0 | 1,537 |
package com.lateralthoughts.mocked
import java.time.OffsetDateTime
import java.util.UUID
import com.lateralthoughts.points.model.records.{RewardingAction, RewardingActionCategory}
import com.lateralthoughts.points.repositories.RewardingActionRepository
import scala.collection.mutable
import scala.util.Success
objec... | vincentdoba/points | points-server/src/test/scala/com/lateralthoughts/mocked/MockedRewardingActionRepository.scala | Scala | mit | 1,689 |
package actors
import akka.actor.{Actor, Cancellable, Props}
import akka.contrib.throttle.Throttler.{Rate, SetTarget}
import akka.contrib.throttle.TimerBasedThrottler
import play.Logger
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import scala.concurrent.Future
import scala.concurrent.duration.D... | marianafranco/machine-park | app/actors/MonitorActor.scala | Scala | mit | 2,608 |
package org.dsa.time
import org.dsa.core.DSW
import org.dsa.utils.ArgsDefault
/**
* Created by xubo on 2016/12/11.
*/
object DSWQueryTime {
def main(args: Array[String]) {
var subject = ArgsDefault.DSWQuery
for (j <- 0 until subject.length) {
for (i <- 0 until 3) {
subject(j).foreach { ea... | xubo245/CloudSW | src/main/scala/org/dsa/time/DSWQueryTime.scala | Scala | gpl-2.0 | 432 |
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.