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 |
|---|---|---|---|---|---|
// scalac: -Xsource:2.13
//
abstract class Abstract {
type TypeMember
val member: TypeMember
}
object Abstract {
class Ops(m: Abstract#TypeMember) {
def answer = 42
}
implicit def member2AbstractOps(m: Abstract#TypeMember) = new Ops(m)
}
object ShouldThisCompile {
val concrete: Abstract = new Abstrac... | scala/scala | test/files/pos/t5818.scala | Scala | apache-2.0 | 410 |
/*
* Copyright 2015 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | keithhall/ct-calculations | src/main/scala/uk/gov/hmrc/ct/accounts/AC405.scala | Scala | apache-2.0 | 931 |
package doodle
package syntax
object approximatelyEqual {
implicit class ApproximatelyEqualOps[A](a1: A) {
def ~=(a2: A)(implicit distance: Distance[A]): Boolean =
distance.distance(a1, a2) < 0.01
}
}
| Angeldude/doodle | shared/src/test/scala/doodle/syntax/approximatelyEqual.scala | Scala | apache-2.0 | 216 |
package controllers
import org.vindinium.server._
import org.vindinium.server.system.Replay
import org.vindinium.server.user.{ User => U }
import akka.pattern.{ ask, pipe }
import play.api._
import play.api.data._
import play.api.data.Forms._
import play.api.libs.EventSource
import play.api.libs.iteratee._
import pla... | concerned3rdparty/vindinium | app/controllers/User.scala | Scala | mit | 2,012 |
/*
* Copyright 2012-2014 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... | jwakemen/sirius-old | src/main/scala/com/comcast/xfinity/sirius/api/impl/SiriusFactory.scala | Scala | apache-2.0 | 9,967 |
/**
* Generated by API Builder - https://www.apibuilder.io
* Service version: 0.8.36
* apibuilder 0.15.11 app.apibuilder.io/flow/delta-config/latest/play_2_8_client
*/
package io.flow.delta.config.v0.models {
sealed trait BuildConfig extends _root_.scala.Product with _root_.scala.Serializable
/**
* Defines... | flowcommerce/delta | generated/app/FlowDeltaConfigV0Client.scala | Scala | mit | 46,124 |
package org.chipmunk.repository
import org.chipmunk.entity.Entity
import org.chipmunk.entity.Identifiable.Id
import org.squeryl.PrimitiveTypeMode.__thisDsl
import org.squeryl.PrimitiveTypeMode.from
import org.squeryl.PrimitiveTypeMode.long2ScalarLong
import org.squeryl.PrimitiveTypeMode.where
import org.squeryl.Table
... | kpjjpk/chipmunk | src/main/scala/org/chipmunk/repository/SquerylRepo.scala | Scala | mit | 1,044 |
//======================================================================================================================
// Facsimile: A Discrete-Event Simulation Library
// Copyright © 2004-2020, Michael J Allen.
//
// This file is part of Facsimile.
//
// Facsimile is free software: you can redistribute it and/or mod... | MichaelJAllen/facsimile | facsimile-sfx/src/main/scala/org/facsim/sfx/beans/SFXBeansImplicits.scala | Scala | lgpl-3.0 | 4,212 |
package se.stagehand.swing.player
import se.stagehand.lib.scripting.network.NetworkedEffect
import se.stagehand.lib.scripting.network.NetworkedTarget
import com.jidesoft.swing.MultilineLabel
import scala.collection.mutable.StringBuilder
import se.stagehand.lib.Log
import se.stagehand.lib.scripting._
import scala.swing... | evilcandybag/Stagehand-core | src/main/scala/se/stagehand/swing/player/TargetPicker.scala | Scala | gpl-2.0 | 4,430 |
package org.kermeta.kompren.parser
import scala.io.Source
/**
* Singleton util methods used by the parser
*/
object ParserUtil {
def loadFile(uri: String): String = {
val res = new StringBuilder
Source.fromFile(uri).getLines.foreach {
l => res.append(l); res.append('\n')
}
res.toString
}
... | arnobl/kompren | kompren-core/fr.inria.diverse.kompren.parser/src/org/kermeta/kompren/parser/ParserUtil.scala | Scala | epl-1.0 | 322 |
package org.apache.commons.collections
class ArrayStack
class Buffer
| todesking/sbt-conflict-classes | src/sbt-test/sbt-conflict-classes/simple/src/main/scala/dummy2.scala | Scala | mit | 70 |
package twitter.kafka
import java.util
import akka.actor._
import akka.stream.actor.ActorSubscriber
import akka.stream.scaladsl.{Keep, Sink, Source}
import akka.stream.{ActorMaterializer, OverflowStrategy}
import com.softwaremill.react.kafka.{ProducerMessage, ProducerProperties, ReactiveKafka}
import com.typesafe.sca... | jw3/example-docker-microservice | twitter-kafka/src/main/scala/twitter/kafka/FeedToKafka.scala | Scala | apache-2.0 | 3,251 |
/*
* 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/test/scala/de/fuberlin/wiwiss/silk/testutil/approximatelyEqualToOption.scala | Scala | apache-2.0 | 1,135 |
package com.roundeights.tubeutil.static
import org.specs2.mutable._
import org.specs2.mock._
import scala.concurrent.ExecutionContext.Implicits.global
import com.roundeights.skene._
import java.util.Date
class AssetHandlerTest extends Specification with Mockito {
// A shared renderable instance
val renderab... | Nycto/TubeUtil | src/test/scala/static/HandlerTest.scala | Scala | mit | 6,828 |
package ammonite.sshd
import acyclic.file
import ammonite.main.Defaults
import ammonite.ops.Path
/**
* Ssh server parameters
* @param port a port to be used by ssh server. Set it as `0` to let server choose some random port.
* @param username username to authenticate on ssh server
* @param password password to au... | coderabhishek/Ammonite | sshd/src/main/scala/ammonite/sshd/SshServerConfig.scala | Scala | mit | 1,027 |
package com.normation.rudder.repository.jdbc
import com.normation.eventlog.ModificationId
import com.normation.rudder.db.DB
import com.normation.rudder.repository.GitCommitId
import com.normation.rudder.repository.GitModificationRepository
import net.liftweb.common._
import com.normation.rudder.db.Doobie
import sca... | armeniaca/rudder | rudder-core/src/main/scala/com/normation/rudder/repository/jdbc/GitModificationRepository.scala | Scala | gpl-3.0 | 1,445 |
package org.scalajs.openui5.sap.m
import org.scalajs.openui5.sap.ui.core.{CSSSize, Wrapping}
import org.scalajs.openui5.util.{Settings, SettingsMap, noSettings}
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSName, ScalaJSDefined}
@ScalaJSDefined
trait TextAreaSettings extends InputBaseSettings
object ... | lastsys/scalajs-openui5 | src/main/scala/org/scalajs/openui5/sap/m/TextArea.scala | Scala | mit | 1,347 |
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions ... | pasviegas/shoushiling | cli/src/main/scala/com/pasviegas/shoushiling/cli/Main.scala | Scala | unlicense | 1,458 |
/*
* 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/repositories/application/ReportingRepoBSONReader.scala | Scala | apache-2.0 | 21,495 |
import java.io.{File}
import org.specs2.matcher.ValueCheck.valueIsTypedValueCheck
import scalaxb.compiler.Config
object LensPurchaseOrderTest extends TestBase {
val inFile = new File("integration/src/test/resources/ipo.xsd")
val usageFile = new File(tmp, "PurchaseOrderUsage.scala")
copyFileFromResource("Purc... | Banno/scalaxb | integration/src/test/scala/LensPurchaseOrderTest.scala | Scala | mit | 1,083 |
package a65.测试3
object Runner4 {
def number1A(n: Int): Number1 = n match {
case n1 if n1 > 0 => Number1SA(number1A(n1 - 1))
case 0 => Number1TA
}
def number1B(n: Int): Number1 = n match {
case n1 if n1 > 0 => Number1SB(number1B(n1 - 1))
case 0 => Number1TB
}
def number... | djx314/ubw | a66-指数对数-原型/src/main/scala/a65/测试3/Runner4.scala | Scala | bsd-3-clause | 1,993 |
/*
* 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/main/scala/org/scalatest/exceptions/TableDrivenPropertyCheckFailedException.scala | Scala | apache-2.0 | 4,700 |
/*
* Copyright 2001-2009 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... | chirino/activemq-apollo | apollo-util/src/test/scala/org/scalatest/ParallelBeforeAndAfterAll.scala | Scala | apache-2.0 | 10,604 |
package org.finra.datagenerator.scaffolding.transformer.service
import java.lang.reflect.Field
import org.finra.datagenerator.scaffolding.config.{ConfigDefinition, ConfigName, Configurable, Configuration}
import org.finra.datagenerator.scaffolding.utils.{Mapper, ReflectionUtils, TypeUtils}
import org.finra.datagenera... | FINRAOS/DataGenerator | rubber-scaffolding/rubber-transformer/src/main/scala/org/finra/datagenerator/scaffolding/transformer/service/TransformationSession.scala | Scala | apache-2.0 | 8,144 |
trait SecondaryIndex {
val name: String
}
| hirokikonishi/awscala | aws/dynamo/src/main/scala/SecondaryIndex.scala | Scala | apache-2.0 | 46 |
dl('load, "examples/dtpdhs/lhc_distclocks.dl")
val okcuttctfm1 =
parseFormula(
"2 * B() * X2 > 2 * B() * X1 + V1^2- V2^2 + (A+B())*(A *" +
"(eps()-T3)^2+2*(eps()-T3)*V1)"
)
val okcuttctfm2 =
parseFormula(
"2 * B() * X2 > 2 * B() * X1 + V1^2- V2^2 + (A+B())*(A *" +
"(s())^2+2*(s())*V1)"
)
val ok... | keymaerad/KeYmaeraD | examples/dtpdhs/lhc_distclocks_diffsolve.scala | Scala | bsd-3-clause | 4,207 |
package logful.server
import java.util.concurrent.TimeUnit
import io.gatling.core.Predef._
import logful.server.config.LogFileReqConfig
import scala.concurrent.duration.FiniteDuration
class SmallLogEmptyHandleRampUserPerSecSimulation extends Simulation {
val from = 100
val to = 3000
val time = 3*60
val dur... | foxundermoon/gatling-test | src/gatling/scala/logful/server/SmallLogEmptyHandleRampUserPerSecSimulation.scala | Scala | mit | 563 |
/*
* 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 not u... | bOOm-X/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLog.scala | Scala | apache-2.0 | 15,566 |
package lambdacalculus
import lambdacalculus.parser.{LambdaParser, StandardLambdaParser}
import lambdacalculus.compiler.{CBVCompiler, CBNCompiler, Compiler}
import lambdacalculus.machine.CallByName._
import lambdacalculus.machine.CallByValue._
import lambdacalculus.machine._
import lambdacalculus.parser.ast.Expr
impo... | cn-uofbasel/nfn-scala | lambdacalc/src/main/scala/lambdacalculus/LambdaCalculus.scala | Scala | isc | 4,171 |
/*
* Copyright 2010 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | twitter/util | util-logging/src/main/scala/com/twitter/logging/LoggerFactory.scala | Scala | apache-2.0 | 2,831 |
package com.github.novamage.svalidator.html
import com.github.novamage.svalidator.validation.binding.BindingAndValidationWithData
import language.implicitConversions
/** Helper class that eases the use of an [[com.github.novamage.svalidator.html.HtmlFactory HtmlFactory]]
*
* @param summary The summary whose field... | NovaMage/SValidator | src/main/scala/com/github/novamage/svalidator/html/BindingAndValidationSummaryHelper.scala | Scala | mit | 9,368 |
package org.scalatra
import org.scalatra.util.{ MapWithIndifferentAccess, MultiMapHeadView }
class ScalatraParams(
protected val multiMap: Map[String, Seq[String]])
extends MultiMapHeadView[String, String]
with MapWithIndifferentAccess[String]
| lzpfmh/scalatra | core/src/main/scala/org/scalatra/ScalatraParams.scala | Scala | bsd-2-clause | 256 |
package im.actor
import sbt._
object Dependencies {
object V {
val akka = "2.3.12"
val akkaExperimental = "1.0"
val scalaz = "7.1.1"
val slick = "3.0.0"
val scalatest = "2.2.4"
}
object Compile {
val akkaActor = "com.typesafe.akka" %% "akka-actor" ... | darioajr/actor-platform | actor-server/project/Dependencies.scala | Scala | mit | 8,430 |
package org.openapitools.client.model
case class User (
_class: Option[String],
_id: Option[String],
_fullName: Option[String],
_email: Option[String],
_name: Option[String]
)
object User {
def toStringBody(var_class: Object, var_id: Object, var_fullName: Object, var_email: Object, var_name: ... | cliffano/swaggy-jenkins | clients/scala-gatling/generated/src/gatling/scala/org/openapitools/client/model/User.scala | Scala | mit | 496 |
package special.collection
import scala.reflect.ClassTag
import scala.collection.mutable
import scalan.Internal
import spire.syntax.all._
object Helpers {
private def sameLengthErrorMsg[A,B](xs: Coll[A], ys: Coll[B]) =
s"Collections should have same length but was ${xs.length} and ${ys.length}:\n xs=$xs;\n ys=$... | ScorexFoundation/sigmastate-interpreter | library-impl/src/main/scala/special/collection/Helpers.scala | Scala | mit | 1,709 |
/*
* 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 ... | tophua/spark1.52 | examples/src/main/scala/org/apache/spark/examples/LocalKMeans.scala | Scala | apache-2.0 | 3,732 |
/*
* Copyright 2016 by Eugene Yokota
*
* 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... | eed3si9n/gigahorse | akka-http/src/main/scala/gigahorse/support/akkahttp/AkkaHttpStreamHandler.scala | Scala | apache-2.0 | 1,198 |
/**
* A simple text based RPG
*
* @package simplerpg
* @copyright 2015
*/
package simplerpg.action
import simplerpg.{Player, World, Item, Weapon, Armor}
final class InitialParseAction(commands: Array[String]) extends Action {
def run(currentPlayer: Player, world: World): Option[Action] = Some(parseCommand... | mcross1882/SimpleRPG | src/main/scala/simplerpg/action/InitialParseAction.scala | Scala | mit | 2,355 |
/*
* Copyright 2001-2008 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 la... | svn2github/scalatest | src/main/scala/org/scalatest/tools/StringReporter.scala | Scala | apache-2.0 | 30,977 |
package slick.test.jdbc
import scala.language.higherKinds
import slick.testutil._
import com.typesafe.slick.testkit.util.{DBTest, DBTestObject, JdbcTestDB}
object ExecutorTest extends DBTestObject()
@deprecated("Using deprecated .simple API", "3.0")
class ExecutorTest(val tdb: JdbcTestDB) extends DBTest {
import t... | adamkozuch/slick | slick-testkit/src/test/scala/slick/test/jdbc/ExecutorTest.scala | Scala | bsd-2-clause | 524 |
package lila.mod
import akka.actor._
import com.typesafe.config.Config
import lila.db.dsl.Coll
import lila.security.{ Firewall, UserSpy }
final class Env(
config: Config,
db: lila.db.Env,
hub: lila.hub.Env,
system: ActorSystem,
scheduler: lila.common.Scheduler,
firewall: Firewall,
reportA... | clarkerubber/lila | modules/mod/src/main/Env.scala | Scala | agpl-3.0 | 4,682 |
package org.jetbrains.plugins.scala
package lang.refactoring.changeSignature
import com.intellij.psi._
import com.intellij.refactoring.changeSignature._
import com.intellij.usageView.UsageInfo
import org.jetbrains.plugins.scala.codeInsight.intention.types.{AddOnlyStrategy, AddOrRemoveStrategy}
import org.jetbrains.plu... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/changeSignature/ScalaChangeSignatureUsageHandler.scala | Scala | apache-2.0 | 19,371 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | Panos-Bletsos/spark-cost-model-optimizer | mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala | Scala | apache-2.0 | 23,659 |
package scalacookbook.chapter10
/**
* Created by liguodong on 2016/7/30.
*/
object MergeTwoSequentialCollectionPair extends App{
val women = List("Wilma", "Betty")
val men = List("Fred", "Barney")
val couples = women zip men
for ((wife, husband) <- couples) {
println(s"$wife is married to $husband")... | liguodongIOT/java-scala-mix-sbt | src/main/scala/scalacookbook/chapter10/MergeTwoSequentialCollectionPair.scala | Scala | apache-2.0 | 1,869 |
package concrete.constraint.extension
;
import org.scalatest.FlatSpec
import org.scalatest.Matchers
import concrete.IntDomain
import concrete.Problem
import concrete.Variable
import concrete.constraint.AdviseCount
import mdd.MDD
final class ExtensionConstraintTrieTest extends FlatSpec with Matchers {
val mdd = MD... | concrete-cp/concrete | src/test/scala/concrete/constraint/extension/ExtensionConstraintTrieTest.scala | Scala | lgpl-2.1 | 1,029 |
package leo.datastructures.blackboard.impl
import leo.datastructures.{Clause, ClauseProxy}
import leo.datastructures.blackboard._
import scala.collection.mutable
/**
*
* A simple tree context set implementation.
*
* Stores all formulas (enriched clauses) in the program.
*
*/
object FormulaDataStore extends Dat... | leoprover/Leo-III | oldsrc/main/scala/leo/datastructures/blackboard/impl/FormulaDataStore.scala | Scala | bsd-3-clause | 3,795 |
package org.boidflow.pool
import simplex3d.math.{Vec3i, ConstVec3i}
import simplex3d.math.float.functions._
import simplex3d.math.float._
/**
*
*/
final class PoolBuffer3(size: ConstVec3i) {
val yMult = size.x
val zMult = size.x * size.y
val totalSize = size.x * size.y * size.z
val x = new PoolBuffer(si... | zzorn/boidflow | src/main/scala/org/boidflow/pool/PoolBuffer3.scala | Scala | gpl-2.0 | 1,764 |
/**
* Copyright (C) 2016 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... | orbeon/orbeon-forms | xforms-runtime/jvm/src/main/scala/org/orbeon/oxf/xforms/function/xxforms/XXFormsType.scala | Scala | lgpl-2.1 | 1,961 |
/**
* 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... | noslowerdna/kafka | core/src/test/scala/unit/kafka/admin/AddPartitionsTest.scala | Scala | apache-2.0 | 9,318 |
package eu.execom.FabutPresentation.persistence
import java.sql.Blob
import java.sql.Timestamp
import java.sql.Date
import eu.execom.FabutPresentation.api._
import eu.execom.FabutPresentation.util._
import org.joda.time._
import scala.slick.driver.MySQLDriver.simple._
import scala.slick.jdbc.JdbcBackend.{Session => ... | idostanic/FabutPresentation | src/main/scala/eu/execom/FabutPresentation/persistence/UserSessionDao.scala | Scala | apache-2.0 | 11,963 |
/*
* 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/vat-registration-frontend | it/controllers/registration/errors/EmailPasscodeNotFoundControllerISpec.scala | Scala | apache-2.0 | 1,116 |
package xyz.nabijaczleweli.scala_game_of_life.engine.registries
import java.awt.Color
import xyz.nabijaczleweli.scala_game_of_life.cell.CellAction.CellAction
import xyz.nabijaczleweli.scala_game_of_life.cell.{Cell, Material}
import xyz.nabijaczleweli.scala_game_of_life.engine.GameRenderer
import xyz.nabijaczleweli.sca... | nabijaczleweli/Scala-Game-of-Life | src/main/scala/xyz/nabijaczleweli/scala_game_of_life/engine/registries/CellRegistry.scala | Scala | mit | 3,367 |
package org.apache.spark.sql.cassandra
import scala.collection.mutable
import org.apache.spark.sql.SaveMode._
import org.apache.spark.sql.cassandra.DefaultSource._
import org.apache.spark.sql.sources.{BaseRelation, CreatableRelationProvider, RelationProvider, SchemaRelationProvider}
import org.apache.spark.sql.types.... | ponkin/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/org/apache/spark/sql/cassandra/DefaultSource.scala | Scala | apache-2.0 | 6,259 |
package controllers.rememberme
import jp.t2v.lab.play2.auth._
import play.api.mvc.{Cookie, RequestHeader, Result}
import scala.language.postfixOps
class RememberMeTokenAccessor(maxAge: Int) extends CookieTokenAccessor() {
override def put(token: AuthenticityToken)(result: Result)(implicit request: RequestHeader): ... | phosphene/play2.x-basic-auth-demo | app/controllers/rememberme/RememberMeTokenAccessor.scala | Scala | apache-2.0 | 676 |
import org.scalatest.{FlatSpec, Matchers}
import fpinscala.datastructures.List
class ListSpec extends FlatSpec with Matchers {
"List" should "tail correctly" in {
List.tail(List(1,2,3,4)) should be (List(2,3,4))
}
it should "replace head correctly" in {
List.setHead(1, List()) should be (List(1))
L... | nikolakasev/functional-scala | src/test/scala/ListSpec.scala | Scala | mit | 1,234 |
/***********************************************************************
* Copyright (c) 2013-2020 Commonwealth Computer Research, Inc.
* Portions Crown Copyright (c) 2016-2020 Dstl
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License, Version... | aheyne/geomesa | geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/data/AccumuloDataStoreFactoryTest.scala | Scala | apache-2.0 | 5,401 |
package io.skysail.server.website.html
import play.twirl.api.Html
import html.main
import io.skysail.server.RepresentationModel
object PutBookmarkResource_Get extends _root_.play.twirl.api.BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,_root_.play.twirl.api.Format[play.twirl.api.HtmlFormat.Appendable]](play.... | evandor/skysail-server | skysail.server.website/src/io/skysail/server/website/html/PutBookmarkResource_Get.template.scala | Scala | apache-2.0 | 3,124 |
/*
* Copyright 2015 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | keithhall/ct-calculations | src/main/scala/uk/gov/hmrc/ct/computations/CP48.scala | Scala | apache-2.0 | 892 |
/**
* The `Algebraic` number type's goal is to create a guaranteed accuracy number [1].
* That is, a `Algebraic` can always be approximated to any given accuracy and, in
* addition, you are guaranteed that if a `Algebraic` `a` represents a real number
* `r`, then `a.sign == r.sign`.
*
* Central to this is the ide... | lrytz/spire | core/src/main/scala/spire/math/Algebraic.scala | Scala | mit | 5,770 |
/*
* 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 ... | shenbaise/mltoy | src/main/scala/org/apache/spark/examples/ml/CrossValidatorExample.scala | Scala | apache-2.0 | 4,618 |
package com.greencatsoft.d3.selection
import scala.scalajs.js
import org.scalajs.dom.Node
@js.native
trait Stylable[A <: Node, B <: Selection[A, B]] extends js.Object {
def classed(name: String): Boolean = js.native
def classed(name: String, value: Boolean): B = js.native
// d3-selection-multi required
de... | greencatsoft/scalajs-d3 | src/main/scala/com/greencatsoft/d3/selection/Stylable.scala | Scala | apache-2.0 | 852 |
package io.buoyant.linkerd
package protocol
import com.twitter.conversions.time._
import com.twitter.finagle.{Http => FinagleHttp, Status => _, http => _, _}
import com.twitter.finagle.buoyant.linkerd.Headers
import com.twitter.finagle.http.{param => _, _}
import com.twitter.finagle.http.Method._
import com.twitter.fi... | pawelprazak/linkerd | linkerd/protocol/http/src/e2e/scala/io/buoyant/linkerd/protocol/HttpEndToEndTest.scala | Scala | apache-2.0 | 19,223 |
package views.html
import play.templates._
import play.templates.TemplateMagic._
import play.api.templates._
import play.api.templates.PlayMagic._
import models._
import controllers._
import java.lang._
import java.util._
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import play.... | alternativeTime/unicarb_static | target/scala-2.10/src_managed/main/views/html/glycodigestBuilder.template.scala | Scala | gpl-3.0 | 5,935 |
/*
* Copyright 2017-2018 47 Degrees, LLC. <http://www.47deg.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | frees-io/freestyle | modules/async/async/shared/src/main/scala/async.scala | Scala | apache-2.0 | 2,052 |
package jsonsong.spider.common
import com.mongodb.MongoClientURI
import com.typesafe.config.{Config, ConfigFactory}
import org.junit.Test
import org.springframework.data.mongodb.core.SimpleMongoDbFactory
class ConfigTest {
@Test def Test1 {
val uriStr: String = ConfigHelper.getProperty("database.uri", "")
v... | 178220709/HelloScala | ScalaSpider/src/test/Scala/jsonsong/spider/common/ConfigTest.scala | Scala | apache-2.0 | 409 |
package org.mms.demo;
class PPP{
val z=System.currentTimeMillis();
}
object X extends Cloneable{
println("Creation")
val x=new PPP();
def copy():X.type=super.clone().asInstanceOf[X.type];
}
object Test extends App(){
val m=X.copy();
val m1=X;
println(m+":"+m1)
} | petrochenko-pavel-a/mms.core | org.mms.core/src/main/scala/org/mms/demo/Test.scala | Scala | epl-1.0 | 287 |
/*
* Copyright (c) 2014-2015 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.apach... | haensel-ams/snowplow | 3-enrich/scala-common-enrich/src/test/scala/com.snowplowanalytics.snowplow.enrich.common/utils/shredder/ShredderSpec.scala | Scala | apache-2.0 | 2,845 |
package athena.connector
import java.net.InetAddress
import athena.data.DataType
import athena.client.Row
private[connector] object ClusterInfo {
case class ClusterMetadata(name: Option[String],
partitioner: Option[String],
hosts: Map[InetAddress, Host])
... | vast-engineering/athena | src/main/scala/athena/connector/ClusterInfo.scala | Scala | apache-2.0 | 1,402 |
package 练习06
object Runner {
class 类型匹配[T]
object 类型匹配 {
def i1[T1, T2]: (类型匹配[T1], 类型匹配[T2]) = (new 类型匹配[T1], new 类型匹配[T2])
def i2[T](i: (类型匹配[T], 类型匹配[T])): List[类型匹配[T]] = List(i._1, i._2)
}
class Item1
class Item2
class Item3
class Item4
class Item5
class Item6
class Item7
... | djx314/ubw | a28-练习/src/main/scala/练习06/Runner.scala | Scala | bsd-3-clause | 1,947 |
/*
* Nailed, a Minecraft PvP server framework
* Copyright (C) jk-5 <http://github.com/jk-5/>
* Copyright (C) Nailed team and contributors <http://github.com/nailed/>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the MIT License.
*
* This program is distributed ... | nailed/nailed | cmdplugin/internal/NailedInternalPlugin.scala | Scala | mit | 2,129 |
package jgo.tools.compiler
package interm
import instr._
package object codeseq {
implicit def fromInstr(instr: Instr): CodeBuilder = {
val ls = Code(instr)
new CodeBuilder(ls, ls)
}
implicit def fromOption(opt: Option[CodeBuilder]): CodeBuilder =
opt getOrElse CodeBuilder()
}
| thomasmodeneis/jgo | src/src/main/scala/jgo/tools/compiler/interm/codeseq/package.scala | Scala | gpl-3.0 | 301 |
package pl.combosolutions.backup.psm.elevation.posix.linux
import org.specs2.matcher.Scope
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import pl.combosolutions.backup.psm.ImplementationPriority._
import pl.combosolutions.backup.psm.systems._
import pl.combosolutions.backup.{ Cleaner, Result ... | MateuszKubuszok/BackupDSL | modules/psm/src/test/scala/pl/combosolutions/backup/psm/elevation/posix/linux/LinuxElevationSpec.scala | Scala | mit | 6,592 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | fanzhidongyzby/flink | flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/dataset/BatchTableSourceScan.scala | Scala | apache-2.0 | 2,638 |
package com.yetu.play.authenticator
import com.google.inject.Guice
import com.mohiva.play.silhouette.api.{Logger, SecuredSettings}
import com.yetu.notification.client.NotificationManager
import com.yetu.play.authenticator.actors.EventsActor
import com.yetu.play.authenticator.controllers.routes
import com.yetu.play.aut... | yetu/yetu-play-authenticator | app/com/yetu/play/authenticator/AuthenticatorGlobal.scala | Scala | apache-2.0 | 2,557 |
/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
package inc
import java.io.File
import Relations.Source
import Relations.SourceDependencies
/**
* Provides mappings between source files, generated classes (products), and binaries.
* Dependencies that are tracked include internal: a depende... | xeno-by/old-scalameta-sbt | compile/inc/src/main/scala/sbt/inc/Relations.scala | Scala | bsd-3-clause | 26,484 |
// See LICENSE for license details.
package sifive.blocks.devices.chiplink
import Chisel.{defaultCompileOptions => _, _}
import freechips.rocketchip.util.CompileOptions.NotStrictInferReset
import freechips.rocketchip.tilelink._
import freechips.rocketchip.util._
class SourceC(info: ChipLinkInfo) extends Module
{
va... | sifive/sifive-blocks | src/main/scala/devices/chiplink/SourceC.scala | Scala | apache-2.0 | 3,399 |
package net.kemuridama.kafcon.service
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
import net.kemuridama.kafcon.model.{Cluster, Broker}
import net.kemuridama.kafcon.repository.{UsesBrokerRepository, MixinBrokerRepository}
trait BrokerService
extends UsesBrokerRepository
... | kemuridama/kafcon | src/main/scala/net/kemuridama/kafcon/service/BrokerService.scala | Scala | mit | 1,117 |
package sbt
object Signals {
val CONT = "CONT"
val INT = "INT"
def withHandler[T](handler: () => Unit, signal: String = INT)(action: () => T): T =
{
val result =
try {
val signals = new Signals0
signals.withHandler(signal, handler, action)
} catch { case e: LinkageEr... | xeno-by/old-scalameta-sbt | util/collection/src/main/scala/sbt/Signal.scala | Scala | bsd-3-clause | 2,659 |
package dao
import scala.concurrent.Future
import javax.inject.Inject
import models.Cat
import play.api.db.slick.DatabaseConfigProvider
import play.api.db.slick.HasDatabaseConfigProvider
import play.api.libs.concurrent.Execution.Implicits.defaultContext
import slick.driver.JdbcProfile
import slick.jdbc.GetResult
clas... | diegopacheco/scala-playground | play-scala-slick31/app/dao/CatDao.scala | Scala | unlicense | 1,508 |
/**
* Generated by API Builder - https://www.apibuilder.io
* Service version: 0.14.85
* apibuilder 0.14.93 app.apibuilder.io/apicollective/apibuilder-generator/latest/anorm_2_8_parsers
*/
import anorm._
package io.apibuilder.generator.v0.anorm.parsers {
import io.apibuilder.generator.v0.anorm.conversions.Standa... | mbryzek/apidoc | api/app/generated/ApicollectiveApibuilderGeneratorV0Parsers.scala | Scala | mit | 6,745 |
package models
import play.api.db._
import play.api.Play.current
import anorm._
import anorm.SqlParser._
case class Theme(theme:String, content:String)
case class Challenger(theme:String, name:String)
case class Answer(theme:String, name:String, content:String = "")
object Theme {
val parse = {
str("theme") ~... | kencharos/share_editor | app/models/Models.scala | Scala | mit | 1,038 |
package latis.reader.tsml
import latis.reader.tsml.ml.Tsml
import latis.util.FileUtilsNio
/**
* Return a list of files as a Dataset.
* Use a regular expression (defined in the tsml as 'pattern')
* with groups to extract data values from the file names.
*
* This class is almost identical to FileListAdapter. The ... | dlindhol/LaTiS | src/main/scala/latis/reader/tsml/FileListAdapterNio.scala | Scala | epl-1.0 | 2,063 |
package com.arcusys.valamis.lesson.scorm.model
import com.arcusys.valamis.lesson.scorm.model.manifest.{ Objective, ObjectiveMap }
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
class ObjectiveTest extends FlatSpec with ShouldMatchers {
"Objective map" can "be constructed" in {
val m... | ViLPy/Valamis | valamis-scorm-lesson/src/test/scala/com/arcusys/valamis/lesson/scorm/model/ObjectiveTest.scala | Scala | lgpl-3.0 | 5,739 |
package extractors.examples
object Binders {
case class User(name: String, age: Int)
def test(users: Any) = users match {
case List(single @ User(_, 20)) => single.name
case List(_, tail @ _*) => tail.mkString
case Nil => "nobody"
}
} | julienrf/scala-lessons | highlights/extractors/code/src/main/scala/extractors/examples/Binders.scala | Scala | mit | 293 |
package io.buoyant.linkerd.protocol.h2
import com.twitter.finagle.buoyant.h2.Frame
import com.twitter.finagle.buoyant.h2.service.{H2Classifier, H2Classifiers, H2ReqRep, H2ReqRepFrame}
import com.twitter.finagle.service.ResponseClass
import com.twitter.util.Return
import io.buoyant.router.ClassifiedRetries
class Retry... | denverwilliams/linkerd | linkerd/protocol/h2/src/main/scala/io/buoyant/linkerd/protocol/h2/H2Classifiers.scala | Scala | apache-2.0 | 1,823 |
/**
* Copyright (C) 2012 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... | wesley1001/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/submission/SubmissionUtils.scala | Scala | lgpl-2.1 | 4,560 |
/*
* 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 ... | hongyuhong/flink | flink-yarn/src/main/scala/org/apache/flink/yarn/ApplicationClient.scala | Scala | apache-2.0 | 8,645 |
package com.bitunified.cb.server
import java.util
import com.bitunified.cb.notification.{Event, Notification}
import scala.collection
class DSManagerNotification extends Notification {
var subjects:scala.collection.mutable.Map[String, (Unit) => Unit]=new scala.collection.mutable.HashMap[String,Unit=>Unit]
def ... | bitunified/node-platform | np-server/src/main/scala-2.11/com/bitunified/cb/server/DSManagerNotification.scala | Scala | mit | 758 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monifu/monix | monix-reactive/shared/src/test/scala/monix/reactive/observers/ContramapSubscriberSuite.scala | Scala | apache-2.0 | 2,676 |
// scalac: -deprecation -Wunused:nowarn -Yrangepos:false -Werror
import scala.annotation._
class ann(a: Any) extends Annotation
class C {
@deprecated("message", "1.2.3") def dep = 0
@nowarn def t0 = { 0: @nowarn; 1 } // outer @nowarn unused
@nowarn def t1 = { 0: Int @nowarn; 1 } // inner @nowarn unused, it... | scala/scala | test/files/neg/nowarnPointPos.scala | Scala | apache-2.0 | 1,693 |
package cn.edu.sjtu.omnilab.kalin.hz
/**
* Data field schema of ETLed Hangzhou Mobile data.
*/
object DataSchema {
val TTime = 0;
val DTime = 1;
val BS = 2;
val IMSI = 3;
val MobileType = 4;
val DestIP = 5;
val DestPort = 6;
val IsSuccess = 7;
val FailureCause = 8;
val ResponseTime = 9;
val Ho... | caesar0301/MDMS | kalin-etl/src/main/scala/cn/edu/sjtu/omnilab/kalin/hz/DataSchema.scala | Scala | apache-2.0 | 647 |
package com.massrelevance.dropwizard.scala.inject
import com.sun.jersey.api.ParamException
import com.sun.jersey.api.core.HttpContext
import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable
import com.sun.jersey.server.impl.model.parameter.multivalued.{MultivaluedParameterExtractor, ExtractorContainerEx... | torbjornvatn/dropwizard-scala | src/main/scala/com/massrelevance/dropwizard/scala/inject/ScalaCollectionQueryParamInjectable.scala | Scala | apache-2.0 | 818 |
package x7c1.linen.database.control
import android.content.Context
import android.database.sqlite.{SQLiteDatabase, SQLiteOpenHelper}
import x7c1.wheat.macros.logger.Log
import x7c1.wheat.modern.database.WritableDatabase
import x7c1.wheat.modern.database.selector.CanProvideSelector
class DatabaseHelper(context: Contex... | x7c1/Linen | linen-repository/src/main/scala/x7c1/linen/database/control/DatabaseHelper.scala | Scala | mit | 1,312 |
package io.github.nthportal.version.releasetype
import org.junit.Assert._
import org.junit.Test
class AlphaBetaTest {
@Test
@throws[Exception]
def testRCToString() {
val rc1 = AlphaBeta.ReleaseCandidate(1)
assertEquals(rc1.extension, rc1.toString)
}
}
| NthPortal/version-scala | src/test/scala/io/github/nthportal/version/releasetype/AlphaBetaTest.scala | Scala | apache-2.0 | 270 |
package scodec
package codecs
import scalaz.\\/
import scodec.bits.BitVector
private[codecs] final class FailCodec[A](encMessage: String, decMessage: String) extends Codec[A] {
override def encode(a: A) = \\/.left(encMessage)
override def decode(b: BitVector) = \\/.left(decMessage)
override def toString = "... | ceedubs/scodec | src/main/scala/scodec/codecs/FailCodec.scala | Scala | bsd-3-clause | 325 |
/*
* Distributed as part of Scalala, a linear algebra library.
*
* Copyright (C) 2008- Daniel Ramage
*
* This library 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 ... | scalala/Scalala | src/main/scala/scalala/tensor/mutable/Counter.scala | Scala | lgpl-2.1 | 3,529 |
package moe.nightfall.srails.common.tileentity.effect
import moe.nightfall.srails.SRails
import net.minecraft.client.Minecraft
import net.minecraft.client.entity.EntityPlayerSP
import net.minecraft.entity.Entity
import net.minecraftforge.fml.client.FMLClientHandler
import net.minecraftforge.fml.common.gameevent.TickEv... | Nightfall/SRails | src/main/scala/moe/nightfall/srails/common/tileentity/effect/AntiGravity.scala | Scala | bsd-2-clause | 1,340 |
object Version {
val library = "0.1.0-SNAPSHOT"
}
| suzaku-io/suzaku | project/Version.scala | Scala | apache-2.0 | 52 |
/**
* Copyright (C) 2017 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 p... | orbeon/orbeon-forms | form-runner/shared/src/main/scala/org/orbeon/oxf/fr/FormRunnerResourcesOps.scala | Scala | lgpl-2.1 | 3,311 |
/*
* Copyright 2011 TomTom International BV
*
* 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 o... | ebowman/splitter | src/test/scala/tomtom/splitter/layer7/HttpClient.scala | Scala | apache-2.0 | 5,425 |
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.