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 |
|---|---|---|---|---|---|
/*
* This file is part of the sohva 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 or agreed to ... | gnieh/sohva | src/test/scala/gnieh/sohva/test/TestCopy.scala | Scala | apache-2.0 | 1,857 |
package fpinscala.laziness
import Stream._
import scala.annotation.tailrec
trait Stream[+A] {
def foldRight[B](z: => B)(f: (A, => B) => B): B = // The arrow `=>` in front of the argument type `B` means that the function `f` takes its second argument by name and may choose not to evaluate it.
this match {
... | pierangeloc/fpinscala | exercises/src/main/scala/fpinscala/laziness/Stream.scala | Scala | mit | 6,425 |
/*
* This file is part of Evo2DSim.
*
* Evo2DSim is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Evo2DSim is distrib... | vchuravy/Evo2DSim | core/src/main/scala/org/vastness/evo2dsim/core/evolution/genomes/byte/ByteGenome.scala | Scala | mit | 2,723 |
package com.twitter.finagle.kestrel.integration
import com.twitter.conversions.time._
import com.twitter.finagle.Service
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle.kestrel.Server
import com.twitter.finagle.kestrel.protocol._
import com.twitter.finagle.memcached.util.ChannelBufferUtils.... | cogitate/twitter-finagle-uuid | finagle-kestrel/src/test/scala/com/twitter/finagle/kestrel/integration/InterpreterServiceTest.scala | Scala | apache-2.0 | 1,860 |
package com.bloomberg.sparkflow.dc
import com.bloomberg.sparkflow.partitioning.SecondarySortPartioner
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.Encoder
import scala.reflect.ClassTag
/**
* Created by ngoehausen on 6/6/16.
*/
class SecondaryPairDCFunctions[K,K2,V](self: DC[((K,K2),V)])
... | nimbusgo/spark-flow | src/main/scala/com/bloomberg/sparkflow/dc/SecondaryPairDCFunctions.scala | Scala | apache-2.0 | 1,160 |
package web_services
object FromUrlExample{
def main(args: Array[String]) {
println(get("https://facebook.com"))
}
@throws(classOf[java.io.IOException])
def get(url: String) = scala.io.Source.fromURL(url).mkString
}
| rafaelkyrdan/cookbook | src/main/scala/web_services/FromUrlExample.scala | Scala | mit | 233 |
package crakken.test
import scala.concurrent._
import spray.client.pipelining._
import spray.http.{StatusCode, HttpResponse}
/**
* Created by 601292 on 4/4/2014.
*/
object FetchMocker {
import ExecutionContext.Implicits.global
def apply(status: Integer, response: String): SendReceive = {
request => future... | CrakkenCrawler/crakken | test/crakken/test/FetchMocker.scala | Scala | apache-2.0 | 406 |
package fpinscala.testing
import fpinscala.state._
import fpinscala.laziness._
import fpinscala.errorhandling._
import fpinscala.parallelism.Par
import fpinscala.parallelism.Par.Par
import Prop._
import Gen._
case class Gen[+A](sample: State[RNG, A], domain: Option[Stream[A]]) {
// Exercise 6: Implement flatMap, an... | goboss/fpinscala | exercises/src/main/scala/fpinscala/testing/Gen.scala | Scala | mit | 7,081 |
package au.gov.dva.sopapi.veaops
import java.time.LocalDate
import au.gov.dva.sopapi.veaops.interfaces.{HasDates, VeaDeterminationOccurance, VeaOperationalServiceRepository}
object VeaOperationalServiceQueries {
def getOpsAndActivitiesOnDate(testDate: LocalDate, allDeterminations: List[VeaDetermination]): Map[VeaD... | govlawtech/dva-sop-api | app/src/main/scala/au/gov/dva/sopapi/veaops/VeaOperationalServiceQueries.scala | Scala | apache-2.0 | 2,224 |
/*
* 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 ... | gioenn/xSpark | mllib/src/test/scala/org/apache/spark/ml/regression/GBTRegressorSuite.scala | Scala | apache-2.0 | 8,152 |
// Copyright 2015,2016,2017,2018,2019,2020 Commonwealth Bank of Australia
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless req... | CommBank/grimlock | grimlock-core/src/test/scala/commbank/grimlock/TestPartitioners.scala | Scala | apache-2.0 | 15,892 |
/* NSC -- new Scala compiler
* Copyright 2005-2013 LAMP/EPFL
* @author Paul Phillips
*/
package scala.tools.partest
import scala.tools.partest.nest.FileManager.compareContents
/** A class for testing icode. All you need is this in a
* partest source file --
* {{{
* object Test extends IcodeComparison
* ... | felixmulder/scala | src/partest-extras/scala/tools/partest/IcodeComparison.scala | Scala | bsd-3-clause | 3,138 |
/*
* 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 ... | brad-kaiser/spark | sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala | Scala | apache-2.0 | 34,880 |
package scorex.transaction.state.database.state.storage
trait AssetsExtendedStateStorageI {
def getTransactions(key: String): Set[String]
def addTransaction(key: String, transaction: String): Unit
def setHeight(asset: String, heights: Set[Int]): Unit
def getHeights(asset: String): Set[Int]
def addHeight... | B83YPoj/Waves | src/main/scala/scorex/transaction/state/database/state/storage/AssetsExtendedStateStorageI.scala | Scala | apache-2.0 | 589 |
/**
* sbt-aop - AspectJ for nested projects.
*
* Copyright (c) 2013 Alexey Aksenov ezh@ezh.msk.ru
*
* 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/L... | digimead-specific/sbt-aop | src/main/scala/sbt/aop/argument/Generic.scala | Scala | apache-2.0 | 2,075 |
package co.ledger.wallet.web.ripple.controllers.wallet
import biz.enef.angulate.Module.RichModule
import biz.enef.angulate.core.Location
import biz.enef.angulate.{Controller, Scope}
import co.ledger.wallet.core.device.Device
import co.ledger.wallet.core.device.ripple.LedgerApi
import co.ledger.wallet.core.device.rippl... | LedgerHQ/ledger-wallet-ripple | src/main/scala/co/ledger/wallet/web/ripple/controllers/wallet/SendPerformController.scala | Scala | mit | 13,014 |
package lt.node.scandra.pirkimai
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.View._
import util.{FileUtil, OrderPurchase}
import xml.{XML, Node}
import android.util.Log
import android.widget.{Toast, TextView, Button}
class PurchaseDec... | vytasab/scandra | pirkimai/src/main/scala/lt/node/scandra/pirkimai/PurchaseDecision.scala | Scala | apache-2.0 | 6,846 |
package com.xta.spark.color.converter
/**
* Created by Rex on 7/25/16.
*/
import org.scalatest._
class ConvertSpec extends FlatSpec with ShouldMatchers {
//region Rgb to Hex
"RGB black" should "convert to Hex" in {
val color = new Rgb((0, 0, 0))
Convert.RgbToHex(color) should equal(new Hex("#000000... | xta/spark-color-converter | src/test/scala/com/xta/spark/color/converter/ConvertSpec.scala | Scala | mit | 1,695 |
package pl.writeonly.son2.jack.glue
import pl.writeonly.son2.apis.converters.CreatorConverter
class CreatorConverterJack
extends CreatorConverter(
new ChainNotationConfigJack(),
new ChainNotationRWTJack()
)
object CreatorConverterJack
extends CreatorConverter(
new ChainNotationConfigJac... | writeonly/son2 | scallions-impl/scallions-jack/src/main/scala/pl/writeonly/son2/jack/glue/CreatorConverterJack.scala | Scala | apache-2.0 | 364 |
package rere.sasl.util
import org.scalatest.FlatSpec
import org.scalatest.Matchers._
class Base64StringTest extends FlatSpec {
behavior of "Base64String"
it should "provide correct equals implementation" in {
new Base64String("abc") shouldBe new Base64String("abc")
new Base64String("abc").equals("abc") ... | pbaun/rere | modules/sasl/src/test/scala/rere/sasl/util/Base64StringTest.scala | Scala | apache-2.0 | 618 |
/*
* 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... | jedesah/Quasar | connector/src/main/scala/quasar/qscript/rewrites/Unicoalesce.scala | Scala | apache-2.0 | 5,111 |
package com.twitter.finagle.service
import org.jboss.netty.channel.local._
import org.jboss.netty.channel._
import org.jboss.netty.bootstrap.ServerBootstrap
import com.twitter.util.TimeConversions._
import com.twitter.util.{Await, Throw, Try}
import com.twitter.finagle.builder.ClientBuilder
import com.twitter.finagle... | yancl/finagle-6.22.0 | finagle-httpx/src/test/scala/com/twitter/finagle/httpx/service/ClientTest.scala | Scala | apache-2.0 | 2,661 |
package scintuit.util
import scintuit.raw.customer.Customer
import scintuit.util.auth.AuthConfig
import scintuit.util.http.{Response, Request}
import scalaz.{Monad, Catchable, \\/}
import scalaz.std.option._
import scalaz.syntax.monad._
import scalaz.syntax.either._
import scala.language.postfixOps
object oauth {
... | drbild/scintuit | core/src/main/scala/scintuit/util/oauth.scala | Scala | apache-2.0 | 2,204 |
package com.cevaris.pingpong
import akka.actor._
import akka.routing.{ Broadcast, RoundRobinPool }
import com.typesafe.scalalogging.LazyLogging
trait StepMessage
object StepMessage {
def next(step: StepMessage) = step match {
case FinalStep() => step
case Step(v: Int) if v > 0 => Step(v-1)
case Step(... | cevaris/akka-ping-pong | src/main/scala/com/cevaris/pingpong/PingPong.scala | Scala | apache-2.0 | 1,885 |
package com.danielasfregola.twitter4s.entities.v2.responses
import com.danielasfregola.twitter4s.entities.v2.{Error, TweetIncludes, Tweet}
final case class TweetResponse(data: Option[Tweet], includes: Option[TweetIncludes], errors: Seq[Error])
| DanielaSfregola/twitter4s | src/main/scala/com/danielasfregola/twitter4s/entities/v2/responses/TweetResponse.scala | Scala | apache-2.0 | 246 |
/*
* Copyright 2018 Analytics Zoo Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | intel-analytics/analytics-zoo | zoo/src/main/scala/com/intel/analytics/zoo/pipeline/api/keras/layers/AveragePooling3D.scala | Scala | apache-2.0 | 3,716 |
/**
* Created by Xavier on 2016/7/8.
*/
object HelloScala {
def main(args: Array[String]) {
delayed(time())
}
def time() = {
println("获取时间 : 单位为纳秒")
System.nanoTime()
}
def delayed( t: => Long) = {
println("在delayed 方法中")
println("参数 : " + t)
t
}
}
| xydaxia0/scala-gradle | src/main/scala/HelloScala.scala | Scala | apache-2.0 | 328 |
package it.polimi.genomics.core
import it.polimi.genomics.core.DataStructures.IRVariable
/**
* Created by Luca Nanni on 04/11/17.
* Email: luca.nanni@mail.polimi.it
*/
case class DAGWrapper(dag: List[IRVariable]) extends Serializable
| DEIB-GECO/GMQL | GMQL-Core/src/main/scala/it/polimi/genomics/core/DAGWrapper.scala | Scala | apache-2.0 | 242 |
/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.scaladsl.broker
import akka.persistence.query.Offset
import akka.stream.scaladsl.Source
import com.lightbend.internal.broker.TaggedOffsetTopicProducer
import com.lightbend.lagom.scaladsl.api.broker.Topic
import com.lightben... | lagom/lagom | service/scaladsl/broker/src/main/scala/com/lightbend/lagom/scaladsl/broker/TopicProducer.scala | Scala | apache-2.0 | 3,480 |
package sbt
import java.lang.reflect.InvocationTargetException
import scala.annotation.tailrec
private[sbt] sealed abstract class ExceptionCategory {
def isFull: Boolean = false
}
private[sbt] object ExceptionCategory {
@tailrec def apply(t: Throwable): ExceptionCategory = t match {
case _: AlreadyHandledExcep... | olove/xsbt | main/command/src/main/scala/sbt/ExceptionCategory.scala | Scala | bsd-3-clause | 824 |
import scala.scalajs.js
import scala.scalajs.js.annotation.*
@js.native
@JSGlobal
class Container extends js.Object {
@JSName("A1") // error
trait A extends js.Object
@JSName("B1") // error
trait B
@JSName("C1") // error
@js.native
trait C extends js.Object
}
| dotty-staging/dotty | tests/neg-scalajs/jsname-on-trait.scala | Scala | apache-2.0 | 277 |
package utils.pageobjects.circumstances.start_of_process
import utils.pageobjects.{CircumstancesPage, PageObjectsContext}
final class GGoToCircsPage(ctx:PageObjectsContext) extends CircumstancesPage(ctx, GGoToCircsPage.url) {
}
object GGoToCircsPage {
val url = "/circumstances/report-changes/gotofunction"
}
| Department-for-Work-and-Pensions/ClaimCapture | c3/test/utils/pageobjects/circumstances/start_of_process/GGoToCircsPage.scala | Scala | mit | 316 |
package http.di
import http.shop.Shop
import http.shop.warehouse.Warehouse
trait Environment {
val shop: Shop
val warehouse: Warehouse
}
| DarkToast/scala-workshop | workshop/src/main/scala/http/di/Environment.scala | Scala | mit | 143 |
package debop4s.rediscala.client
import debop4s.core._
import debop4s.core.concurrent._
import debop4s.rediscala.AbstractRedisFunSuite
import redis.{RedisClientMasterSlaves, RedisServer}
/**
* Redis 서버가 Master/Slave 로 구성되어 있을 시에 Master 에 쓰고, Slave에서 읽습니다.
* @author sunghyouk.bae@gmail.com 2014. 7. 29.
*/
//@Ignor... | debop/debop4s | debop4s-rediscala/src/test/scala/debop4s/rediscala/client/MasterSlavesFunSuite.scala | Scala | apache-2.0 | 987 |
import sbt._
import sbt.Keys._
import scala.language.postfixOps
import scala.sys.process._
import E2EConfig._
object Vagrant {
lazy val vagrantFile = settingKey[File]("vagrant-file")
lazy val vagrantContainersLogFile = settingKey[File]("vagrant-containers-log-file")
lazy val vagrant ... | pawelkaczor/ddd-leaven-akka-v2 | project/Vagrant.scala | Scala | mit | 2,742 |
package examples
/**
* Created by zhouqihua on 2017/6/28.
*/
import swallow.core._
import akka.cluster.Cluster
import akka.cluster.ClusterEvent._
import akka.actor.ActorLogging
import akka.actor.Actor
object KMClusterListener {
final case class SuperviseFlow(flow: KMFlow)
}
class KMClusterListener extends Ac... | kimihe/Swallow | swallow/src/main/scala/examples/KMClusterListener.scala | Scala | apache-2.0 | 1,484 |
// Copyright (c) 2013-2020 Rob Norris and Contributors
// This software is licensed under the MIT License (MIT).
// For more information see LICENSE or https://opensource.org/licenses/MIT
package doobie.postgres
import fs2.{Chunk, Stream, Pure}
import cats.effect._
import org.scalacheck.{Arbitrary, Gen}
import org.sc... | tpolecat/doobie | modules/postgres/src/test/scala/doobie/postgres/LOStreamingSuite.scala | Scala | mit | 1,354 |
import akka.actor.ActorSystem
import colossus.core._
import colossus.protocols.http._
import colossus.protocols.http.filters.HttpStreamCustomFilters
import colossus.protocols.http.streaming._
import colossus.service._
import colossus.streaming._
object StreamingHttpCompressionExample extends App {
// #streaming_htt... | tumblr/colossus | colossus-docs/src/main/scala/StreamingHttpCompressionExample.scala | Scala | apache-2.0 | 1,714 |
/**
* 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... | ijuma/kafka | core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala | Scala | apache-2.0 | 10,801 |
package code.test
import scala.reflect.runtime.universe
import org.junit.Test
import org.crudible.core.model.ModelWithText
import org.crudible.core.util.DataHelpers
import com.github.rehei.scala.macros.Reflection
import code.model.repository.CategoryRepository
import javax.persistence.Entity
import sext._
class Fo... | rehei/crudible | crudible-lift-example/src/test/scala/code/test/FormTest.scala | Scala | apache-2.0 | 1,492 |
/*
* Copyright 2014 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | gorzell/archaius | archaius-scala/src/test/scala/com/netflix/config/scala/ChainedFloatPropertyTest.scala | Scala | apache-2.0 | 1,297 |
/**
* Created by IntelliJ IDEA.
* User: Admin
* Date: 10.04.11
* Time: 16:53
* To change this template use File | Settings | File Templates.
*/
object TravelItinerary {
var travelers: List[TravellerInformation] = List[TravellerInformation]()
var flights: List[FlightInformation] = List[FlightInforma... | x1mroepke/FilekeysOTA | src/TravelItinerary.scala | Scala | gpl-3.0 | 647 |
/**
* Copyright 2015 Thomson Reuters
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | nruppin/CM-Well | server/cmwell-util/src/main/scala/cmwell/util/files/package.scala | Scala | apache-2.0 | 9,925 |
package me.laiseca.restcale.methodcall
import me.laiseca.restcale.RestcaleException
class IllegalParameterTypeException(typeName:String, cause:Throwable)
extends RestcaleException(String.format("Cannot transform the parameter with value %s", typeName), cause, 500) {
def this(typeName:String) = this(typeName, null... | xabierlaiseca/restcale | core/src/main/scala/me/laiseca/restcale/methodcall/IllegalParameterTypeException.scala | Scala | apache-2.0 | 323 |
package io.github.oxlade39.storrent.peer
import akka.actor._
import akka.event.LoggingReceive
import concurrent.duration._
import scala.util.Random
import scala.concurrent.Future
import akka.util.Timeout
import io.github.oxlade39.storrent.config.Settings
import io.github.oxlade39.storrent.core.Torrent
import io.githu... | oxlade39/STorrent | src/main/scala/io/github/oxlade39/storrent/peer/Downloader.scala | Scala | apache-2.0 | 7,453 |
def greet1(greeting: String) {
println("in greet")
println(greeting + "!")
}
| grzegorzbalcerek/scala-book-examples | examples/ByNameParameters1.scala | Scala | mit | 81 |
package com.socrata.datacoordinator.util
import java.io.{Reader, Writer, IOException}
import java.util.concurrent.locks.ReentrantLock
private[util] class RWSharedState(val bufferSize: Int, val blockCount: Int) {
import RWSharedState._
if(bufferSize < 1) throw new IllegalArgumentException("bufferSize must be at l... | socrata-platform/data-coordinator | coordinatorlib/src/main/scala/com/socrata/datacoordinator/util/ReaderWriterPair.scala | Scala | apache-2.0 | 5,812 |
package old.hiddenpics
/** The class `Picture` represents an image that is used in the Hidden Pics application.
* An image consists of pixels, represented here by `Pixel` objects. The pixels are
* organized in rows and columns.
*
* A `Picture` object is mutable: any of its pixels can be changed to another. Th... | Ronin748/Herbert_Prelude | src/old/hiddenpics/Picture.scala | Scala | gpl-2.0 | 2,190 |
/*
* Copyright 2019 Spotify AB.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | spotify/scio | scio-avro/src/main/scala/com/spotify/scio/avro/taps.scala | Scala | apache-2.0 | 4,445 |
/*
* Copyright 2015 Commonwealth Computer Research, 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 applicabl... | jnh5y/geomesa | geomesa-filter/src/test/scala/org/locationtech/geomesa/filter/function/BinaryOutputEncoderTest.scala | Scala | apache-2.0 | 7,586 |
/*******************************************************************************
* Copyright (c) 2013 Guillaume DUBUISSON DUPLESSIS <guillaume.dubuisson_duplessis@insa-rouen.fr>.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* ... | GuillaumeDD/scala99problems | src/main/scala/list/P22/sol01.scala | Scala | gpl-3.0 | 864 |
/*
* 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 ... | bwsw/sj-platform | core/sj-mesos-framework/src/main/scala/com/bwsw/sj/mesos/framework/task/StatusHandler.scala | Scala | apache-2.0 | 2,132 |
package org.http4s
package client
package blaze
import cats.effect._
/** Create HTTP1 clients which will disconnect on completion of one request */
object SimpleHttp1Client {
/** create a new simple client
*
* @param config blaze configuration object
*/
@deprecated("Use Http1Client instead", "0.18.0-... | reactormonk/http4s | blaze-client/src/main/scala/org/http4s/client/blaze/SimpleHttp1Client.scala | Scala | apache-2.0 | 605 |
package org.decaf.distributed.common
import akka.actor.ActorRef
case class HealthPing(
listener: ActorRef
) extends WireMessage
case class HealthPong(
isHealthy: Boolean,
message: Option[String] = None
) extends WireMessage
| adamdecaf/distributed | common/src/main/scala/health.scala | Scala | apache-2.0 | 232 |
package io.cumulus.services
import io.cumulus.Logging
import io.cumulus.models.event.Event
import io.cumulus.models.user.User
import io.cumulus.persistence.query.{QueryE, QueryPagination, QueryRunner}
import io.cumulus.persistence.query.QueryRunner._
import io.cumulus.persistence.stores.EventStore
import io.cumulus.pe... | Cumulus-Cloud/cumulus | server/cumulus-core/src/main/scala/io/cumulus/services/EventService.scala | Scala | mit | 986 |
package com.julianpeeters.avro.annotations
import record._
import ctorgen._
import namespacegen._
import methodgen._
import schemagen._
import scala.reflect.macros.blackbox.Context
import scala.language.experimental.macros
import scala.annotation.{ compileTimeOnly, StaticAnnotation }
import org.apache.avro.Schema
im... | julianpeeters/avro-scala-macro-annotations | macros/src/main/scala/avro/scala/macro/annotations/AvroRecordMacro.scala | Scala | apache-2.0 | 6,192 |
/*
* 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 ... | wangyixiaohuihui/spark2-annotation | external/kafka-0-10-sql/src/main/scala/org/apache/spark/sql/kafka010/KafkaWriter.scala | Scala | apache-2.0 | 3,904 |
package src;
class EnPassantMove(start : Int, end : Int, val captureField : Integer,
castlingRightsAfterMove : Int) extends Move(Move.ENPASSANT_MOVE,
start, end, 0, castlingRightsAfterMove)
{
var capturedPiece : Piece = null
var capturedPieceID : Int = -1
var previousLastUndoableMove = 0
override def app... | mszacun/Scala-Chess | src/EnPassantMove.scala | Scala | gpl-2.0 | 1,405 |
package org.jetbrains.plugins.scala.debugger.friendlyCollections
import org.jetbrains.plugins.scala.debugger.ui.ListLikeCollectionNodeRenderer
import com.intellij.debugger.ui.tree.render.{ChildrenBuilder, DescriptorLabelListener}
import com.intellij.debugger.ui.impl.FrameVariablesTree
import com.intellij.debugger.ui.i... | consulo/consulo-scala | test/org/jetbrains/plugins/scala/debugger/friendlyCollections/ScalaFriendlyCollectionDisplayingTest.scala | Scala | apache-2.0 | 5,572 |
package chandu0101.scalajs.react.components.demo.components.reactdraggable
import chandu0101.scalajs.react.components.demo.components.CodeExample
import chandu0101.scalajs.react.components.draggables.ReactDraggable
import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.prefix_<^._
/**
* Created by chan... | coreyauger/scalajs-react-components | demo/src/main/scala/chandu0101/scalajs/react/components/demo/components/reactdraggable/ReactDraggableDemo.scala | Scala | apache-2.0 | 801 |
package com.basrikahveci
package cardgame.messaging.request
import cardgame.messaging.Request
import cardgame.core.{Lobby, Session}
import cardgame.domain.User
class JoinGameRequest(val gameId: Long) extends Request with Lobby {
def handle(session: Session, user: User) = joinGame(user, gameId)
}
| metanet/cardgame-server-scala | src/main/scala/com/basrikahveci/cardgame/messaging/request/JoinGameRequest.scala | Scala | mit | 303 |
package com.arcusys.valamis.lesson.service.export
import java.io.File
import com.arcusys.valamis.export.ImportProcessor
import com.arcusys.valamis.file.service.FileService
import com.arcusys.valamis.lesson.service.{ PackageUploadManager, ValamisPackageService }
import com.arcusys.valamis.lesson.storage.LessonLimitSto... | ViLPy/Valamis | valamis-lesson/src/main/scala/com/arcusys/valamis/lesson/service/export/PackageImportProcessor.scala | Scala | lgpl-3.0 | 1,900 |
/*
* 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 ... | cloudera/spark | core/src/main/scala/org/apache/spark/rdd/PartitionwiseSampledRDD.scala | Scala | apache-2.0 | 2,512 |
/*
* Copyright (c) 2016 Webtrends (http://www.webtrends.com)
* See the LICENCE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.... | mjwallin1/wookiee | wookiee-core/src/test/scala/com/webtrends/harness/libs/iteratee/CharEncodingSpec.scala | Scala | apache-2.0 | 9,465 |
package org.sameersingh.mf
import StrictMath._
/**
* @author sameer
* @since 5/8/14.
*/
object Util {
def sigmoid(score: Double) = {
if (score <= 0.0) {
val escore = exp(score)
escore / (escore + 1.0)
} else {
val escore = exp(-score)
1.0 / (escore + 1.0)
}
}
}
| sameersingh/mf | src/main/scala/org/sameersingh/mf/Util.scala | Scala | apache-2.0 | 309 |
object test_while1 {
def main(args: Array[String]) {
// Put code here
}
}
| LoyolaChicagoBooks/introcs-scala-examples | test_while1/test_while1.scala | Scala | gpl-3.0 | 82 |
package blended.streams.message
import blended.streams.FlowHeaderConfig
import blended.streams.message.FlowMessage.FlowMessageProps
import blended.util.logging.LogLevel.LogLevel
import blended.util.logging.Logger
object FlowEnvelopeLogger {
def mdcPrefix : FlowHeaderConfig => String = headerCfg => headerCfg.prefix... | woq-blended/blended | blended.streams/src/main/scala/blended/streams/message/FlowEnvelopeLogger.scala | Scala | apache-2.0 | 1,570 |
class Test {
val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror
def error: Unit = {
new cm.universe.Traverser // java.lang.VerifyError: (class: Test, method: error signature: ()V) Incompatible object argument for function call
}
def okay1: Unit = {
val cm: reflect.runtime.univers... | folone/dotty | tests/pending/run/t6677.scala | Scala | bsd-3-clause | 702 |
package fpinscala.datastructures
sealed trait Tree[+A]
case class Leaf[A](value: A) extends Tree[A]
case class Branch[A](left: Tree[A], right: Tree[A]) extends Tree[A]
object Tree {
// Exercise 25: Write a function size that counts the number of nodes
def size[A](t: Tree[A]): Int = t match {
case Leaf(_) => 1... | goboss/fpinscala | exercises/src/main/scala/fpinscala/datastructures/Tree.scala | Scala | mit | 1,687 |
/***********************************************************************
* Copyright (c) 2013-2020 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... | aheyne/geomesa | geomesa-accumulo/geomesa-accumulo-tools/src/main/scala/org/locationtech/geomesa/accumulo/tools/export/AccumuloPlaybackCommand.scala | Scala | apache-2.0 | 1,348 |
package com.alugarei.cielo.domain
/**
* Created by Gustavo on 04/02/2016.
*/
sealed trait Idioma {
def codigo: String
}
case object PT extends Idioma {val codigo = "PT"}
case object ES extends Idioma {val codigo = "ES"}
case object EN extends Idioma {val codigo = "EN"}
object Idioma {
def from(codigo: String) ... | alugarei/cielo-scala | src/main/scala/com/alugarei/cielo/domain/Idioma.scala | Scala | mit | 418 |
package net.bhardy.braintree.scala
import net.bhardy.braintree.scala.gw.BraintreeGateway
import net.bhardy.braintree.scala.util.EnumUtils
import net.bhardy.braintree.scala.util.NodeWrapper
class Transaction(node: NodeWrapper) {
val amount = node.findBigDecimal("amount")
val avsErrorResponseCode = node.findString(... | benhardy/braintree-scala | src/main/scala/Transaction.scala | Scala | mit | 4,027 |
package io.iohk.ethereum.faucet.jsonrpc
import akka.actor.{ActorRef, ActorSystem}
import akka.pattern.RetrySupport
import akka.util.Timeout
import io.iohk.ethereum.faucet.{FaucetConfigBuilder, FaucetHandler, FaucetSupervisor}
import monix.eval.Task
trait FaucetHandlerSelector {
self: FaucetConfigBuilder with RetryS... | input-output-hk/etc-client | src/main/scala/io/iohk/ethereum/faucet/jsonrpc/FaucetHandlerSelector.scala | Scala | mit | 867 |
/*
* Copyright 2009-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... | sortable/framework | core/json/src/main/scala/net/liftweb/json/Meta.scala | Scala | apache-2.0 | 16,756 |
package lila.setup
import akka.actor.ActorSelection
import akka.pattern.ask
import chess.{ Game => ChessGame, Board, Color => ChessColor }
import play.api.libs.json.{ Json, JsObject }
import lila.db.dsl._
import lila.game.{ Game, GameRepo, Pov, Progress, PerfPicker }
import lila.i18n.I18nDomain
import lila.lobby.acto... | clarkerubber/lila | modules/setup/src/main/Processor.scala | Scala | agpl-3.0 | 2,652 |
/*
* Copyright (c) 2014 Paul Bernard
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | quantintel/spectrum | financial/src/main/scala/org/quantintel/ql/instruments/Instrument.scala | Scala | apache-2.0 | 2,992 |
/*
* 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 ... | yanboliang/spark | sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala | Scala | apache-2.0 | 22,424 |
/**
* Copyright (C) 2010 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... | evlist/orbeon-forms | src/main/scala/org/orbeon/oxf/xforms/processor/handlers/xhtml/XFormsLHHAHandler.scala | Scala | lgpl-2.1 | 6,391 |
package de.frosner.broccoli.controllers
import cats.data.OptionT
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.api.services.IdentityService
import com.mohiva.play.silhouette.api.util.Credentials
import com.mohiva.play.silhouette.impl.providers.CredentialsProvider
import de.frosner.b... | FRosner/cluster-broccoli | server/src/test/scala/de/frosner/broccoli/controllers/ServiceMocks.scala | Scala | apache-2.0 | 3,364 |
package de.fosd.typechef.xtclexer
import de.fosd.typechef.conditional.{Choice, Conditional, ConditionalLib, One}
import de.fosd.typechef.featureexpr.{FeatureExpr, FeatureExprFactory}
import scala.util.parsing.combinator.RegexParsers
/**
* Xtc does not resolve expressions, but creates a new string. Here we resolve t... | ckaestne/TypeChef | PartialPreprocessor/src/main/scala/de/fosd/typechef/xtclexer/XtcFExprAnalyzer.scala | Scala | lgpl-3.0 | 3,243 |
/*
* 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://... | virtualirfan/monifu | monifu/shared/src/test/scala/monifu/reactive/internals/collection/DropHeadOnOverflowQueueSuite.scala | Scala | apache-2.0 | 4,335 |
package example
import scala.quoted._
object MyClassMaker {
inline def make: MyClass = ${ makeImpl }
def makeImpl(using qctx: QuoteContext): Expr[MyClass] = {
'{
new MyClass { } /* eventually I want to add properties inside */
}
}
} | som-snytt/dotty | tests/run-macros/i8115/Macro_2.scala | Scala | apache-2.0 | 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 may ... | manishgupta88/carbondata | integration/spark-common/src/main/scala/org/apache/spark/rdd/CarbonMergeFilesRDD.scala | Scala | apache-2.0 | 5,897 |
package org.scaladebugger.api.lowlevel.wrappers
import scala.language.implicitConversions
import com.sun.jdi._
/**
* Contains helper implicits to convert to wrapper classes.
*/
object Implicits {
implicit def valueToWrapper(value: Value): ValueWrapper =
new ValueWrapper(value)
implicit def stackFrameToWra... | chipsenkbeil/scala-debugger | scala-debugger-api/src/main/scala/org/scaladebugger/api/lowlevel/wrappers/Implicits.scala | Scala | apache-2.0 | 851 |
/*
* 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 ... | brad-kaiser/spark | external/kinesis-asl/src/test/scala/org/apache/spark/streaming/kinesis/KinesisInputDStreamBuilderSuite.scala | Scala | apache-2.0 | 7,262 |
/*
* 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 ... | minixalpha/spark | mllib/src/test/scala/org/apache/spark/mllib/tree/RandomForestSuite.scala | Scala | apache-2.0 | 6,625 |
import annotation.varargs
class VaClass {
@varargs def vs(a: Int, b: String*) = println(a + b.length)
@varargs def vi(a: Int, b: Int*) = println(a + b.sum)
@varargs def vt[T](a: Int, b: T*) = println(a + b.length)
@varargs def vt1[T](a: Int, b: T*): T = b.head
}
object VaClass {
// scala/bug#11057
@varargs... | scala/scala | test/files/jvm/varargs/VaClass.scala | Scala | apache-2.0 | 349 |
/*
* 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 ... | manuzhang/incubator-gearpump | examples/streaming/state/src/test/scala/org/apache/gearpump/streaming/examples/state/processor/CountProcessorSpec.scala | Scala | apache-2.0 | 2,921 |
package slaq.util
import scala.collection.mutable.ArrayBuffer
import slaq.session.PositionedParameters
final class SqlBuilder extends SqlBuilder.Segment { self =>
import SqlBuilder._
private val segments = new ArrayBuffer[Segment]
private var currentStringSegment: StringSegment = null
private def ss = {
... | godenji/slaq | src/main/scala/slaq/scalaquery/util/SqlBuilder.scala | Scala | bsd-2-clause | 2,798 |
package org.ninjatasks.api
import org.ninjatasks.spi.{ExecutableJob, NinjaWork, Work, JobCreator}
import org.ninjatasks.utils.ManagementConsts
/**
* API class to create work objects from spi class implementations provided by the user.
* Created by Gilad Ber on 6/4/2014.
*/
case class WorkConfig[JobT, DataT, ResT](... | giladber/ninja-tasks | src/main/scala/org/ninjatasks/api/WorkConfig.scala | Scala | apache-2.0 | 1,341 |
package test.types
import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers._
import tap.ModuleId
import tap.types._
import tap.types.Type._
import tap.types.Natives._
import tap.types.kinds._
import tap.types.inference.Substitutions.nullSubst
import java.lang.IllegalArgumentException
import language... | garyb/tap | src/test/scala/test/types/TypeTests.scala | Scala | mit | 7,535 |
/*
* 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 ... | goldmedal/spark | mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala | Scala | apache-2.0 | 17,001 |
package $package$
import org.specs2.mutable._
class MainTest extends Specification{
"Hello world" should {
"be equal to 'hello world' in lowercase" in {
"Hello World".toLowerCase must beEqualTo("hello world")
}
}
}
| ryanbrozo/scala-sbt-starter.g8 | src/main/g8/src/test/scala/$package$/MainSpec.scala | Scala | mit | 237 |
import sbt._
import sbt.Keys._
object Build extends sbt.Build {
lazy val basicSettings = Seq(
organization := "com.yiguang",
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.11.4",
crossScalaVersions := Seq("2.10.4", "2.11.4")
)
lazy val root = Project("perftool",file("."))
.settings(basicSet... | liyiguang/perftool | project/build.scala | Scala | apache-2.0 | 1,097 |
package com.citypay.pan.search.report
import java.io.PrintStream
import com.typesafe.config.Config
/**
* Created by gary on 22/06/2017.
*/
object ReportRendererFactory {
import com.citypay.pan.search.util.ConfigExt._
def apply(ps: PrintStream, config: Config): ReportRenderer = {
config.string("rendere... | citypay/citypay-pan-search | src/main/scala/com/citypay/pan/search/report/ReportRendererFactory.scala | Scala | mit | 568 |
/**
* This file is part of the Uniscala JSON project.
* Copyright (C) 2012 Sustainable Software Pty Ltd.
* This is open source software, licensed under the Apache License
* version 2.0 license - please see the LICENSE file included in
* the distribution.
*
* Authors:
* Sam Stainsby (sam@sustainablesoftware.com.... | stainsby/uniscala-json | src/main/scala/net/uniscala/json/package.scala | Scala | apache-2.0 | 691 |
package hulk.http.response
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import scala.reflect.io.File
/**
* Created by reweber on 17/02/2016
*/
class MustacheTemplateTest extends Specification with Mockito {
"MustacheTemplate#apply" should {
"create mustache template instance base... | reneweb/hulk | framework/src/test/scala/hulk/http/response/MustacheTemplateTest.scala | Scala | apache-2.0 | 801 |
/*
* Copyright 2013-2016 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... | amuramatsu/Laika | core/src/main/scala/laika/io/OutputProvider.scala | Scala | apache-2.0 | 7,210 |
import sbt._, Keys._
import pl.project13.scala.sbt.SbtJmh._
import com.typesafe.sbt.pgp.PgpKeys._
object RegionsBuild extends Build {
val paradiseVersion = "2.1.0-M5"
lazy val defaults = Defaults.defaultSettings ++ Seq(
version := "0.1-SNAPSHOT",
scalaVersion := "2.11.6",
organization := "sh.den",
... | ignasi35/scala-offheap | project/Build.scala | Scala | bsd-3-clause | 5,829 |
package vanadis.modules.examples.scalacalc.calcservices
trait Multiplier {
def mul(args: Array[Int]) : Int
} | kjetilv/vanadis | modules/examples/scalacalc/calcservices/src/main/scala/vanadis/modules/examples/scalacalc/calcservices/Multiplier.scala | Scala | apache-2.0 | 112 |
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.