code stringlengths 5 1M | repo_name stringlengths 5 109 | path stringlengths 6 208 | language stringclasses 1
value | license stringclasses 15
values | size int64 5 1M |
|---|---|---|---|---|---|
package exerciseTwo
import akka.actor.{ActorSystem, Props}
// ------------
// EXERCISE 2
// ------------
// Fill in the code necessary to handle receiving a new message to generate the
// properties for a random circle. For testing just println when the message is received.
// See video.imageUtils.CircleProperties a... | ktoso/streams-workshop | src/exercises/exerciseTwo/CircleGenerator.scala | Scala | cc0-1.0 | 1,228 |
package atto
package parser
import atto.syntax.parser._
import java.lang.{ String, Integer }
import scala.{ Char, List, Int, StringContext, Boolean, Nil, Nothing, Unit, Option, Some, None }
import scala.Predef.{ augmentString, charWrapper }
import scala.language.higherKinds
import scalaz.Monad
import scalaz.std.string... | coltfred/atto | core/src/main/scala/atto/parser/Text.scala | Scala | mit | 6,974 |
package com.wavesplatform.api.http.requests
import play.api.libs.json.{Format, Json}
case class LeaseV1Request(sender: String, amount: Long, fee: Long, recipient: String, timestamp: Option[Long] = None)
object LeaseV1Request {
implicit val leaseCancelRequestFormat: Format[LeaseV1Request] = Json.format
}
| wavesplatform/Waves | node/src/test/scala/com/wavesplatform/api/http/requests/LeaseV1Request.scala | Scala | mit | 310 |
package im.mange.driveby.scalatest
import im.mange.driveby.{Example, ExampleAware}
import im.mange.driveby.tracking.TrackingIds
import org.scalatest._
trait NakedExample extends SuiteMixin with BeforeAndAfterEach with ExampleAware {
this: SpecLike =>
private var capturedExample: Option[Example] = None
//TODO:... | alltonp/driveby | src/main/scala/im/mange/driveby/scalatest/NakedExample.scala | Scala | apache-2.0 | 1,045 |
package im.actor.server.push
import java.nio.ByteBuffer
import scala.annotation.tailrec
import scala.concurrent._
import scala.concurrent.duration._
import akka.actor._
import akka.pattern.ask
import akka.util.Timeout
import slick.dbio.DBIO
import im.actor.api.rpc.messaging.UpdateMessage
import im.actor.api.rpc.pee... | gale320/actor-platform | actor-server/actor-cqrs/src/main/scala/im/actor/server/push/SeqUpdatesManager.scala | Scala | mit | 18,237 |
package sorm.driver
import sext._, embrace._
import sorm._
import sql._, Sql._
trait StdModify { self: StdConnection with StdStatement =>
def update
( table : String, values : Iterable[(String, Any)], pk : Iterable[(String, Any)] )
{
val exprs = values.toStream.map{case (c, v) => SetExpression(Colu... | sorm/sorm | src/main/scala/sorm/driver/StdModify.scala | Scala | mit | 1,207 |
/*
* Copyright (c) 2013 David Soergel <dev@davidsoergel.com>
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*/
package worldmake.storage
import worldmake._
import worldmake.WorldMakeConfig._
import com.typesafe.scalalogging.slf4j.Logging
sealed trait PathArtifact... | davidsoergel/worldmake | src/main/scala/worldmake/storage/PathArtifact.scala | Scala | apache-2.0 | 5,731 |
/**
* Copyright 2010-2012 Alex Jones
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with work for additional information
* regarding copyright ownership. The ASF licenses file
* to you under the Apache License, Version ... | unclealex72/west-ham-calendar | app/dao/GameDao.scala | Scala | apache-2.0 | 3,820 |
/*
* 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 ... | ericvandenbergfb/spark | core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala | Scala | apache-2.0 | 33,112 |
package app.agent
import app.model.ChecksHistory
import im.mange.jetboot._
import im.mange.jetpac._
import im.mange.jetboot.widget._
import im.mange.jetboot.widget.table.{TableHeaders, TableRow}
//TODO: consider making this live and encode the status in the row colour for inactive, open etc
//TODO: maybe ENV first
//... | alltonp/reprobate | src/main/scala/app/agent/ChecksConfigPresentation.scala | Scala | apache-2.0 | 2,695 |
package ecommerce.integration
import akka.actor.Props
import ddd.support.domain.AggregateRootActorFactory
import ddd.support.domain.protocol.Acknowledged
import ecommerce.inventory.domain.Product
import ecommerce.inventory.domain.Product.AddProduct
import ecommerce.inventory.integration.InventoryQueue
import ecommerce... | pawelkaczor/ddd-leaven-akka | src/multi-jvm/scala/ecommerce/integration/EventsPublishingClusterSpec.scala | Scala | mit | 3,086 |
import sbt._
import sbt.impl.GroupArtifactID
object Versions {
val Scopt = "3.3.0"
val Config = "1.3.0"
val Akka = "2.4.10"
val Jackson = "2.7.5"
}
object Dependencies {
def latest(artifact: GroupArtifactID): ModuleID = artifact % "latest.integration" ch... | gemelen/sgbplus | project/Dependencies.scala | Scala | apache-2.0 | 2,021 |
/*
* Copyright (C) 2015 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - 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/li... | linearregression/eventuate | src/main/scala/com/rbmhtechnology/eventuate/log/BatchingEventLog.scala | Scala | apache-2.0 | 2,984 |
package org.me.PrivateSpark
import org.me.PrivateSpark.api.{SAR_RDD, Lap_RDD, PrivateSparkContext}
object JobRunner {
def get_name(prefix : String, file_name : String, use_hdfs : Boolean, is_private : Boolean, num : Int) : String = {
val f = file_name
val h = if (use_hdfs) "h=true" else "h=false"
val p ... | alec-heif/MIT-Thesis | spark-wrapper/src/main/scala/org/me/PrivateSpark/JobRunner.scala | Scala | mit | 1,583 |
/*
* Copyright (C) 2011 Mathias Doenitz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... | backchatio/http-parsers | src/main/scala/io/backchat/http/parser/QueryParser.scala | Scala | apache-2.0 | 1,565 |
package controllers
import play.api.mvc._
import play.twirl.api.Html
import lila.api.Context
import lila.app._
import lila.game.{ GameRepo, Game => GameModel, Pov }
import views._
object Tv extends LilaController {
def index = onChannel(lila.tv.Tv.Channel.Best.key)
def onChannel(chanKey: String) = Open { impli... | Unihedro/lila | app/controllers/Tv.scala | Scala | mit | 4,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 ... | zohar-mizrahi/flink | flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/sql/JoinITCase.scala | Scala | apache-2.0 | 19,386 |
/*
* FILE: GeoSparkMetric.scala
* Copyright (c) 2015 - 2018 GeoSpark Development Team
*
* MIT License
*
* 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 ... | zongsizhang/GeoSpark | core/src/main/scala/org/datasyslab/geospark/monitoring/GeoSparkMetric.scala | Scala | mit | 2,320 |
package com.mehmetakiftutuncu.muezzinapi.utilities
import java.time.format.DateTimeFormatter
import java.util.Locale
import javax.inject.Inject
class DateFormatter @Inject()(Conf: AbstractConf) {
private val dateFormatterPattern: String = Conf.getString("muezzinApi.dateFormatter.format", "yyyy-MM-dd")
pri... | mehmetakiftutuncu/MuezzinAPI | app/com/mehmetakiftutuncu/muezzinapi/utilities/DateFormatter.scala | Scala | mit | 680 |
package sangria.schema
import sangria.introspection._
import sangria.marshalling._
import sangria.parser.DeliveryScheme.Throw
import sangria.renderer.SchemaRenderer
import sangria.util.Cache
import scala.util.{Failure, Success}
class IntrospectionSchemaMaterializer[Ctx, T: InputUnmarshaller](
introspectionResult... | OlegIlyenko/sangria | modules/core/src/main/scala/sangria/schema/IntrospectionSchemaMaterializer.scala | Scala | apache-2.0 | 8,805 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package controllers
import javax.inject.Inject
import play.api.mvc._
@deprecated("Use Default class instead", "2.6.0")
object Default extends Default
/**
* Default actions ready to use as is from your routes file.
*
* Example:
* {{{
*... | aradchykov/playframework | framework/src/play/src/main/scala/play/api/controllers/Default.scala | Scala | apache-2.0 | 1,585 |
/** **\\
** Copyright (c) 2012 Center for Organic and Medicinal Chemistry **
** Zurich University of Applied Sciences **
** WΓ€denswil, Switzerland **
\\** ... | stefan-hoeck/chemf | src/main/scala/chemf/parser/SmilesParser.scala | Scala | gpl-3.0 | 4,378 |
/*
* Copyright 2014β2017 SlamData Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | drostron/quasar | marklogic/src/main/scala/quasar/physical/marklogic/xquery/MainModule.scala | Scala | apache-2.0 | 1,676 |
package com.twitter.finagle.http
import com.twitter.finagle.Http.HttpImpl
import com.twitter.finagle.{Http, ServiceFactory, Stack, Stackable}
import com.twitter.finagle.client.EndpointerModule
import com.twitter.finagle.http2.param.PriorKnowledge
import com.twitter.finagle.http2.transport.client.{Http2Transporter, Pri... | twitter/finagle | finagle-http/src/main/scala/com/twitter/finagle/http/ClientEndpointer.scala | Scala | apache-2.0 | 2,482 |
package net.ultrametrics.fractactor
/**
* Map point values in 8-bit space to a 24-bit RGB colorspace.
*/
trait ScatterPointScaler extends PointScaler
{
override def transform(value: Int) = value * Settings.Scale8to24Bit
}
| pchuck/fractactor | src/main/scala/net/ultrametrics/fractactor/ScatterPointScaler.scala | Scala | bsd-2-clause | 227 |
package com.twitter.scrooge.backend
import com.twitter.scrooge.testutil.Spec
class NamespaceSpec extends Spec {
"Scala Generator" should {
import foo._
import bar._
import com.fake._
"import from another namespace" in {
val service: Restaurant[Some] = new Restaurant[Some] {
def isOpen(... | elipoz/scrooge | scrooge-generator/src/test/scala/com/twitter/scrooge/backend/NamespaceSpec.scala | Scala | apache-2.0 | 1,176 |
/*
* 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/ct600j/v3/J4.scala | Scala | apache-2.0 | 954 |
package im.actor.server.api.rpc.service.auth
import java.time.{ LocalDateTime, ZoneOffset }
import im.actor.server.acl.ACLUtils
import scala.concurrent.Future
import scala.concurrent.forkjoin.ThreadLocalRandom
import scalaz.{ -\\/, \\/, \\/- }
import akka.actor.ActorSystem
import akka.pattern.ask
import slick.dbio.... | jamesbond12/actor-platform | actor-server/actor-rpc-api/src/main/scala/im/actor/server/api/rpc/service/auth/AuthHelpers.scala | Scala | mit | 8,995 |
package services.tagless
trait DataOpService[F[_]] {
def add(value: String): F[Option[String]]
def findAll(): F[List[String]]
}
import monix.eval.Task
final class InMemoryDataOpInterpreter extends DataOpService[Task] {
private[this] val storage = new scala.collection.mutable.HashSet[String]
override def ad... | radusw/tagless-free-monix-sample | src/main/scala/services/tagless/DataOpService.scala | Scala | apache-2.0 | 473 |
package com.gilt.gfc.guava.future
import java.util.concurrent.{ExecutionException, Executor, TimeUnit}
import scala.concurrent.{Await, Promise, CanAwait, ExecutionContext, Future}
import scala.concurrent.duration.Duration
import scala.reflect.ClassTag
import scala.util.{Try, Success, Failure}
import com.gilt.gfc.util.... | gilt/gfc-guava | src/main/scala/com/gilt/gfc/guava/future/FutureConverters.scala | Scala | apache-2.0 | 4,906 |
/***********************************************************************
* 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/geotools/sft/package.scala | Scala | apache-2.0 | 2,931 |
package fr.laas.fape.graph
import fr.laas.fape.graph.core.{LabeledEdge, LabeledGraph}
trait LabeledGraphSuite[V,EdgeLabel] extends BaseGraphSuite[V, EdgeLabel, LabeledEdge[V,EdgeLabel]] {
private def g = graph.asInstanceOf[LabeledGraph[V,EdgeLabel]]
test("LabeledType") { assert(graph.isInstanceOf[LabeledGraph[... | athy/fape | structures/src/test/scala/fr/laas/fape/graph/LabeledGraphSuite.scala | Scala | bsd-2-clause | 339 |
package com.ibm.techempower
import java.util.concurrent.ThreadLocalRandom.{ current => random }
import scala.language.implicitConversions
import scala.language.postfixOps
import scala.collection.mutable.MutableList
import com.ibm.plain.ignore
import com.ibm.plain.rest.{ Form, Resource }
import com.ibm.plain.json.{ J... | seem-sky/FrameworkBenchmarks | plain/src/main/scala/com/ibm/techempower/Db.scala | Scala | bsd-3-clause | 2,521 |
/**
* 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 | common/shared/src/main/scala/org/orbeon/oxf/util/CoreUtils.scala | Scala | lgpl-2.1 | 2,360 |
/***********************************************************************
* 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-spark/geomesa-spark-jts/src/main/scala/org/locationtech/geomesa/spark/jts/udf/SpatialRelationFunctions.scala | Scala | apache-2.0 | 7,353 |
package services.currencies.suppliers
import scala.concurrent.Future
import java.util.Date
object Supplier {
case class CurrencyInput(source: String, target: String, rate: Int, date: Date)
}
trait Supplier {
def get(): List[Future[List[Supplier.CurrencyInput]]]
} | marcin-lawrowski/felicia | app/services/currencies/suppliers/Supplier.scala | Scala | gpl-3.0 | 272 |
/*
* Copyright (c) 2011-16 Miles Sabin
*
* 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... | liff/shapeless | core/src/test/scala/shapeless/typeoperators.scala | Scala | apache-2.0 | 4,076 |
import leon.lang._
import leon.annotation._
import leon.instrumentation._
import leon.lang.synthesis._
import ConcTrees._
import ConQ._
import Conqueue._
object ConcTrees {
abstract class Conc[T] {
def isEmpty: Boolean = this == Empty[T]()
def level: BigInt = {
this match {
case Empty() =>
... | regb/leon | testcases/lazy-datastructures/ManualnOutdated/Conqueue-strategy3.scala | Scala | gpl-3.0 | 22,812 |
package BIDMach.networks
import BIDMat.{Mat,SBMat,CMat,CSMat,DMat,FMat,IMat,LMat,HMat,GMat,GDMat,GIMat,GLMat,GSMat,GSDMat,SMat,SDMat}
import BIDMat.MatFunctions._
import BIDMat.SciFunctions._
import BIDMach.datasources._
import BIDMach.datasinks._
import BIDMach.updaters._
import BIDMach.mixins._
import BIDMa... | jamesjia94/BIDMach | src/main/scala/BIDMach/networks/SeqToSeq.scala | Scala | bsd-3-clause | 12,458 |
/*
Copyright 2012 Twitter, Inc.
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
distributed under the License is distributed on an "AS IS" BASIS,
WIT... | epishkin/scalding | scalding-core/src/main/scala/com/twitter/scalding/GroupBuilder.scala | Scala | apache-2.0 | 13,707 |
object Solution {
def numberOfCycleDigits(n: Int, d: Int): Int = {
val remainderMap = collection.mutable.Map.empty[Int, Int]
var num = n
for (i <- 1 to d) {
val remainder = num % d
if (remainder == 0) return 0
if (remainderMap.contains(remainder)) {
return remainderMap.size - r... | advancedxy/hackerrank | project-euler/problem-26/ReciprocalCycles.scala | Scala | mit | 978 |
/** This file is part of TextCompose, a program for producing PDF from text files.
* Copyright 2014 Jesper S Villadsen <jeschvi@gmail.com>
* License: GNU Affero General Public License version 3 or later.
* For full license text see LICENSE.txt or <http://www.gnu.org/licenses/>.
*/
package textcompose.editor
... | jvilladsen/TextCompose | src/main/scala/editor/Progress.scala | Scala | agpl-3.0 | 1,352 |
package test
import org.scaladebugger.api.lowlevel.events.{EventHandlerInfo, JDIEventArgument, EventManager}
import org.scaladebugger.api.lowlevel.events.EventType.EventType
/**
* Test event manager that merely invokes the provided event manager
* underneath to make it easier to mock.
*
* @param eventManager The ... | ensime/scala-debugger | scala-debugger-api/src/test/scala/test/TestEventManager.scala | Scala | apache-2.0 | 1,555 |
package mesosphere.marathon.health
import akka.actor._
import akka.event.EventStream
import akka.testkit.EventFilter
import com.codahale.metrics.MetricRegistry
import com.typesafe.config.ConfigFactory
import mesosphere.marathon.metrics.Metrics
import mesosphere.marathon.{ MarathonScheduler, MarathonSchedulerDriverHold... | bsideup/marathon | src/test/scala/mesosphere/marathon/health/MarathonHealthCheckManagerTest.scala | Scala | apache-2.0 | 11,185 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package org.scalajs.nscplugin.test
import uti... | SebsLittleHelpers/scala-js | compiler/src/test/scala/org/scalajs/nscplugin/test/OptimizationTest.scala | Scala | apache-2.0 | 7,834 |
/*
* Copyright Β© 2015-2019 the contributors (see Contributors.md).
*
* This file is part of Knora.
*
* Knora is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
*... | musicEnfanthen/Knora | webapi/src/test/scala/org/knora/webapi/other/v1/DrawingsGodsV1E2ESpec.scala | Scala | agpl-3.0 | 7,311 |
package com.etsy.sahale
import org.junit.runner.RunWith
import org.scalatest._
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
class StepStatusSpec extends FlatSpec with ShouldMatchers {
val expected = Map[String, Any](
"stepnumber" -> "foo",
"sources" -> FlowTracker.UNKNOWN,
"si... | ind9/Sahale | src/test/scala/StepStatusSpec.scala | Scala | mit | 1,339 |
package com.gravity.goose
import java.io.File
import com.gravity.goose.utils.Filter
import org.apache.commons.io.FileUtils
import org.json4s._
import org.json4s.jackson.JsonMethods._
import org.json4s.native.Serialization
object HTMLFilter {
/**
* you can use this method if you want to run goose from the command... | njosephef/extractor | src/main/scala/com/gravity/goose/HTMLFilter.scala | Scala | apache-2.0 | 2,057 |
package scala.slick.driver.test
import org.junit.runner.RunWith
import com.typesafe.slick.testkit.util.{ExternalJdbcTestDB, TestDB, DriverTest, Testkit}
import scala.slick.jdbc.ResultSetInvoker
import scala.slick.jdbc.GetResult._
import scala.slick.driver.MyPostgresDriver
@RunWith(classOf[Testkit])
class MyPostgresTe... | leithaus/strategies | slicktrix/src/test/scala/slick/driver/test/MyPostgresTest.scala | Scala | cc0-1.0 | 1,210 |
package com.sksamuel.scrimage.nio
class PictWriter extends TwelveMonkeysWriter {
override def format: String = "Pict"
}
| carlosFattor/scrimage | scrimage-io-extra/src/main/scala/com/sksamuel/scrimage/nio/PictWriter.scala | Scala | apache-2.0 | 124 |
package org.openapitools.client.model
case class EmptyChangeLogSet (
_class: Option[String],
_kind: Option[String]
)
object EmptyChangeLogSet {
def toStringBody(var_class: Object, var_kind: Object) =
s"""
| {
| "class":$var_class,"kind":$var_kind
| }
""".stripMargi... | cliffano/swaggy-jenkins | clients/scala-gatling/generated/src/gatling/scala/org/openapitools/client/model/EmptyChangeLogSet.scala | Scala | mit | 324 |
package net.liftweb.util
import java.lang.ref.{ReferenceQueue,SoftReference};
import java.util._
import java.util.concurrent.locks._
import net.liftweb.util._
import Map._
import Helpers._
import ActorPing._
import _root_.scala.actors.{Actor, Exit, OutputChannel}
import _root_.scala.actors.Actor._
/**
* Companion m... | beni55/liftweb | lift-util/src/main/scala/net/liftweb/util/SoftReferenceCache.scala | Scala | apache-2.0 | 3,728 |
/*
* 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 ... | hortonworks/spark-native-yarn | src/main/scala/org/apache/spark/tez/TezJobExecutionContext.scala | Scala | apache-2.0 | 9,440 |
package net.fwbrasil.zoot.spray.response
import net.fwbrasil.zoot.core.response.Response
import spray.http.HttpEntity.apply
import spray.http.HttpResponse
import spray.http.HttpHeaders._
object responseToSpray {
def apply(response: Response[Array[Byte]]) = {
val status = responseStatus.toSpray(response.s... | fwbrasil/zoot | zoot-spray/src/main/scala/net/fwbrasil/zoot/spray/response/ResponseToSpray.scala | Scala | lgpl-2.1 | 577 |
package com.typesafe.slick.testkit.tests
import com.typesafe.slick.testkit.util.{JdbcTestDB, AsyncTest}
import scala.reflect.ClassTag
class JdbcMapperTest extends AsyncTest[JdbcTestDB] {
import tdb.profile.api._
def testMappedEntity = {
import TupleMethods._
case class User(id: Option[Int], first: Stri... | slick/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcMapperTest.scala | Scala | bsd-2-clause | 16,429 |
package io.github.meshelton.secs
/**
* A system contains the logic manipulating data in components attached to entities
*
* Subclasses of this class should take as constructor parameters all the [[io.github.meshelton.secs.ComponentManager ComponentManagers]] that it is interested in.
*
* @constructor creat... | meshelton/SECS | core/src/main/scala/io/github/meshelton/secs/System.scala | Scala | gpl-2.0 | 694 |
package gapt.proofs.lk.util
import gapt.expr._
import gapt.expr.formula.All
import gapt.expr.formula.And
import gapt.expr.formula.Atom
import gapt.expr.formula.Bottom
import gapt.expr.formula.Ex
import gapt.expr.formula.Formula
import gapt.expr.formula.Imp
import gapt.expr.formula.Neg
import gapt.expr.formula.Or
impor... | gapt/gapt | core/src/main/scala/gapt/proofs/lk/util/solve.scala | Scala | gpl-3.0 | 2,770 |
package com.sksamuel.scrimage.filter
import org.scalatest.{ OneInstancePerTest, BeforeAndAfter, FunSuite }
import com.sksamuel.scrimage.Image
/** @author Stephen Samuel */
class SparkleFilterTest extends FunSuite with BeforeAndAfter with OneInstancePerTest {
val original = getClass.getResourceAsStream("/bird_small... | carlosFattor/scrimage | scrimage-filters/src/test/scala/com/sksamuel/scrimage/filter/SparkleFilterTest.scala | Scala | apache-2.0 | 552 |
package org.skycastle.client
import org.skycastle.entity.accesscontrol.{CallRight, Right}
import org.skycastle.entity.{Entity, EntityId}
import org.skycastle.ui.ScreenEntity
/**
* Holds data about a server on a client.
*
* Can be used to create a connection to the server, with a specified user name, or to registe... | weimingtom/skycastle | src/main/scala/org/skycastle/client/ServerEntry.scala | Scala | gpl-2.0 | 1,440 |
/**
* Copyright 2011-2012 @WalmartLabs, a division of Wal-Mart Stores, 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
*
* Unl... | walmartlabs/mupd8 | src/test/scala/com/walmartlabs/mupd8/MessageServerTest.scala | Scala | apache-2.0 | 1,898 |
package shopScala
import akka.NotUsed
import akka.stream.scaladsl.Source
import org.reactivestreams.Publisher
import play.api.libs.iteratee.{Enumerator, Iteratee}
import play.api.libs.streams.Streams
import rx.lang.scala._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
packa... | hermannhueck/reactive-mongo-access | src/main/scala/shopScala/queries/package.scala | Scala | apache-2.0 | 1,188 |
package com.partup
import java.time.OffsetDateTime
import iot.jcypher.query.factories.clause.{MATCH, RETURN}
import iot.jcypher.query.values.JcNode
import iot.jcypher.query.{JcQuery, JcQueryResult}
import org.scalatest.FunSuite
import scala.collection.JavaConversions._
class Neo4jClauseCreator$Test extends FunSuite... | part-up/api | src/test/scala/com/partup/Neo4jClauseCreator$Test.scala | Scala | agpl-3.0 | 2,486 |
/*
* Copyright (c) 2002-2018 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundatio... | HuangLS/neo4j | community/cypher/compatibility-suite/src/test/scala/cypher/cucumber/reporter/CypherResultReporter.scala | Scala | apache-2.0 | 2,313 |
package leo.modules.normalization
import leo.datastructures.blackboard.FormulaStore
import leo.datastructures.impl.Signature
import leo.datastructures.term._
import Term._
import leo.datastructures._
/**
*
* Takes a Formula in Negation Normal Form and Computes an
* existential free representation.
*
* @author M... | cbenzmueller/LeoPARD | src/main/scala/leo/modules/normalization/Skolemization.scala | Scala | bsd-3-clause | 6,971 |
package akka.statsd
import akka.actor.{ActorLogging, Props, Actor, ActorRef}
import akka.io.{Udp, IO}
import java.net.InetSocketAddress
/* originated from: http://doc.akka.io/docs/akka/snapshot/scala/io-udp.html */
class UdpListener(nextActor: ActorRef, port: Int)
extends Actor
with ActorLogging {
import conte... | thenewmotion/akka-actor-statsd | akka-statsd-core/src/test/scala/UdpListener.scala | Scala | mit | 898 |
package de.tuberlin.uebb.sl2.tests.specs
import org.scalatest.matchers._
import org.scalatest.FunSpec
import de.tuberlin.uebb.sl2.modules._
trait ModuleResolverSpec extends FunSpec with ShouldMatchers {
this : ModuleResolver with Syntax with Errors =>
def testedImplementationName(): String
def notFail: Matc... | mzuber/simple-language | src/test/scala/specs/ModuleResolverSpec.scala | Scala | bsd-3-clause | 4,359 |
/*
* 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 ... | HeartSaVioR/incubator-zeppelin | cassandra/src/main/scala/org/apache/zeppelin/cassandra/BoundValuesParser.scala | Scala | apache-2.0 | 2,715 |
/*
* 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 ... | saltstar/spark | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala | Scala | apache-2.0 | 55,882 |
/*
* 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 ... | wangmiao1981/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategySuite.scala | Scala | apache-2.0 | 28,459 |
/*
* Copyright 2013-2015 Websudos, Limited.
*
* 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 c... | analytically/phantom | phantom-dsl/src/main/scala/com/websudos/phantom/builder/ops/ImplicitMechanism.scala | Scala | bsd-2-clause | 6,094 |
package com.twitter.zipkin.web
import com.twitter.common.stats.ApproximateHistogram
import com.twitter.conversions.time._
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.tracing.SpanId
import com.twitter.finagle.{Filter, Service, SimpleFilte... | bbc/zipkin | zipkin-web/src/main/scala/com/twitter/zipkin/web/Handlers.scala | Scala | apache-2.0 | 19,872 |
/*
Β * Copyright (c) 1995, 2008, Oracle and/or its affiliates. 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
Β *Β Β Β Β no... | benhutchison/scala-swing | examples/src/main/scala/scala/swing/examples/tutorials/components/ButtonDemo.scala | Scala | bsd-3-clause | 4,244 |
package com.github.leifh.seglcoverage
import org.specs2.mutable.SpecificationWithJUnit
class SystemSpec extends SpecificationWithJUnit {
"System" should {
"allow to order a product" in {
SystemService.orderProduct(Product("bla"), Customer("Eric", Switzerland, 18)) must beSome
}
"return false fo... | leifh/segl-coverage | src/test/scala/com/github/leifh/seglcoverage/SystemSpec.scala | Scala | apache-2.0 | 820 |
package chapter24
/**
* 24.7 λ§΅
*
* λ§΅μ ν€μ κ°μ μ(mapping, association)μ Iterableμ΄λ€. 21.4μ μμ μ€λͺ
νλ―μ΄ μ€μΉΌλΌμ Pref ν΄λμ€μλ
* key => valueλ₯Ό (key, value) μ λμ μ¬μ©ν μ μλ μμμ λ³νμ΄ λ€μ΄ μλ€.
* Map("x" -> 24) λ Map(("x", 24))μ κ°λ€.
*
* - κ²μ μ°μ°: apply, get, getOrElse, contains, isDefinedAt. λ§΅μ ν€μμ κ°μΌλ‘ κ°λ λΆλΆ ν¨μ
* λ‘ λ§λ λ€. m get key μ°... | seraekim/srkim-lang-scala | src/main/java/chapter24/c24_i07.scala | Scala | bsd-3-clause | 2,731 |
/*
* 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 ... | tillrohrmann/flink | flink-streaming-scala/src/main/scala/org/apache/flink/streaming/api/scala/StreamExecutionEnvironment.scala | Scala | apache-2.0 | 49,789 |
package io.eels.component.json
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
import io.eels.schema.StructType
import io.eels.{Row, Sink, SinkWriter}
import org.apache.hadoop.fs.{Fi... | eel-lib/eel | eel-core/src/main/scala/io/eels/component/json/JsonSink.scala | Scala | mit | 956 |
package at.logic.gapt.formats.ivy
import at.logic.gapt.formats.ClasspathInputFile
import org.specs2.matcher.MatchResult
import org.specs2.specification.core.Fragments
import conversion.IvyToResolution
import org.specs2.mutable._
import at.logic.gapt.formats.lisp.{ LList, SExpressionParser }
/**
* Test for the Ivy in... | gebner/gapt | tests/src/test/scala/at/logic/gapt/provers/prover9/IvyToRobinsonTest.scala | Scala | gpl-3.0 | 1,088 |
package services
import java.util.UUID
import javax.inject.Singleton
@Singleton
class UUIDGenerator {
def generate: UUID = UUID.randomUUID()
def generateStr: String = generate.toString
} | metaxmx/FridayNightBeer | app/services/UUIDGenerator.scala | Scala | apache-2.0 | 195 |
/*
* 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 ... | chenc10/Spark-PAF | mllib/src/main/scala/org/apache/spark/ml/tree/Node.scala | Scala | apache-2.0 | 14,410 |
/**
* 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... | digital-preservation/dali | src/main/scala/uk/gov/tna/dri/preingest/loader/store/DataStore.scala | Scala | mpl-2.0 | 2,333 |
package org.nd4s
import org.nd4j.linalg.api.complex.{IComplexNDArray, IComplexNumber}
import org.nd4j.linalg.api.ndarray.INDArray
import org.nd4j.linalg.factory.Nd4j
import org.nd4j.linalg.indexing.{NDArrayIndex, INDArrayIndex}
import _root_.scala.util.control.Breaks._
object Implicits {
implicit class RichINDArr... | LiuShifeng/nd4s | src/main/scala/org/nd4s/Implicits.scala | Scala | apache-2.0 | 11,537 |
/*
* Scala.js (https://www.scala-js.org/)
*
* Copyright EPFL.
*
* Licensed under Apache License 2.0
* (https://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package java.util.concurrent
import java.lang... | scala-js/scala-js | javalib/src/main/scala/java/util/concurrent/CopyOnWriteArrayList.scala | Scala | apache-2.0 | 10,973 |
package spire
package math
import scala.collection.mutable.ArrayBuilder
import spire.algebra._
import spire.math.poly._
import spire.std.array._
import spire.syntax.field._
import spire.syntax.eq._
import spire.syntax.std.seq._
/**
* Polynomial
* A univariate polynomial class and EuclideanRing extension trait
... | adampingel/spire | core/src/main/scala/spire/math/Polynomial.scala | Scala | mit | 21,776 |
/*
* 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 ... | PacktPublishing/Mastering-Mesos | Chapter8/samza-mesos/src/main/scala/eu/inn/samza/mesos/MesosTask.scala | Scala | mit | 6,018 |
package play.api.db.evolutions
import play.api.{Configuration, Environment}
import play.api.inject.Module
class SubFolderEvolutionsModule extends Module {
def bindings(environment: Environment, configuration: Configuration) = {
Seq(
bind[EvolutionsConfig].toProvider[DefaultEvolutionsConfigParser],
b... | giabao/subfolder-evolutions | module/src/main/scala/play/api/db/evolutions/SubFolderEvolutionsModule.scala | Scala | apache-2.0 | 523 |
package org.jetbrains.plugins.scala
package lang
package refactoring
import com.intellij.lang.refactoring.RefactoringSupportProvider
import com.intellij.psi.PsiElement
import com.intellij.refactoring.RefactoringActionHandler
import com.intellij.refactoring.changeSignature.ChangeSignatureHandler
import org.jetbrains.p... | JetBrains/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/ScalaRefactoringSupportProvider.scala | Scala | apache-2.0 | 2,271 |
/*
* 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 ... | likithkailas/StreamingSystems | core/src/main/scala/org/apache/spark/scheduler/BatchJobWaiter.scala | Scala | apache-2.0 | 2,740 |
package com.outr.nextui
trait Peer[I] {
val component: Component
val impl: I
private var _initialized = false
final def initialized: Boolean = _initialized
final def init(): Unit = synchronized {
if (!initialized) {
initialize()
_initialized = true
}
}
protected def initialize(): Un... | outr/nextui | core/src/main/scala/com/outr/nextui/Peer.scala | Scala | mit | 324 |
/*
* Copyright (C) 2012-2014-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package scala.async
package run
package live
import org.junit.Test
import internal.AsyncTestLV
import AsyncTestLV._
case class Cell[T](v: T)
class Meter(val len: Long) extends AnyVal
case class MCell[T](var v: T)
class LiveVariablesS... | anand-singh/async | src/test/scala/scala/async/run/live/LiveVariablesSpec.scala | Scala | bsd-3-clause | 6,667 |
/*
* Copyright 2001-2013 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | travisbrown/scalatest | src/test/scala/org/scalatest/junit/JUnitWrapperSuiteSuite.scala | Scala | apache-2.0 | 6,604 |
/*
* Copyright 2014β2018 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... | slamdata/matryoshka | tests/shared/src/test/scala/matryoshka/exp2/package.scala | Scala | apache-2.0 | 825 |
/**
* 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... | sslavic/kafka | core/src/test/scala/unit/kafka/server/AdvertiseBrokerTest.scala | Scala | apache-2.0 | 3,883 |
/***********************************************************************
* Copyright (c) 2013-2016 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 is ... | MutahirKazmi/geomesa | geomesa-index-api/src/main/scala/org/locationtech/geomesa/index/utils/ByteArrays.scala | Scala | apache-2.0 | 6,465 |
package controllers
import java.io.File
import es.weso.wiFetcher.fetchers.SpreadsheetsFetcher
import play.api.data.Form
import play.api.data.Forms.mapping
import play.api.data.Forms.number
import play.api.data.Forms.optional
import play.api.data.Forms.text
import play.api.data.validation.Constraints.max
import play.ap... | weso/wiFetcher | app/controllers/FileUploadController.scala | Scala | apache-2.0 | 5,505 |
package ch.epfl.lamp
import dispatch.classic.{ Request, Http, NoLogging, StatusCode, ConfiguredHttpClient, url }
import spray.json.{ JsNull, JsonParser, DefaultJsonProtocol, JsValue }
import RichJsValue._
import org.apache.commons.codec.digest.DigestUtils
import org.apache.commons.codec.binary.{ Hex, Base64 }
import j... | sbt-coursera/sbt-coursera | src/main/scala/ch/epfl/lamp/CourseraHttp.scala | Scala | bsd-3-clause | 9,923 |
/*
* La Trobe University - Distributed Deep Learning System
* Copyright 2016 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 | base/src/main/scala/edu/latrobe/io/package.scala | Scala | apache-2.0 | 2,664 |
package use.basic.bundles
import org.scalatest.FunSuite
class BundlesSample02UseTest extends FunSuite {
test("BundlesSample02Use#use1γεΌγΆ") {
val d = new BundlesSample02Use
val a = d.use1()
assert(a == ())
}
test("BundlesSample02Use#use2γεΌγΆ") {
val d = new BundlesSample02Use
val a = d.use... | thachi/scala-macro-sample | use/src/test/scala/use/basic/bundles/BundlesSample02UseTest.scala | Scala | apache-2.0 | 370 |
package org.jetbrains.sbt
package annotator.quickfix
import com.intellij.codeInsight.intention.AbstractIntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder
import com.intellij.openapi.externalSystem.util.ExternalSystemUtil
import com.intellij.... | ilinum/intellij-scala | src/org/jetbrains/sbt/annotator/quickfix/SbtRefreshProjectQuickFix.scala | Scala | apache-2.0 | 875 |
package smtlib
package printer
import parser.Commands._
import parser.Terms._
import java.io.Writer
trait TerminalTreesPrinter {
/*
* Provide functions to print the basic elements of the trees.
* Only print the simplest elements, that do not need a recursion.
*/
protected def printConstant(c: Constant... | manoskouk/scala-smtlib | src/main/scala/smtlib/printer/TerminalTreesPrinter.scala | Scala | mit | 3,049 |
package edu.ucsb.apss.partitioning
import org.scalatest.{BeforeAndAfter, Matchers, FlatSpec}
/**
* Created by dimberman on 4/18/16.
*/
class PartitionHasherTest extends FlatSpec with Matchers with BeforeAndAfter{
val hasher = new PartitionHasher
"the partition hasher" should "hash buckets into associate... | danielryan2430/All-Pairs-Similarity-Spark | src/test/scala/edu/ucsb/apss/partitioning/PartitionHasherTest.scala | Scala | apache-2.0 | 788 |
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.