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 |
|---|---|---|---|---|---|
// ticket #3496
object Test {
def main(args: Array[String]): Unit = {
val s = Stream.from(1)
s.take(5)
s.drop(5)
s.splitAt(5)
}
}
| yusuke2255/dotty | tests/run/t3496.scala | Scala | bsd-3-clause | 156 |
package org.jetbrains.plugins.scala.annotator
import org.jetbrains.plugins.scala.DependencyManagerBase._
import org.jetbrains.plugins.scala.base.libraryLoaders.{IvyManagedLoader, LibraryLoader}
import org.jetbrains.plugins.scala.debugger.{ScalaVersion, Scala_2_12}
/**
* Nikolay.Tropin
* 23-May-18
*/
class AkkaH... | jastice/intellij-scala | scala/scala-impl/test/org/jetbrains/plugins/scala/annotator/AkkaHttpHighlightingTest.scala | Scala | apache-2.0 | 1,631 |
/***********************************************************************
* Copyright (c) 2013-2018 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... | jahhulbert-ccri/geomesa | geomesa-utils/src/test/scala/org/locationtech/geomesa/utils/geotools/SftBuilderTest.scala | Scala | apache-2.0 | 7,276 |
package ee.cone.c4actor.hashsearch.index.dynamic
import java.time.Instant
import ee.cone.c4actor.QProtocol.S_Firstborn
import ee.cone.c4actor.Types.SrcId
import ee.cone.c4actor._
import ee.cone.c4actor.dep.request.CurrentTimeProtocol.S_CurrentTimeNode
import ee.cone.c4actor.dep.request.{CurrentTimeConfig, CurrentTime... | wregs/c4proto | c4actor-extra/src/main/scala/ee/cone/c4actor/hashsearch/index/dynamic/IndexNodeThanos.scala | Scala | apache-2.0 | 22,097 |
/*
* 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 | core/src/test/scala/org/apache/spark/storage/DiskStoreSuite.scala | Scala | apache-2.0 | 7,148 |
package ch.ninecode.model
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.Serializer
import com.esotericsoftware.kryo.io.Input
import com.esotericsoftware.kryo.io.Output
import org.apache.spark.sql.Row
import ch.ninecode.cim.CIMClassInfo
import ch.ninecode.cim.CIMContext
import ch.ninecode.cim.... | derrickoswald/CIMScala | CIMReader/src/main/scala/ch/ninecode/model/EnvDomain.scala | Scala | mit | 4,324 |
/*
* Copyright 2015 eleflow.com.br.
*
* 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 writin... | eleflow/sparknotebook | src/main/scala/eleflow/sparknotebook/enums/PeriodOfDay.scala | Scala | apache-2.0 | 777 |
package com.optrak.testakka.modelutils
import ModelActor.{GreetingResponse, Hello, OnlyMessagesBeginningWithHExcpetion}
import akka.Done
import akka.actor.Actor
import com.optrak.testakka.api.{GreetingMessage, PersistentService}
import scala.concurrent.Future
object ModelActor {
class OnlyMessagesBeginningWithHEx... | Optrak/lagom-testbed | test-akka-integration/akka-model/utils/src/main/scala/com/optrak/testakka/modelutils/ModelActor.scala | Scala | apache-2.0 | 1,877 |
/*
* This file is part of the ToolXiT 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 t... | ISCPIF/PSEExperiments | openmole-src/openmole/third-parties/toolxit.bibtex/core/src/main/scala/toolxit/bibtex/bst/BuiltIn.scala | Scala | agpl-3.0 | 8,367 |
package mouse
import cats.~>
trait AnyFSyntax {
implicit final def anyfSyntaxMouse[F[_], A](fa: F[A]): AnyFOps[F, A] = new AnyFOps(fa)
}
final class AnyFOps[F[_], A](private val fa: F[A]) extends AnyVal {
@inline def ||>[G[_]](f: F ~> G): G[A] = f(fa)
@inline def thrushK[G[_]](f: F ~> G): G[A] = f(fa)
}
| benhutchison/mouse | shared/src/main/scala/mouse/anyf.scala | Scala | mit | 313 |
package com.atomist.param
import com.fasterxml.jackson.annotation.{JsonCreator, JsonProperty, JsonSetter}
import scala.collection.mutable.ListBuffer
class Parameter @JsonCreator()(@JsonProperty("name") val name: String) {
@JsonProperty
var description: String = ""
/**
* Default value for this parameter. ... | atomist/rug | src/main/scala/com/atomist/param/Parameter.scala | Scala | gpl-3.0 | 5,523 |
/*
* Copyright 2001-2008 Artima, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | svn2github/scalatest | src/test/scala/org/scalatest/matchers/ShouldPlusOrMinusSpec.scala | Scala | apache-2.0 | 83,772 |
/*
* The MIT License (MIT)
*
* Copyright (c) 2017 Ángel Cervera Claudio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
... | angelcervera/pbf4scala | examples/primitivesextraction/src/test/scala/com/acervera/osm4scala/examples/primitivesextraction/PrimitivesExtractionSuite.scala | Scala | mit | 3,890 |
package com.twitter.finatra.multiserver.test
import com.twitter.finagle.http.{Request, Status}
import com.twitter.finatra.http.{EmbeddedHttpServer, HttpMockResponses}
import com.twitter.finatra.httpclient.HttpClient
import com.twitter.finatra.multiserver.Add2HttpServer.Add2Server
import com.twitter.inject.Mockito
impo... | syamantm/finatra | inject-thrift-client-http-mapper/src/test/scala/com/twitter/finatra/multiserver/test/Add2ServerFeatureTest.scala | Scala | apache-2.0 | 845 |
package com.twitter.finagle.context
import com.twitter.io.{Buf, BufByteWriter, ByteReader}
import com.twitter.util.{Return, Throw, Try}
/**
* Retries contains the number of times a request has been retried.
*
* @param retries the number of retries
*/
private[finagle] case class Retries(val retries: Int)
private[... | koshelev/finagle | finagle-core/src/main/scala/com/twitter/finagle/context/Retries.scala | Scala | apache-2.0 | 950 |
package sbt
package compiler
import scala.reflect.Manifest
import scala.tools.nsc.{ast, interpreter, io, reporters, util, CompilerCommand, Global, Phase, Settings}
import interpreter.AbstractFileClassLoader
import io.{AbstractFile, PlainFile, VirtualDirectory}
import ast.parser.Tokens
import reporters.{ConsoleReporter... | kuochaoyi/xsbt | compile/Eval.scala | Scala | bsd-3-clause | 9,308 |
// Copyright (c) 2018 Ben Zimmer. All rights reserved.
// Generate EPUB files.
// Based on examples from: https://en.wikipedia.org/wiki/EPUB
package bdzimmer.secondary.export.controller
import scala.collection.immutable.Seq
import java.io.{BufferedOutputStream, File, FileOutputStream}
import java.util.zip.{CRC32, Z... | bdzimmer/secondary | src/main/scala/bdzimmer/secondary/export/controller/Epub.scala | Scala | bsd-3-clause | 11,070 |
package com.rikmuld.camping.features.blocks.lantern
import com.rikmuld.camping.CampingMod
import com.rikmuld.camping.Definitions.Lantern
import com.rikmuld.camping.Definitions.Lantern._
import com.rikmuld.corerm.tileentity.TileEntitySimple
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.ItemS... | Rikmuld/MC-Camping | scala/com/rikmuld/camping/features/blocks/lantern/TileEntityLantern.scala | Scala | gpl-3.0 | 2,034 |
package com.twitter.finagle.memcached.integration
import com.twitter.conversions.time._
import com.twitter.finagle._
import com.twitter.finagle.memcached.Client
import com.twitter.finagle.memcached.protocol.{Command, Response}
import com.twitter.io.Buf
import com.twitter.util.{Await, Awaitable}
import java.net.{InetAd... | koshelev/finagle | finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/ProxyTest.scala | Scala | apache-2.0 | 4,388 |
package Sample
/**
* Created by foostan on 8/19/14.
*/
trait SuperCar extends Car{
}
| foostan/2puml | sample/SuperCar.scala | Scala | mit | 89 |
/*
* Copyright (C) 2005, The OpenURP Software.
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This... | openurp/api | base/src/main/scala/org/openurp/base/edu/model/TimeSetting.scala | Scala | lgpl-3.0 | 1,648 |
package controllers
import play.api.libs.json._
import play.api.mvc._
import models.Book._
import java.math.BigDecimal
import java.util.Date
import com.amazonaws.regions.Region
import com.amazonaws.regions.Regions
import com.amazonaws.services.cloudwatch.AmazonCloudWatchClient
import com.amazonaws.services.cloudwatch... | strongfellow/simple-rest-scala-txgraphs | app/controllers/Application.scala | Scala | mit | 2,779 |
// scalac: -Yrangepos:false -language:dynamics
//
object Test extends App {
object stubUpdate {
def update(as: Any*) = println(".update"+as.toList.mkString("(",", ", ")"))
}
object stub {
def apply = {println(".apply"); stubUpdate}
def apply(as: Any*) = println(".apply"+as.toList.mkString("(",", ", "... | martijnhoekstra/scala | test/files/run/applydynamic_sip.scala | Scala | apache-2.0 | 2,494 |
/*
* 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 ... | PredictionIO/PredictionIO | examples/scala-parallel-recommendation/blacklist-items/src/main/scala/ALSAlgorithm.scala | Scala | apache-2.0 | 6,131 |
/*
* 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 org... | scala-js/scala-js | compiler/src/test/scala/org/scalajs/nscplugin/test/JSInteropTest.scala | Scala | apache-2.0 | 131,720 |
import scalariform.formatter.preferences._
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
object Scalariform {
lazy val settings = {
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(AlignParameters, true)
.setPreference(Dou... | xheres/api-gbfraidfinder | project/Scalariform.scala | Scala | mit | 487 |
/*
* 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 ... | michalsenkyr/spark | core/src/main/scala/org/apache/spark/Heartbeater.scala | Scala | apache-2.0 | 2,685 |
package akka.osgi.ds.impl
import java.util.Properties
import java.util.concurrent.CyclicBarrier
import scala.collection.JavaConversions.asScalaSet
import scala.language.implicitConversions
import org.osgi.framework.Bundle
import org.osgi.framework.BundleContext
import org.osgi.framework.ServiceFactory
import org.osg... | rkrzewski/spray-osgi | com.typesafe.akka.osgi.ds/src/akka/osgi/ds/impl/ActorSystemComponent.scala | Scala | apache-2.0 | 3,599 |
package net.xylophones.planetoid.game.model
import net.xylophones.planetoid.game.maths.Vector2D
trait Circular {
def radius: Int
def position: Vector2D
}
| wjsrobertson/planetoid | game/src/main/scala/net/xylophones/planetoid/game/model/Circular.scala | Scala | apache-2.0 | 163 |
package org.concurrency.ch6
import rx.lang.scala.Observable
import scala.concurrent.duration._
object ObservableTimerApp extends App {
def observableTimer(): Observable[Long] = {
Observable(
subscriptor => {
Observable.interval(5.seconds).filter(n => (n * 5) % 30 != 0).subscribe {
n => s... | marcos-sb/concurrent-programming-scala | src/main/scala-2.11/org/concurrency/ch6/ObservableTimerApp.scala | Scala | apache-2.0 | 569 |
package scoverage.report
import java.io.File
import scala.xml.Node
import scala.xml.PrettyPrinter
import scoverage.DoubleFormat.twoFractionDigits
import scoverage._
/** @author Stephen Samuel */
class CoberturaXmlWriter(sourceDirectories: Seq[File], outputDir: File)
extends BaseReportWriter(sourceDirectories, o... | scoverage/scalac-scoverage-plugin | scalac-scoverage-plugin/src/main/scala/scoverage/report/CoberturaXmlWriter.scala | Scala | apache-2.0 | 3,083 |
package io.resourcepool.computerdatabase.gatling.process
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import com.typesafe.config.ConfigFactory
/**
* Created by Cédric Cousseran on 29/03/16.
* Browse a random number of pages with random parameters.
*/
object Browse {
val config = ConfigFact... | serrearthur/training-java | training-java/gatling-test/src/test/scala/io/resourcepool/computerdatabase/gatling/process/Browse.scala | Scala | apache-2.0 | 1,355 |
package io.surfkit.driver
import io.surfkit.am.IntTypeMapping
import io.surfkit.data.Data
import scala.Predef._
/**
*
* Created by Corey Auger
*/
object OpenToMetrics extends App with SparkSetup{
override def main(args: Array[String]) {
import sqlContext.implicits._
val p = new java.io.PrintWriter("... | coreyauger/ashley-madison-spark | src/main/scala/io/surfkit/driver/OpenToMetrics.scala | Scala | mit | 5,554 |
import scala.collection._
import scala.language.postfixOps
object Test extends App {
val printTime = false
def sum[A](xs: Iterable[Int]) = xs.foldLeft(0)((x, y) => x + y)
def time(op: => Unit): Unit = {
val start = System.currentTimeMillis()
op
if (printTime) println(" time = "+(System.currentTim... | scala/scala | test/files/run/collections.scala | Scala | apache-2.0 | 3,332 |
package com.arcusys.valamis.lesson.scorm.model.manifest
/**
* A rule executed each time after an attempt on a descendant activity terminates to see if this activity needs to exit
* @param conditions Set of conditions that define whether the rule will be applied or not
*/
class ExitConditionRule(conditions: RuleCon... | igor-borisov/valamis | valamis-scorm-lesson/src/main/scala/com/arcusys/valamis/lesson/scorm/model/manifest/ExitConditionRule.scala | Scala | gpl-3.0 | 364 |
/*
* Copyright 2014-16 Intelix Pty Ltd
*
* 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... | intelix/reactiveservices | tools/config/src/main/scala/au/com/intelix/config/RootConfig.scala | Scala | apache-2.0 | 738 |
package com.mehmetakiftutuncu.eshotroidplus.models
import com.github.mehmetakiftutuncu.errors.{CommonError, Errors}
import com.mehmetakiftutuncu.eshotroidplus.models.base.{Jsonable, ModelBase}
import com.mehmetakiftutuncu.eshotroidplus.utilities.Log
import play.api.libs.json.{JsObject, JsValue, Json}
case class Locat... | mehmetakiftutuncu/EshotroidPlusServer | app/com/mehmetakiftutuncu/eshotroidplus/models/Location.scala | Scala | gpl-3.0 | 2,144 |
package net.selenate.server
package actions
import net.selenate.common.comms.{ SeElementSelectMethod, SeElementSelector, SeOptionSelectMethod, SeOptionSelector }
import org.openqa.selenium.{ By, StaleElementReferenceException }
import org.openqa.selenium.remote.RemoteWebElement
import org.openqa.selenium.support.ui.Se... | tferega/selenate | code/Server/src/main/scala/net/selenate/server/actions/ActionCommons.scala | Scala | bsd-3-clause | 3,520 |
package com.github.skozlov.ai
import java.io.File
import com.github.skozlov.ai.World.Temperature
import com.github.skozlov.commons.scala.collections.{MatrixBuilder, Matrix}
import com.github.skozlov.commons.scala.collections.Matrix.Coordinates
import com.github.skozlov.commons.scala.random.Random
import com.github.sk... | skozlov/ai | src/main/scala/com/github/skozlov/ai/Model.scala | Scala | apache-2.0 | 3,036 |
/*
* Copyright 2014-2022 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 agr... | Netflix/atlas | atlas-core/src/test/scala/com/netflix/atlas/core/validation/NameValueLengthRuleSuite.scala | Scala | apache-2.0 | 2,088 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | sahilTakiar/spark | sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala | Scala | apache-2.0 | 20,620 |
package org.jetbrains.plugins.scala.lang.typeInference
import org.jetbrains.plugins.scala.base.ScalaLightCodeInsightFixtureTestAdapter
/**
* @author Roman.Shein
* @since 01.04.2016.
*/
class CurriedTypeInferenceTest extends ScalaLightCodeInsightFixtureTestAdapter {
def testSCL7332() = checkTextHasNoErrors(
... | loskutov/intellij-scala | test/org/jetbrains/plugins/scala/lang/typeInference/CurriedTypeInferenceTest.scala | Scala | apache-2.0 | 526 |
package mage
import com.typesafe.scalalogging.LazyLogging
/**
* Models the roll of a die using rollToHit() or rollDamage() and returns an algebraic type denoting the outcome
* of the attempt. Each result includes a value (for accumulating results), as well as the actual 'Die' rolled.
*/
sealed trait DieResult e... | locke8/weaponmark | src/main/scala/mage/DieResult.scala | Scala | mit | 3,865 |
package org.openmole.site
/**
* Created by mathieu on 11/05/17.
*/
package object shared {
lazy val sitexMain = "sitex-main"
lazy val sitexDoc = "sitex-doc"
lazy val sitexIntro = "sitex-intro"
lazy val sitexIntroMore = "sitex-intro-more"
lazy val sitexDocDetails = "sitex-doc-details"
}
| openmole/openmole-site | site/shared/src/main/scala/org/openmole/site/package.scala | Scala | agpl-3.0 | 306 |
package com.sfxcode.nosql.mongo.relation
object RelationCache extends RelationCaching {
var relationCaching: RelationCaching = new DefaultRelationCache
override def addCachedValue(key: String, value: AnyRef): Unit =
relationCaching.addCachedValue(key, value)
override def getCachedValue[B <: AnyRef](key: St... | sfxcode/simple-mongo | src/main/scala/com/sfxcode/nosql/mongo/relation/RelationCache.scala | Scala | apache-2.0 | 569 |
/**
* This file is part of the TA Buddy project.
* Copyright (c) 2013-2014 Alexey Aksenov ezh@ezh.msk.ru
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Global License version 3
* as published by the Free Software Foundation with the addition... | digimead/digi-TABuddy-desktop | part-view-modification/src/main/scala/org/digimead/tabuddy/desktop/view/modification/ui/dialog/filtered/ColumnTypeFrom.scala | Scala | agpl-3.0 | 3,885 |
package com.peim.utils
import com.typesafe.config.ConfigFactory
trait Config {
private val config = ConfigFactory.load()
val httpHost: String = config.getString("http.host")
val httpPort: Int = config.getInt("http.port")
}
| peim/money-transfer-service | src/main/scala/com/peim/utils/Config.scala | Scala | mit | 232 |
package com.typesafe.slick.testkit.util
import com.typesafe.config.Config
import java.io._
import java.net.{URL, URLClassLoader}
import java.sql.{Connection, Driver}
import java.util.Properties
import java.util.concurrent.ExecutionException
import java.util.zip.GZIPInputStream
import scala.collection.mutable
impor... | slick/slick | slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/TestDB.scala | Scala | bsd-2-clause | 10,230 |
package scala.pickling.non.primitive.field
import org.scalatest.FunSuite
import scala.pickling._, scala.pickling.Defaults._, json._
// Note: Previously picklign would not consider `final` when eliding types. Now we always do.
final case class Person(name: String, age: Int)
case class Philipp(mother: Person)
class N... | scala/pickling | core/src/test/scala/scala/pickling/generation/NonPrimitiveFieldTest.scala | Scala | bsd-3-clause | 734 |
/*
* product-collections is distributed under the 2-Clause BSD license. See the
* LICENSE file in the root of the repository.
*
* Copyright (c) 2013 - 2014 Mark Lister
*/
package com.github.marklister.collections
/**
* ==Immutable product-collection datastructures==
*
* At the moment the only structure availa... | marklister/product-collections | shared/src/main/scala/collections/immutable/package.scala | Scala | bsd-2-clause | 1,062 |
/*
* (c) Copyright 2016 Hewlett Packard Enterprise Development LP
*
* 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 b... | hpe-cct/cct-core | src/main/scala/cogx/compiler/codegenerator/opencl/hyperkernels/fastfouriertransform/ClFFTKernelDir.scala | Scala | apache-2.0 | 1,014 |
package org.bfn.ninetynineprobs
object P86 {
// TODO
}
| bfontaine/99Scala | src/main/scala/P86.scala | Scala | mit | 60 |
/* Copyright (C) 2008-2014 University of Massachusetts Amherst.
This file is part of "FACTORIE" (Factor graphs, Imperative, Extensible)
http://factorie.cs.umass.edu, http://github.com/factorie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with... | patverga/factorie | src/main/scala/cc/factorie/util/Attr.scala | Scala | apache-2.0 | 8,628 |
package com.plasmaconduit.json
import com.plasmaconduit.validation.Validation
import scala.language.implicitConversions
import scala.util.Try
sealed trait JsValue {
def as[A](implicit reader: JsReader[A]): Validation[reader.JsReaderFailure, A] = {
reader.read(this)
}
}
object JsValue {
implicit def fro... | plasmaconduit/json | src/main/scala/com/plasmaconduit/json/JsValue.scala | Scala | mit | 2,660 |
/*
* 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 ... | paulcastro/openwhisk | common/scala/src/main/scala/whisk/http/BasicHttpService.scala | Scala | apache-2.0 | 5,527 |
package io.github.shogowada.scalajs.reactjs.example
import java.net.ServerSocket
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.handler.ResourceHandler
class TestTargetServer(project: String) {
private var server: Server = _
def start(): Unit = {
val maybeTarget = sys.props.get(s"tar... | shogowada/scalajs-reactjs | example/test/src/it/scala/io/github/shogowada/scalajs/reactjs/example/TestTargetServer.scala | Scala | mit | 2,452 |
package com.rockymadden.stringmetric.filter
import com.rockymadden.stringmetric.StringFilter
/** Ensures ASCII letters do not matter. */
trait AsciiLetterFilter extends StringFilter {
abstract override def filter(charArray: Array[Char]): Array[Char] =
super.filter(charArray.filter(c => !((c >= 65 && c <= 90 ) || (... | cocoxu/multip | src/main/scala/com/rockymadden/stringmetric/filter/AsciiLetterFilter.scala | Scala | gpl-3.0 | 439 |
package controllers
import play.api.mvc._
import play.api.data._
import play.api.data.Forms._
import play.api.routing._
import models._
import views._
class Application extends Controller {
// -- Authentication
val loginForm = Form(
tuple(
"email" -> text,
"password" -> text
) verifying ("I... | scoverage/scoverage-maven-samples | playframework/singlemodule/zentasks/zentasks-scala-2.10/app/controllers/Application.scala | Scala | apache-2.0 | 2,717 |
package is.hail.utils
class TruncatedArrayIndexedSeq[T](a: Array[T], newLength: Int) extends IndexedSeq[T] with Serializable {
def length: Int = newLength
def apply(idx: Int): T = {
if (idx < 0 || idx >= newLength)
throw new IndexOutOfBoundsException(idx.toString)
a(idx)
}
}
| hail-is/hail | hail/src/main/scala/is/hail/utils/TruncatedArrayIndexedSeq.scala | Scala | mit | 299 |
/*
* 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 ... | esi-mineset/spark | sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormatWriter.scala | Scala | apache-2.0 | 24,412 |
/*
* 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-jdbc/src/test/scala/com/spotify/scio/jdbc/JdbcTest.scala | Scala | apache-2.0 | 5,202 |
package core.application.ui
import scala.language.postfixOps
import game.states.GameState
import javax.swing.JPanel
import java.awt.Dimension
import java.awt.Image
import java.awt.Graphics
import java.awt.Graphics2D
import graphics.sprites.spritesheet.SpriteSheetLoader
final class GameSurface private[ui] (... | NesKaphe/2DGameEngine | src/main/scala/core/application/ui/GamePanel.scala | Scala | lgpl-3.0 | 1,375 |
package core
import akka.actor._
import akka.pattern.{ask, pipe}
import akka.util.Timeout
import core.ResultReceivingActor._
import file.CsvFileActorMessages.ReadIndexMessage
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
object ResultReceivingActor {
case class Request... | andriichuk/FractionOdds | src/main/scala/core/ResultReceivingActor.scala | Scala | apache-2.0 | 762 |
package com.olvind
package requiresjs
import ammonite.ops._
import jdk.nashorn.internal.ir.{FunctionNode, Node, ObjectNode}
import scala.language.postfixOps
object Require {
def apply(p: Path, indexNames: Set[String]): Required = {
val ctx = new ScanCtx
def recurse(requiredPath: Path, ctx: ScanCtx): Lazy[... | chandu0101/scalajs-react-components | gen/src/main/scala/com/olvind/requiresjs/Require.scala | Scala | apache-2.0 | 2,312 |
/*
* 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 agreed to in writ... | scalatest/scalatest | jvm/scalatest-test/src/test/scala/org/scalatest/ListShouldContainAtMostOneOfLogicalOrSpec.scala | Scala | apache-2.0 | 44,227 |
package nexus.diff.syntax
import nexus._
/**
* @author Tongfei Chen
*/
trait BoolMixin {
implicit class BoolOps[B](val a: B)(implicit B: IsBool[B]) {
def &&(b: B) = B.and(a, b)
def ||(b: B) = B.or(a, b)
def unary_! = B.not(a)
def ^(b: B) = B.xor(a, b)
}
implicit class CondOps[B, E[_]](val... | ctongfei/nexus | diff/src/main/scala/nexus/diff/syntax/GenBoolOps.scala | Scala | mit | 420 |
/*
* 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 ... | scala/pickling | core/src/test/scala/scala/pickling/generation/MapStatusTest.scala | Scala | bsd-3-clause | 5,549 |
package at.linuxhacker.procmetrics.bin
import at.linuxhacker.procmetrics.lib._
import at.linuxhacker.procmetrics.global._
import at.linuxhacker.procmetrics.pidstats._
import at.linuxhacker.procmetrics.converts.ProcConverters
import at.linuxhacker.procmetrics.monitor._
import at.linuxhacker.procmetrics.values._
import ... | hstraub/ProcMetrics | src/main/scala/at/linuxhacker/procmetrics/bin/ProcMetricsMain.scala | Scala | gpl-3.0 | 8,855 |
package com.instantor.plugin
package utils
import sbt._
import library.BranchTools
import com.instantor.commons.Memoize1
import com.instantor.props.PropsResolver
class BranchToolsWrapper(logger: Logger) {
private val bt = new BranchTools(logger)
val topProjectName = bt.topProjectName _
val propsResolver = M... | instantor/SbtInstantorPlugin | code/src/main/scala/com/instantor/plugin/utils/BranchToolsWrapper.scala | Scala | bsd-3-clause | 396 |
/*
* Can be used like this:
* ```
* import my.package.TryExtended
*
* assert(Try(1).zip(Try("2")) == Try(1,"2"))
* ```
*/
implicit class TryExtended[+T](val wrapped: Try[T]) extends AnyVal {
def zip[That](that: => Try[That]): Try[(T, That)] =
for (a <- wrapped; b <- that) yield (a, b)
}
object TryExtende... | broartem/snippets | scala/TryExtended.scala | Scala | mit | 598 |
package com.karasiq.shadowcloud.model.keys
import com.karasiq.shadowcloud.model.RegionId
import com.karasiq.shadowcloud.model.keys.KeyProps.RegionSet
@SerialVersionUID(0L)
final case class KeyProps(key: KeySet, regionSet: RegionSet, forEncryption: Boolean, forDecryption: Boolean)
object KeyProps {
type RegionSet =... | Karasiq/shadowcloud | model/src/main/scala/com/karasiq/shadowcloud/model/keys/KeyProps.scala | Scala | apache-2.0 | 509 |
package akka.dispatch.verification
import akka.actor.Cell
import akka.actor.ActorRef
import akka.actor.Props;
import akka.actor.AutoReceivedMessage;
import akka.actor.ActorIdentity;
import akka.actor.ReceiveTimeout;
import akka.dispatch.Envelope
// The interface for schedulers
trait Scheduler {
def isSystemCommun... | NetSys/demi | src/main/scala/verification/schedulers/Scheduler.scala | Scala | bsd-2-clause | 3,827 |
/*
* Copyright 2009-2010 LinkedIn, 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 ... | rhavyn/norbert | cluster/src/test/scala/com/linkedin/norbert/cluster/ClusterNotificationManagerComponentSpec.scala | Scala | apache-2.0 | 7,196 |
package com.sksamuel.elastic4s.testkit
import com.sksamuel.elastic4s.http.JavaClient
import com.sksamuel.elastic4s.{ElasticClient, ElasticDsl, ElasticProperties}
import scala.util.Try
trait DockerTests extends ElasticDsl with ClientProvider {
val elasticHost = sys.env.getOrElse("ES_HOST", "127.0.0.1")
val elast... | stringbean/elastic4s | elastic4s-testkit/src/main/scala/com/sksamuel/elastic4s/testkit/DockerTests.scala | Scala | apache-2.0 | 975 |
package dispatch.json
import dispatch._
trait ImplicitJsHandlers {
/** Add JSON-processing method ># to dispatch.Request */
implicit def requestToJsHandlers(r: Request) = new JsHandlers(r)
implicit def stringToJsHandlers(r: String) = new JsHandlers(new Request(r))
}
trait JsHttp extends ImplicitJsHandlers with ... | cmc333333/Databinder-Dispatch | http+json/src/main/scala/JsHttp.scala | Scala | lgpl-2.1 | 545 |
{{#public}}
package {{package}}
import com.twitter.scrooge.{
LazyTProtocol,
TFieldBlob, ThriftException, ThriftStruct, ThriftStructCodec3, ThriftStructFieldInfo,
ThriftStructMetaData, ThriftUtil}
import org.apache.thrift.protocol._
import org.apache.thrift.transport.{TMemoryBuffer, TTransport}
import java.nio.By... | thirstycrow/scrooge | scrooge-generator/src/main/resources/scalagen/struct.scala | Scala | apache-2.0 | 18,413 |
package com.ing.baker.runtime.akka.implementations
class InteractionOne() {
def apply(recipeInstanceId: String, initialIngredient: String): String = ""
}
| ing-bank/baker | core/akka-runtime/src/test/scala/com/ing/baker/runtime/akka/implementations/InteractionOne.scala | Scala | mit | 157 |
package db.impl
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import scala.jdk.CollectionConverters._
import play.api.Environment
import play.api.db.evolutions.{Evolution, Evolutions, EvolutionsReader}
import play.api.libs.Collections
//Some stuff taken from ResourceEvolutionsReader
class OreE... | SpongePowered/Ore | ore/app/db/impl/OreEvolutionsReader.scala | Scala | mit | 2,327 |
/*
* 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 ... | tzulitai/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/nodes/common/CommonLookupJoin.scala | Scala | apache-2.0 | 34,083 |
package model.services.rewardRules
import java.util.UUID
import model.services.GamificationEngineTrait
class RewardRule_CommentWithAnnTags() extends RewardRuleTrait{
override val action_id: Int = GamificationEngineTrait.COMMENT_WITH_ANN_TAGS
override def getPoints(user_id: UUID): Int = {
// reward only if ... | scify/DemocracIT-Web | app/model/services/rewardRules/RewardRule_CommentWithAnnTags.scala | Scala | apache-2.0 | 388 |
/*
* Copyright (C) 2009-2017 Lightbend Inc. <https://www.lightbend.com>
*/
package common.assets
package object controllers {
type Assets = _root_.controllers.Assets
}
| wsargent/playframework | documentation/manual/working/commonGuide/assets/code/CommonAssets.scala | Scala | apache-2.0 | 173 |
package org.tensorflow.contrib.scala
import com.twitter.bijection.Bijection
import org.tensorflow.contrib.scala.Rank._
import org.tensorflow.{DataType, Tensor}
/**
* Support for TensorFlow byte strings.
*
* Byte strings are containers for variable-length data, typically protobuf messages
* to be processed by ... | cookieai/flink-tensorflow | flink-tensorflow/src/main/scala/org/tensorflow/contrib/scala/ByteStrings.scala | Scala | apache-2.0 | 1,262 |
package bugs.bug2
//works
trait AB4 {
}
| raisercostin/jedi-io | src/main/scala/bugs/bug2/AB5.scala | Scala | apache-2.0 | 46 |
/*
* Copyright 2010 Red Hat, Inc.
*
* Red Hat licenses this file to you 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... | alexeev/jboss-fuse-mirror | sandbox/fmc/fmc-rest/src/main/scala/org/fusesource/fabric/webui/CacheControlResponseFilter.scala | Scala | apache-2.0 | 1,103 |
package spire
package random
import org.scalatest.Matchers
import org.scalatest._
import prop._
import org.scalacheck._
class ShufflingTest extends PropSpec with Matchers with GeneratorDrivenPropertyChecks {
val rng = spire.random.rng.Lcg64.fromTime()
val range = Gen.chooseNum(1, 1000)
property("shuffling do... | tixxit/spire | tests/src/test/scala/spire/random/ShufflingTest.scala | Scala | mit | 511 |
class DependentImplicitTezt {
trait Bridge
class Outer {
class Inner extends Bridge
object Inner {
implicit def fromOther(b: Bridge): Inner = throw new Error("todo")
}
def run(x: Inner) = throw new Error("todo")
}
val o1 = new Outer
val o2 = new Outer
val i1 = new o1.Inner
val i2... | lrytz/scala | test/files/pos/t4947.scala | Scala | apache-2.0 | 552 |
/*
*************************************************************************************
* Copyright 2013 Normation SAS
*************************************************************************************
*
* This file is part of Rudder.
*
* Rudder is free software: you can redistribute it and/or modify
* it under the... | armeniaca/rudder | rudder-core/src/main/scala/com/normation/rudder/repository/ParameterRepository.scala | Scala | gpl-3.0 | 3,204 |
// Equites, a Scala chess playground
// Copyright © 2014 Frank S. Thomas <frank@timepit.eu>
//
// 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 ... | equites-chess/equites-core | src/main/scala/eu/timepit/equites/FileAndRank.scala | Scala | gpl-3.0 | 2,055 |
package com.stephentu.sql
import org.specs2.mutable._
class ResolverSpec extends Specification {
object resolver extends Resolver
private def doTest(q: String) = {
val parser = new SQLParser
val r = parser.parse(q)
resolver.resolve(r.get, TestSchema.definition)
}
"Resolver" should {
"resolv... | debugger87/scala-sql-parser | src/test/scala/resolver.scala | Scala | mit | 2,586 |
package models.v2
import java.util.UUID
import scala.collection.JavaConversions._
import com.datastax.driver.core._
import com.datastax.driver.core.utils.UUIDs
import com.datastax.driver.mapping
import com.datastax.driver.mapping.annotations._
import com.datastax.driver.mapping.annotations.Table
import com.datastax.d... | lequangdzung/quora-clone | api-app/app/models/v2/Token.scala | Scala | gpl-2.0 | 1,419 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | core/src/main/scala/org/apache/spark/util/collection/PrimitiveVector.scala | Scala | apache-2.0 | 3,156 |
package com.actionml.utilities
/*
* Copyright ActionML, LLC under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* ActionML licenses this file to You under the Apache License, Version 2.0
* (the "License"); ... | actionml/harness | rest-server/common/src/main/scala/com/actionml/utilities/FixedSizeFifo.scala | Scala | apache-2.0 | 1,814 |
package org.biancama.algorithms.sort
import scala.annotation.tailrec
/**
* Created by massimo on 30/04/16.
*/
object MergeSort {
/**
* mergesort :: Ord a => [a] -> [a]
* mergesort [] = []
* mergesort [x] = [x]
* mergesort xs = merge (mergesort (xs take n)) (mergesort (xs drop n))
*
*... | biancama/data-structures-scala | src/main/scala/org/biancama/algorithms/sort/MergeSort.scala | Scala | gpl-3.0 | 1,212 |
/*
* Copyright 2017 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... | pncampbell/ct-calculations | src/main/scala/uk/gov/hmrc/ct/ct600e/v2/E2.scala | Scala | apache-2.0 | 1,001 |
package com.chobostudy.datastructure
import scala.annotation.tailrec
/**
* @author loustler
* @since 08/11/2017 21:16
*/
trait ListHelper {
def size[A](x: List[A]): Int = {
@tailrec
def loop(i: Int, y: List[A]): Int = y match {
case Nil => i
case Cons(h, Nil) => i + 1
case C... | codechobostudy/FPIS | src/main/scala/com/chobostudy/datastructure/ListHelper.scala | Scala | apache-2.0 | 1,004 |
package vlad187.math
import org.joda.time._
/**
* Created by Vlad187 on 2/28/2014.
*/
case class Metric(name: String)
case class Measurement[T <: Numeric[T]](metric: Metric, value: T, time: DateTime)
case class Serial[T <: Numeric[T]](measurement: Measurement[T], measurements: Measurement[T]*) {
val allMeasureme... | Vlad187/slash-tools | src/main/scala/vlad187/math/Series.scala | Scala | apache-2.0 | 1,095 |
package se.lu.nateko.cp.meta.test.reasoner
import org.scalatest.funspec.AnyFunSpec
import se.lu.nateko.cp.meta.onto.reasoner.HermitBasedReasoner
import se.lu.nateko.cp.meta.test.TestConfig
import se.lu.nateko.cp.meta.utils.owlapi._
import java.net.URI
class HermitBasedReasonerTests extends AnyFunSpec{
val owlOnto =... | ICOS-Carbon-Portal/meta | src/test/scala/se/lu/nateko/cp/meta/test/reasoner/HermitBasedReasonerTests.scala | Scala | gpl-3.0 | 1,156 |
/*
* 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 ... | sh-cho/cshSpark | util/collection/SortDataFormat.scala | Scala | apache-2.0 | 4,275 |
def foo(x: String) = 1
def foo(x: Byte) = 2
/* line: 2 */foo(' ') | katejim/intellij-scala | testdata/resolve2/bug2/SCL2722.scala | Scala | apache-2.0 | 66 |
package io.udash.web.guide.views.ext.demo
import io.udash.properties.single.Property
import io.udash.web.guide.demos.AutoDemo
import io.udash.web.guide.styles.partials.GuideStyles
import scalatags.JsDom.all._
object DynamicRemoteTranslationsDemo extends AutoDemo {
private val (rendered, source) = {
import io.u... | UdashFramework/udash-core | guide/guide/.js/src/main/scala/io/udash/web/guide/views/ext/demo/DynamicRemoteTranslationsDemo.scala | Scala | apache-2.0 | 2,457 |
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.