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 |
|---|---|---|---|---|---|
/*
* 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 ... | Mega-DatA-Lab/mxnet | scala-package/core/src/test/scala/ml/dmlc/mxnet/ShapeSuite.scala | Scala | apache-2.0 | 1,140 |
package pl.writeonly.son2.jack.creators
import pl.writeonly.son2.apis.chain.PCreatorWriterSymbol
import pl.writeonly.son2.jack.core.Jack
import pl.writeonly.son2.jack.notation.NotationWriterJack
class PCreatorWriterJack(jack: Jack)
extends PCreatorWriterSymbol(
jack.meta.format,
c => new NotationWrite... | writeonly/son2 | scallions-impl/scallions-jack/src/main/scala/pl/writeonly/son2/jack/creators/PCreatorWriterJack.scala | Scala | apache-2.0 | 341 |
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import korolev.testkit._
import levsha.{Id, XmlNs}
class PseudoHtmlSpec extends AnyFlatSpec with Matchers {
"PseudoDom.render" should "map levsha.Node to PseudoDom.Element" in {
import levsha.dsl._
import html._
val... | fomkin/korolev | modules/testkit/src/test/scala/PseudoHtmlSpec.scala | Scala | apache-2.0 | 2,235 |
package com.github.debop.scalatra.spring
/**
* Created by debop on 15. 2. 10..
*/
class ScalatraSpringBootstrap {
}
| debop/scalatra-examples | debop-scalatra/src/main/scala/com/github/debop/scalatra/spring/ScalatraSpringBootstrap.scala | Scala | apache-2.0 | 120 |
/**
* 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... | guozhangwang/kafka | core/src/test/scala/unit/kafka/server/ThrottledChannelExpirationTest.scala | Scala | apache-2.0 | 3,772 |
package com.twitter.finagle.loadbalancer
import com.twitter.conversions.DurationOps._
import com.twitter.finagle._
import com.twitter.finagle.loadbalancer.LoadBalancerFactory.PanicMode
import com.twitter.finagle.stats.InMemoryStatsReceiver
import com.twitter.util.Await
import com.twitter.util.Future
import com.twitter... | twitter/finagle | finagle-core/src/test/scala/com/twitter/finagle/loadbalancer/BalancerTest.scala | Scala | apache-2.0 | 8,171 |
//拉链操作
object ZipTest{
def main(args: Array[String]){
val symbols = Array("<", "-", ">")
val counts = Array(2,10,2)
val pairs = symbols.zip(counts)
for((k,v) <- pairs) printf("k: %s, v: %d\\n", k, v)
//toMap 对偶集合转换成映射
val tMap = pairs.toMap
// val tMap = pai... | PengLiangWang/Scala | Map/ZipTest.scala | Scala | gpl-3.0 | 776 |
/*
* Copyright: Copyright (C) 2016, ATS Advanced Telematic Systems GmbH
* License: MPL-2.0
*/
package org.genivi.sota.data
import slick.driver.MySQLDriver.api._
trait SlickEnum {
self: Enumeration =>
implicit val enumMapper =
MappedColumnType.base[Value, String](_.toString, this.withName)
}
| PDXostc/rvi_sota_server | common-data/src/main/scala/org/genivi/sota/data/SlickEnum.scala | Scala | mpl-2.0 | 308 |
package de.fosd.typechef.crefactor
import de.fosd.typechef.conditional.{One, Opt}
import de.fosd.typechef.crefactor.evaluation.Stats._
import de.fosd.typechef.parser.c._
import de.fosd.typechef.featureexpr.{FeatureExprFactory, FeatureExpr, FeatureModel}
import de.fosd.typechef.options._
import de.fosd.typechef.lexer
... | joliebig/Morpheus | src/main/scala/de/fosd/typechef/crefactor/CRefactorFrontend.scala | Scala | lgpl-3.0 | 13,564 |
package controllers
import org.specs2.mutable._
import play.api.mvc._
import play.api.Logger
import play.api.test._
import play.api.test.Helpers._
import play.api.i18n.Messages
import loom.models.{Account, Model}
import loom.BaseTest
/**
*
* @author chaosky
*/
class IndexSpec extends BaseTest with loom.DBSpec {
... | chaosky/loom | test/controllers/IndexSpec.scala | Scala | mit | 3,183 |
package build.unstable.sonicd.system.actor
import java.net.InetAddress
import akka.actor.Actor
import akka.http.scaladsl.model.DateTime
import build.unstable.sonic.model.{ApiUser, AuthConfig, Authenticate, ValidateToken}
import build.unstable.sonic.server.ServerLogging
import build.unstable.sonicd.auth.ApiKey
import ... | ernestrc/sonicd | server/src/main/scala/build/unstable/sonicd/system/actor/AuthenticationActor.scala | Scala | mit | 4,018 |
package scaliper
import sys.process._
object JavaRunner {
/* TODO: Determine if the captureVmLog option is worth implementing.
* if so, here are the java options:
* "-verbose:gc",
* "-Xbatch",
* "-XX:+UseSerialGC",
* "-XX:+PrintCompilation",
... | azavea/scaliper | src/main/scala/scaliper/JavaRunner.scala | Scala | apache-2.0 | 643 |
package com.datastax.spark.connector.rdd.reader
import java.lang.reflect.Method
import scala.language.existentials
import scala.reflect.runtime.universe._
import org.apache.spark.sql.catalyst.ReflectionLock.SparkReflectionLock
import com.datastax.spark.connector.cql.StructDef
import com.datastax.spark.connector.map... | maasg/spark-cassandra-connector | spark-cassandra-connector/src/main/scala/com/datastax/spark/connector/rdd/reader/GettableDataToMappedTypeConverter.scala | Scala | apache-2.0 | 11,822 |
package com.datawizards.sparklocal.dataset.io
import com.datawizards.sparklocal.dataset.DataSetAPI
trait Writer[T] {
def write(ds: DataSetAPI[T]): WriterExecutor[T]
}
| piotr-kalanski/spark-local | src/main/scala/com/datawizards/sparklocal/dataset/io/Writer.scala | Scala | apache-2.0 | 171 |
/*
* 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-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/runtime/batch/sql/agg/GroupingSetsITCase.scala | Scala | apache-2.0 | 23,945 |
/*
* 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 ... | mahak/spark | mllib/src/main/scala/org/apache/spark/mllib/util/modelSaveLoad.scala | Scala | apache-2.0 | 4,548 |
package iotus.core.target
import iotus.core.{BaseSpec, LdapAuthValidator}
import org.scalatest.{FunSpec, Matchers}
import com.typesafe.config.ConfigFactory
class LdapValidatorSpec extends BaseSpec {
val config = ConfigFactory.load("ldaptest.conf")
val ldapUrl = config.getString("ldap.url")
val searchBase = con... | petermichalek/iotan-core | src/test/scala/iotus/core/LdapSpec.scala | Scala | apache-2.0 | 1,030 |
package cromwell.core
import cromwell.core.path.Path
import common.exception.ThrowableAggregation
case class CallContext(root: Path, stdout: String, stderr: String)
/** Marker trait for Cromwell exceptions that are to be treated as fatal (non-retryable) */
trait CromwellFatalExceptionMarker { this: Throwable => }
... | ohsu-comp-bio/cromwell | core/src/main/scala/cromwell/core/core.scala | Scala | bsd-3-clause | 899 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package play.api
/**
* Contains the internationalisation API.
*
* For example, translating a message:
* {{{
* val msgString = Messages("items.found", items.size)
* }}}
*/
package object i18n
| benmccann/playframework | core/play/src/main/scala/play/api/i18n/package.scala | Scala | apache-2.0 | 267 |
package objektwerks
import org.apache.log4j.Logger
import org.apache.spark.sql.types.{DoubleType, IntegerType, StringType, StructType}
import org.apache.spark.sql.{Encoders, ForeachWriter}
case class Wine(id: Int,
country: String,
description: String,
designation: Strin... | objektwerks/spark | src/main/scala/objektwerks/Wine.scala | Scala | apache-2.0 | 1,396 |
/*
* 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 | mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala | Scala | apache-2.0 | 39,285 |
/*
* 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 ... | prateekm/samza | samza-kv/src/main/scala/org/apache/samza/storage/kv/KeyValueStorageEngine.scala | Scala | apache-2.0 | 9,072 |
package collins.provisioning
import org.specs2.mutable._
import java.io.File
class ProfileLoaderSpec extends Specification {
val profiles = {
val file = new File("test/resources/profiles.yaml")
ProfileLoader.fromFile(file)
}
"The test profiles.yaml should load" should {
"all profiles" >> {
pro... | byxorna/collins | test/collins/provisioning/ProfileLoaderSpec.scala | Scala | apache-2.0 | 2,407 |
package com.codexica.s3crate.filetree.history
import com.codexica.common.{SafeInputStream, SafeLogSpecification}
import org.specs2.mutable.After
import java.io.{InputStream, ByteArrayInputStream, File}
import org.apache.commons.io.{IOUtils, FileUtils}
import java.util.{Random, UUID}
import org.slf4j.LoggerFactory
/**... | joshalbrecht/s3crate | src/test/scala/com/codexica/s3crate/filetree/history/CompressorSpec.scala | Scala | mit | 2,591 |
/*******************************************************************************
* Copyright (C) 2012 Łukasz Szpakowski.
*
* 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 ver... | luckboy/LkbGraph | src/main/org/lkbgraph/immutable/TreeFactory.scala | Scala | lgpl-3.0 | 1,730 |
package org.bitcoins.crypto
import scodec.bits.ByteVector
/** Utility cryptographic functions
* This is a proxy for the underlying implementation of [[CryptoRuntime]]
* such as [[LibSecp256k1CryptoRuntime]].
*
* This is necessary so that the core module doesn't need to be refactored
* to add support for mul... | bitcoin-s/bitcoin-s | crypto/src/main/scala/org/bitcoins/crypto/CryptoUtil.scala | Scala | mit | 7,203 |
package controllers
import org.scalatest.MustMatchers
import org.scalatestplus.play.PlaySpec
import play.api.libs.json.Json
class MarshallingNotFoundResponseSpec extends PlaySpec with MustMatchers {
"Write and reads" should {
"transform NotFoundResponse object to json" in {
Json.toJson(NotFoundResponse("... | tvlive/tv-api | test/unit/controllers/MarshallingNotFoundResponseSpec.scala | Scala | apache-2.0 | 587 |
package scala.tasty
package reflect
/** TASTy Reflect tree map.
*
* Usage:
* ```
* class MyTreeMap[R <: scala.tasty.Reflection & Singleton](val reflect: R)
* extends scala.tasty.reflect.TreeMap {
* import reflect.{given _, _}
* override def transformTree(tree: Tree)(using ctx: Context): Tree = ...... | som-snytt/dotty | library/src/scala/tasty/reflect/TreeMap.scala | Scala | apache-2.0 | 7,191 |
package com.seanshubin.todo.application.domain
trait ConfigurationValidator {
def validate(): Configuration
}
| SeanShubin/todo-application | domain/src/main/scala/com/seanshubin/todo/application/domain/ConfigurationValidator.scala | Scala | unlicense | 113 |
object Test:
def registry(cfg: Configurer_1) = cfg.registry
| dotty-staging/dotty | tests/pos-java-interop-separate/inner-fbounds/Test_2.scala | Scala | apache-2.0 | 62 |
package dk.gp.hgpc
import breeze.numerics._
import breeze.linalg.DenseVector
import org.junit._
import Assert._
import breeze.linalg.DenseMatrix
import com.typesafe.scalalogging.slf4j.LazyLogging
import dk.bayes.math.linear.isIdentical
class hgpcTrainTest extends LazyLogging {
val (x, y, u) = getHgpcTestData()
... | danielkorzekwa/bayes-scala-gp | src/test/scala/dk/gp/hgpc/hgpcTrainTest.scala | Scala | bsd-2-clause | 1,401 |
/*
* Copyright (C) 2012 Romain Reuillon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is di... | ISCPIF/PSEExperiments | openmole-src/openmole/core/org.openmole.core.tools/src/main/scala/org/openmole/core/tools/service/TimeCache.scala | Scala | agpl-3.0 | 1,108 |
package com.bwsw.tstreamstransactionserver.netty.server
import com.bwsw.tstreamstransactionserver.exception.Throwable.{PackageTooBigException, TokenInvalidException}
import com.bwsw.tstreamstransactionserver.netty.server.commitLogService.CommitLogToBerkeleyWriter
import com.bwsw.tstreamstransactionserver.netty.server... | bwsw/tstreams-transaction-server | src/main/scala/com/bwsw/tstreamstransactionserver/netty/server/ServerHandler.scala | Scala | apache-2.0 | 20,579 |
package sigmastate.serialization
import sigmastate.Values.{Value, SValue}
import sigmastate.lang.Terms._
import sigmastate.utils.SigmaByteWriter.DataInfo
import sigmastate.utils.{SigmaByteReader, SigmaByteWriter}
import sigmastate.{TwoArgumentsOperation, SType, TwoArgumentOperationCompanion}
case class TwoArgumentsSe... | ScorexFoundation/sigmastate-interpreter | sigmastate/src/main/scala/sigmastate/serialization/TwoArgumentsSerializer.scala | Scala | mit | 1,025 |
/*!
* Copyright 2013-2014 Dennis Hörsch.
*
* 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 applicabl... | dhs3000/dropwizard-scala | src/main/scala/de/dennishoersch/util/reflect/package.scala | Scala | apache-2.0 | 1,589 |
package fpinscala.datastructures
sealed trait List[+A] // `List` data type, parameterized on a type, `A`
case object Nil extends List[Nothing] // A `List` data constructor representing the empty list
/* Another data constructor, representing nonempty lists. Note that `tail` is another `List[A]`,
which may be `Nil` or ... | P3trur0/fpinscala | exercises/src/main/scala/fpinscala/datastructures/List.scala | Scala | mit | 5,887 |
package org.jetbrains.plugins.scala.codeInsight.intention.types
import org.jetbrains.plugins.scala.codeInsight.intentions.ScalaIntentionTestBase
import org.jetbrains.plugins.scala.{LatestScalaVersions, ScalaVersion}
abstract class ConvertJavaToScalaCollectionIntentionBaseTest(converters: String)
extends ScalaIntent... | JetBrains/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/codeInsight/intention/types/ConvertJavaToScalaCollectionIntentionTest.scala | Scala | apache-2.0 | 3,205 |
package controller
import org.scalatest._
import skinny.test.MockApiController
class SampleTxApiControllerSpec extends FunSpec with Matchers {
def createMockController = new SampleTxApiController with MockApiController
describe("SampleTxApiController") {
it("throws error") {
val controller = createMoc... | seratch/skinny-framework | example/src/test/scala/controller/SampleTxApiControllerSpec.scala | Scala | mit | 414 |
package org.bitcoins.script.interpreter.testprotocol
import org.bitcoins.protocol.script.{ScriptSignature, ScriptPubKey}
import org.bitcoins.script.constant.ScriptToken
/**
* Created by chris on 3/14/16.
*/
trait ScriptSignatureCoreTestCase {
/**
* The parsed asm representation for the core test case
* this... | Christewart/scalacoin | src/test/scala/org/bitcoins/script/interpreter/testprotocol/ScriptSignatureCoreTestCase.scala | Scala | mit | 1,015 |
package test.scaladoc.template.diagrams
/** @contentDiagram hideNodes "*Api" */
trait X {
/** @template */
type Symbol >: Null <: SymbolApi
/** @template */
type TypeSymbol >: Null <: Symbol with TypeSymbolApi
/** @template */
type TermSymbol >: Null <: Symbol with TermSymbolApi
/** @template */
typ... | scala/scala | test/scaladoc/resources/t6511.scala | Scala | apache-2.0 | 719 |
/*
* Copyright 2012-2020 the original author or 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 ap... | planet42/Laika | core/shared/src/main/scala/laika/parse/code/common/NumberLiteral.scala | Scala | apache-2.0 | 5,684 |
package com.sksamuel.elastic4s.requests.analyzers
import com.sksamuel.elastic4s.api.{AnalyzerApi, TokenFilterApi}
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class UniqueTokenFilterTest extends AnyWordSpec with AnalyzerApi with Matchers with TokenFilterApi {
"UniqueToken... | sksamuel/elastic4s | elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/analyzers/UniqueTokenFilterTest.scala | Scala | apache-2.0 | 639 |
package com.yetu.oauth2provider.services.data.api
import play.Play
trait APIHelper {
val PermissionApiKey = "permission.api.url"
val Version1 = "v1"
lazy val currentConfig = Play.application().configuration()
def url(endpoint: String, version: String) = {
currentConfig.getString(PermissionApiKey) + "/... | yetu/oauth2-provider | app/com/yetu/oauth2provider/services/data/api/APIHelper.scala | Scala | mit | 480 |
package com.tpalanga.newsletter.utils
import akka.actor.{Actor, ActorSystem, Props}
import akka.event.Logging.LogEvent
import akka.testkit.{ImplicitSender, TestKit, TestProbe}
import com.tpalanga.newsletter.util.UnhandledMessageWatcher
import org.scalatest.{FlatSpecLike, Matchers}
object UnhandledMessageWatcherSpec {... | tpalanga/akka-http-microservice | newsletterService/src/test/scala/com/tpalanga/newsletter/utils/UnhandledMessageWatcherSpec.scala | Scala | unlicense | 1,489 |
package net.pointsgame.lift.rest
import net.liftweb.common.Loggable
import net.liftweb.http._
import net.liftweb.http.rest._
import net.liftweb.util.Helpers._
import net.pointsgame.ai._
import net.pointsgame.lift.model.Dot
object MyRest extends RestHelper with Loggable {
serve {
case Get("api" :: "makemove" :: ro... | vn971/points-wip | modules/lift-server/src/main/scala/net/pointsgame/lift/rest/MyRest.scala | Scala | agpl-3.0 | 742 |
package chapter07.exercise1.com.horstmann.impatient
// import chapter7.exercise1.com.horstmann.Common
object Part1 extends App {
def test() = println("Part1 test")
println("Part1")
Part2.test()
// Common.test() // Doesn't work without import
}
| vsuharnikov/books-exercises | scala/scala-for-the-impatient/src/main/scala/chapter07/exercise1/com/horstmann/impatient/Part1.scala | Scala | mit | 256 |
/*
* 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... | wangyixiaohuihui/spark2-annotation | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/decimalExpressions.scala | Scala | apache-2.0 | 4,110 |
package com.twitter.finagle.buoyant.h2
package netty4
import com.twitter.concurrent.AsyncMutex
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.{Service, Status => SvcStatus}
import com.twitter.finagle.transport.Transport
import com.twitter.logging.Logger
import com.twitter.util._
import io.ne... | denverwilliams/linkerd | finagle/h2/src/main/scala/com/twitter/finagle/buoyant/h2/netty4/Netty4ClientDispatcher.scala | Scala | apache-2.0 | 3,947 |
package chapter.sixteen
object ExerciseTen extends App {
}
| deekim/impatient-scala | src/main/scala/chapter/sixteen/ExerciseTen.scala | Scala | apache-2.0 | 62 |
/*
* Copyright 2016 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... | ahudspith-equalexperts/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600/v2/RSQ7.scala | Scala | apache-2.0 | 783 |
object Test {
final class A
final class B
final class C
trait F1[T1] {
def apply(x: T1): Unit
}
type F[N] = N match {
case A => F1[String]
case B => F[A]
case C => F[B]
}
val s1: F[A] = ???
s1.apply("A")
val s2: F[B] = ???
s2.apply("B")
val s3: F[C] = ???
s3.apply("C")
}
| som-snytt/dotty | tests/pos/6322.scala | Scala | apache-2.0 | 319 |
package keemun.models
import scala.collection.JavaConversions._
import play.api.libs.json.{Json, JsValue, Writes}
import play.api.Configuration
import com.typesafe.config.{ConfigValueType, ConfigObject, ConfigList, Config}
/**
* Copyright (c) Nikita Kovaliov, maizy.ru, 2014
* See LICENSE.txt for details.
*/
class... | maizy/keemun | app/keemun/models/Sources.scala | Scala | mit | 2,822 |
package com.github.oetzi.echo.io
import com.github.oetzi.echo.core.EventSource
/**Trait for allowing failure tolerant FRP
* components.
*/
trait Breakable {
/**An Event that represents Exceptions
* thrown while executing code within this
* Breakable object.
*/
val errors = new EventSource[Exception] {
... | seadowg/echo | src/main/scala/com/github/oetzi/echo/io/Breakable.scala | Scala | mit | 789 |
package com.flowy.fomoapi
import akka.actor.ActorSystem
import akka.http.scaladsl.server.Directives._
import com.flowy.fomoapi.routes._
import com.softwaremill.bootzooka.ServerConfig
import com.softwaremill.bootzooka.common.api.RoutesRequestWrapper
import com.softwaremill.bootzooka.swagger.SwaggerDocService
trait Ro... | asciiu/fomo | api/src/main/scala/com/flowy/fomoapi/Routes.scala | Scala | apache-2.0 | 1,209 |
/**
* Copyright (C) 2013-2014 Duncan DeVore. <https://github.com/ironfish/>
*/
package com.github.ironfish.akka.persistence.cqrscs.sample
import concurrent.duration._
import org.scalatest._
import akka.actor.{PoisonPill, ActorRef, Props, ActorSystem}
import scala.concurrent.stm.Ref
import scala.concurrent.Await
imp... | agilemobiledev/akka-persistence-mongo-samples | mongo-cqrs-cs-app/src/test/scala/com/github/ironfish/akka/persistence/cqrscs/sample/EmployeeSpec.scala | Scala | apache-2.0 | 10,105 |
package org.jetbrains.sbt
package lang.completion
/**
* @author Nikolay Obedin
* @since 7/17/14.
*/
class CompletionDefinitionTest extends CompletionTestBase {
def testObjectValues
= doTest()
def testLocalVars
= doTest()
def testJavaEnumValues
= doTest()
def testScopes
= doTest()
def test... | double-y/translation-idea-plugin | test/org/jetbrains/sbt/lang/completion/CompletionDefinitionTest.scala | Scala | apache-2.0 | 347 |
/*
* Part of NDLA learningpath-api.
* Copyright (C) 2016 NDLA
*
* See LICENSE
*
*/
package no.ndla.learningpathapi.validation
import no.ndla.learningpathapi.LearningpathApiProperties._
import no.ndla.learningpathapi.model.api.ValidationMessage
import org.jsoup.Jsoup
import org.jsoup.safety.Whitelist
class Text... | NDLANO/learningpath-api | src/main/scala/no/ndla/learningpathapi/validation/TextValidator.scala | Scala | gpl-3.0 | 1,605 |
package com.signalcollect
import language.higherKinds
import org.scalacheck.Arbitrary
import org.scalacheck.Arbitrary._
import org.scalacheck.Gen
import org.scalacheck.Gen._
import org.scalatest.FlatSpec
import org.scalatest.ShouldMatchers
import org.scalatest.prop.Checkers
import org.scalatest.mock.EasyMockSugar
impo... | danihegglin/DynDCO | src/test/scala/com/signalcollect/VertexSpec.scala | Scala | apache-2.0 | 2,489 |
// Solution-4.scala
// Solution to Exercise 4 in "Methods"
def getMe(str:String):String = {
str.toLowerCase
}
val g1 = getMe("abraCaDabra")
println(g1)
assert("abracadabra" == g1, "Expected abracadabra, Got " + g1)
val g2 = getMe("zyxwVUT")
println(g2)
assert("zyxwvut"== g2, "Expected zyxwvut, Got " + g2)
/* OUTPU... | P7h/ScalaPlayground | Atomic Scala/atomic-scala-solutions/09_Methods/Solution-4.scala | Scala | apache-2.0 | 355 |
/*
Copyright (c) 2016, Robby, Kansas State University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of cond... | sireum/v3 | pilar/shared/src/main/scala/org/sireum/pilar/test/ast/PrettyPrinterTestDefProvider.scala | Scala | bsd-2-clause | 4,005 |
/*
* Copyright (C) 2016. envisia GmbH
* All Rights Reserved.
*/
package de.envisia.postgresql.encoders
import java.nio.ByteOrder
import java.nio.charset.Charset
import akka.util.ByteString
import de.envisia.akka.utils.ByteStringUtils
import de.envisia.postgresql.message.backend.ServerMessage
import de.envisia.post... | schmitch/akka-pg | src/main/scala/de/envisia/postgresql/encoders/QueryMessageEncoder.scala | Scala | apache-2.0 | 805 |
package com.twitter.scalding.thrift.macros
import com.twitter.scalding.serialization.{OrderedSerialization, RequiredBinaryComparatorsConfig}
import com.twitter.scalding.thrift.macros.impl.ScroogeInternalOrderedSerializationImpl
import scala.language.experimental.{macros => smacros}
/**
* Provides support for Scrooge... | twitter/scalding | scalding-thrift-macros/src/main/scala/com/twitter/scalding/thrift/macros/RequiredBinaryComparators.scala | Scala | apache-2.0 | 665 |
package skinny.task.generator
import skinny.Params
/**
* Scaffold generator with jade template.
*/
object ScaffoldJadeGenerator extends ScaffoldJadeGenerator
/**
* Scaffold generator with jade template.
*/
trait ScaffoldJadeGenerator extends ScaffoldGenerator {
protected override def template: String = "jade"... | BlackPrincess/skinny-framework | task/src/main/scala/skinny/task/generator/ScaffoldJadeGenerator.scala | Scala | mit | 12,198 |
/*
* 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 ... | dotunolafunmiloye/spark | examples/src/main/scala/org/apache/spark/examples/SparkLR.scala | Scala | apache-2.0 | 2,244 |
package com.eigengo.lift.spark.jobs
import scala.reflect.ClassTag
object Job {
def apply[J <: Batch[_, _]: ClassTag]() = {
implicitly[ClassTag[J]].runtimeClass.newInstance().asInstanceOf[J]
}
}
| lachatak/lift | server/spark/src/main/scala/com/eigengo/lift/spark/jobs/Job.scala | Scala | apache-2.0 | 204 |
import scala.reflect.macros.blackbox.Context
import language.experimental.macros
trait Complex[T]
class Foo(val bar: Bar)
class Bar(val s: String)
object Complex {
def impl[T: c.WeakTypeTag](c: Context): c.Expr[Complex[T]] = {
import c.universe._
val tpe = weakTypeOf[T]
for (f <- tpe.decls.collect{case... | folone/dotty | tests/disabled/macro/run/macro-divergence-spurious/Impls_Macros_1.scala | Scala | bsd-3-clause | 766 |
/* Copyright 2014, 2015 Richard Wiedenhöft <richard@wiedenhoeft.xyz>
*
* 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 requir... | Richard-W/scalacrypt | src/main/scala/modes/ECB.scala | Scala | apache-2.0 | 1,418 |
package scala.collection
import org.junit.Test
import org.junit.Assert._
import scala.collection.mutable.Buffer
import scala.reflect.ClassTag
// based on run/collections-conversion.scala partest
@deprecated("Tests conversion to Stream", since="2.13")
class CollectionConversionsTest {
val out = new StringBuilder
... | lrytz/scala | test/junit/scala/collection/CollectionConversionsTest.scala | Scala | apache-2.0 | 2,735 |
/*
* Copyright 2006-2010 WorldWide Conferencing, 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
*
* Unless required by applica... | geggo98/json4s | ext/src/main/scala/org/json4s/ext/JodaTimeSerializers.scala | Scala | apache-2.0 | 4,782 |
/*
,i::,
:;;;;;;;
;:,,::;.
1ft1;::;1tL
t1;::;1,
:;::; _____ __ ___ __
fCLff ;:: tfLLC / ___/ / |/ /____ _ _____ / /_
CLft11 :,, i1tffLi \__ \ ____ / /|_/ //... | S-Mach/aeondb | src/main/scala/s_mach/aeondb/LocalProjection.scala | Scala | apache-2.0 | 1,138 |
package com.wavesplatform.it.sync.activation
import com.typesafe.config.Config
import com.wavesplatform.api.http.ApiError.{CustomValidationError, StateCheckFailed}
import com.wavesplatform.block.Block
import com.wavesplatform.common.utils.Base58
import com.wavesplatform.crypto
import com.wavesplatform.features.Blockch... | wavesplatform/Waves | node-it/src/test/scala/com/wavesplatform/it/sync/activation/VRFProtobufActivationSuite.scala | Scala | mit | 10,225 |
package simpleEMS.semantics
import simpleEMS.ir._
/**
* DescriptorInterpreter can interpret descriptors
*/
class DescriptorInterpreter {
/** evaluating a descriptor **/
def eval(ast: AST): Map[String, scala.collection.mutable.MutableList[Any]] = {
ast match {
case room(fields: DescriptionFields) =>... | mjeongDSL/SimpleEMS | src/SimpleEMS/semantics/Interpreter.scala | Scala | gpl-3.0 | 2,268 |
/*
* Copyright (c) 2014-2015 by its authors. Some rights reserved.
* See the project homepage at: http://www.monifu.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://... | sergius/monifu | monifu/shared/src/main/scala/monifu/reactive/internals/operators/echo.scala | Scala | apache-2.0 | 5,564 |
/*
* 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... | monix/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/RepeatSuite.scala | Scala | apache-2.0 | 1,649 |
package nak
/**
Copyright 2013 Jason Baldridge
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 w... | scalanlp/nak | src/main/scala/nak/NakContext.scala | Scala | apache-2.0 | 7,813 |
/*
* 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 ... | dbtsai/spark | resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala | Scala | apache-2.0 | 14,985 |
/**
* Created by bodie on 7/19/14.
*/
package com.sg.pnx.graphics.util
import org.lwjgl.opengl.{PixelFormat, ContextAttribs, Display, DisplayMode}
import java.lang.System.err
import com.sg.pnx.graphics.shaders.Shaders
object DisplayUtil {
private var _isCreated: Boolean = false
private var (w, h) = (0, 0)
pr... | synapse-garden/phoenix | src/main/scala/com/sg/pnx/graphics/util/DisplayUtil.scala | Scala | mit | 2,000 |
/**
* Copyright (C) 2009-2011 the original author or authors.
* See the notice.md 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.
* Yo... | maslovalex/scalate | scalate-jersey/src/main/scala/org/fusesource/scalate/console/ArchetypeResource.scala | Scala | apache-2.0 | 3,518 |
// Copyright: 2010 - 2018 https://github.com/ensime/ensime-server/graphs
// License: http://www.gnu.org/licenses/gpl-3.0.en.html
package org.ensime.util
class HtmlUtilsSpec extends EnsimeSpec {
"HtmlUtil" should "not unescape plain text" in {
val originalEscaped = "plain text"
HtmlUtil.unescapeHtml(original... | yyadavalli/ensime-server | core/src/test/scala/org/ensime/util/HtmlUtilSpec.scala | Scala | gpl-3.0 | 1,885 |
/*
ASIB - A Scala IRC Bot
Copyright (C) 2012 Iain Cambridge
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versio... | icambridge-old/asib | src/main/scala/asib/util/connector/AbstractConnector.scala | Scala | gpl-3.0 | 1,250 |
package com.hindog.grid
/*
* __ _ __
* / / (_)__ ___/ /__ ____
* / _ \\/ / _ \\/ _ / _ \\/ _ /
* /_//_/_/_//_/\\_,_/\\___/\\_, /
* /___/
*/
abstract class Hook(val name: String) extends Runnable with Serializable
| hindog/grid-executor | grid-executor/src/main/scala/com/hindog/grid/Hook.scala | Scala | apache-2.0 | 267 |
/**
* 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... | YMCoding/kafka-0.11.0.0-src-with-comment | core/src/main/scala/kafka/tools/ConsoleProducer.scala | Scala | apache-2.0 | 16,382 |
package codechicken.microblock
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.util.MovingObjectPosition
import codechicken.lib.vec.{Cuboid6, Vector3}
import org.lwjgl.opengl.GL11._
import codechicken.lib.render.{CCRenderState, TextureUtils}
import codechicken.lib.render.BlockRenderer.BlockFace
im... | Chicken-Bones/ForgeMultipart | src/codechicken/microblock/MicroblockRender.scala | Scala | lgpl-2.1 | 1,838 |
/*
* Copyright 2015 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | jCalamari/mongo-scala-driver | bson/src/main/scala/org/mongodb/scala/bson/codecs/package.scala | Scala | apache-2.0 | 1,403 |
package hayago
final case class IdOps[A](self: A) {
def ??(d: => A)/*(implicit ev: Null <:< A)*/: A = if (self == null) d else self
def |>[B](f: A => B): B = f(self)
def <|(f: A => Any): A = { f (self); self }
def squared: (A, A) = (self, self)
} | sungiant/hayago | src/main/scala/IdOps.scala | Scala | mit | 255 |
package com.github.diegopacheco.scala.playground.reactive.streams
import akka.stream.ActorMaterializer
import akka.actor.ActorSystem
import akka.stream.scaladsl.Source
import akka.stream.scaladsl.Sink
import scala.concurrent.duration._
import akka.stream.scaladsl._
import akka.stream._
import scala.concurrent.Future
... | diegopacheco/scala-playground | scala-akka-streams-a/src/main/scala/com/github/diegopacheco/scala/playground/reactive/streams/ReactiveTweetsApp.scala | Scala | unlicense | 2,136 |
package dk.bayes.clustergraph.factor
import org.junit._
import org.junit.Assert._
import dk.bayes.clustergraph.testutil.AssertUtil._
import dk.bayes.clustergraph.factor.SingleFactor
import dk.bayes.clustergraph.factor.Var
import dk.bayes.clustergraph.factor.MultiFactor
class MultiFactorTest {
val factor = MultiFac... | danielkorzekwa/bayes-scala | src/test/scala/dk/bayes/clustergraph/factor/MultiFactorTest.scala | Scala | bsd-2-clause | 4,782 |
/*
* 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 ... | ashokblend/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/util/GlobalDictionaryUtilConcurrentTestCase.scala | Scala | apache-2.0 | 7,289 |
package org.broadinstitute.dsde.workbench.sam.db.tables
import org.broadinstitute.dsde.workbench.sam.db.DatabaseNames
import scalikejdbc._
trait SQLSyntaxSupportWithDefaultSamDB[A] extends SQLSyntaxSupport[A] {
// I think this connection pool is used only to pull table metadata from the database (which is cached).
... | broadinstitute/sam | src/main/scala/org/broadinstitute/dsde/workbench/sam/db/tables/SQLSyntaxSupportWithDefaultSamDB.scala | Scala | bsd-3-clause | 387 |
/*
* Copyright 2016 Guy Van den Broeck and Wannes Meert (UCLA and KU Leuven)
*
* 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
*
* Un... | UCLA-StarAI/Forclift | src/main/scala/edu/ucla/cs/starai/forclift/examples/models/mln/TransitiveFriendsSmokerDrinkerModel.scala | Scala | apache-2.0 | 1,396 |
/*
* Copyright 2015 Scouter Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | scouter-project/scouter | scouter.server/src/main/scala/scouter/server/netio/service/handle/StatusService.scala | Scala | apache-2.0 | 1,722 |
/*
* 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 ... | style95/openwhisk | common/scala/src/main/scala/org/apache/openwhisk/core/entity/WhiskPackage.scala | Scala | apache-2.0 | 11,399 |
/* scala-stm - (c) 2009-2011, Stanford University, PPL */
package scala.concurrent.stm
package skel
import annotation.tailrec
import scala.reflect.ClassTag
/** `TxnHashTrie` implements a transactional mutable hash trie using Ref-s,
* with lazy cloning to allow efficient snapshots. Fundamental operations are
* p... | nbronson/scala-stm | src/main/scala/scala/concurrent/stm/skel/TxnHashTrie.scala | Scala | bsd-3-clause | 28,648 |
package im.dlg.api
import treehugger.forest._, definitions._
import treehuggerDSL._
trait DebugHelpersTrees {
protected val debugTree: Tree = OBJECTDEF("Debug") withFlags PRIVATEWITHIN("api") := BLOCK(
IMPORT("com.typesafe.config.ConfigFactory"),
DEF("isDebug", BooleanClass) :=
REF("ConfigFactory") D... | dialogs/sbt-dialog-api | src/main/scala/im/dlg/api/DebugHelpersTrees.scala | Scala | mit | 377 |
package net.aicomp.terraforming.entity
// new Point class for rendering
case class OrthogonalPoint(x: Int, y: Int) {
}
object OrthogonalPoint {
// default center of Map is (500,250)
val defaultX = 320
val defaultY = 250
val pointSize = Size(48, 48)
case class Size(val x: Int, val y: Int)
// transforma... | AI-comp/Terraforming | src/main/scala/net/aicomp/terraforming/entity/OrthogonalPoint.scala | Scala | apache-2.0 | 1,942 |
package vexriscv.plugin
import java.util
import vexriscv.{ReportService, VexRiscv}
import org.yaml.snakeyaml.{DumperOptions, Yaml}
/**
* Created by spinalvm on 09.06.17.
*/
class YamlPlugin(path : String) extends Plugin[VexRiscv] with ReportService{
val content = new util.HashMap[String, Object]()
def add(t... | SpinalHDL/VexRiscv | src/main/scala/vexriscv/plugin/YamlPlugin.scala | Scala | mit | 759 |
package uk.org.nbn.nbnv.importer.validation
import uk.org.nbn.nbnv.importer.testing.BaseFunSuite
import uk.org.nbn.nbnv.importer.records.NbnRecord
import org.mockito.Mockito._
import scala.Some
import uk.org.nbn.nbnv.importer.fidelity.ResultLevel
class Nbnv84ValidatorSuite extends BaseFunSuite {
test("shou... | JNCC-dev-team/nbn-importer | importer/src/test/scala/uk/org/nbn/nbnv/importer/validation/Nbnv84ValidatorSuite.scala | Scala | apache-2.0 | 2,166 |
package com.imaginea.activegrid.core.models
import org.neo4j.graphdb.Node
/**
* Created by shareefn on 2/1/17.
*/
case class AnsiblePlayBook(override val id: Option[Long],
name: Option[String],
path: Option[String],
playList: List[An... | eklavya/activeGrid | src/main/scala/com/imaginea/activegrid/core/models/AnsiblePlayBook.scala | Scala | apache-2.0 | 2,184 |
package org.bitcoins.core.crypto
import org.bitcoins.core.config.{NetworkParameters, Networks}
import org.bitcoins.core.util.{Base58, BytesUtil}
import org.bitcoins.crypto.{CryptoUtil, ECPrivateKeyBytes}
import scodec.bits.ByteVector
import scala.util.{Failure, Success, Try}
object ECPrivateKeyUtil {
/** Converts... | bitcoin-s/bitcoin-s | core/src/main/scala/org/bitcoins/core/crypto/ECPrivateKeyUtil.scala | Scala | mit | 4,241 |
/*
* 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... | gserranojc/Crossdata | driver/src/main/scala/com/stratio/crossdata/driver/config/DriverConf.scala | Scala | apache-2.0 | 9,034 |
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.