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 |
|---|---|---|---|---|---|
def +[T >: A](elem: T): Liist[T] = this match {
case Niil => elem ::: Niil
case head ::: tail => head ::: tail + elem
}
| grzegorzbalcerek/scala-exercises | Liist/stepLiistPlus.scala | Scala | bsd-2-clause | 124 |
/*
* Copyright (c) 2014-2021 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | monixio/monix | monix-reactive/shared/src/test/scala/monix/reactive/internal/builders/UnfoldEvalObservableSuite.scala | Scala | apache-2.0 | 5,060 |
package org.sisioh.aws4s.sqs.model
import com.amazonaws.services.sqs.model.{ Message, ReceiveMessageResult }
import org.sisioh.aws4s.PimpedType
import scala.collection.JavaConverters._
object ReceiveMessageResultFactory {
def create(): ReceiveMessageResult = new ReceiveMessageResult()
}
class RichReceiveMessage... | everpeace/aws4s | aws4s-sqs/src/main/scala/org/sisioh/aws4s/sqs/model/RichReceiveMessageResult.scala | Scala | mit | 707 |
package dotty.tools.dotc
package config
import Settings._
import core.Contexts._
abstract class CompilerCommand extends CliCommand:
type ConcreteSettings = ScalaSettings
final def helpMsg(using settings: ScalaSettings)(using SettingsState, Context): String =
settings.allSettings.find(isHelping) match
c... | dotty-staging/dotty | compiler/src/dotty/tools/dotc/config/CompilerCommand.scala | Scala | apache-2.0 | 1,020 |
import org.apache.spark._
import org.apache.spark.streaming._
import org.apache.spark.streaming.dstream.DStream
import org.apache.spark.streaming.{StreamingContext, Seconds}
import org.apache.spark.streaming.StreamingContext._
// Create a local StreamingContext with two working thread and batch... | codedecay/jetpack | mllib/code/lab3.scala | Scala | agpl-3.0 | 2,006 |
package cpup.mc.lib.content
import cpup.mc.lib.{CPupModRef, CPupMod}
import net.minecraft.item.ItemBlock
import net.minecraft.item.crafting.IRecipe
trait ContentRegistrar[MOD <: CPupMod[_ <: CPupModRef]] {
def mod: MOD
def registerBlock(block: CPupBlock[MOD]) {
registerBlock(block, classOf[GenericItemBlock[MOD]]... | CoderPuppy/cpup-mc | src/main/scala/cpup/mc/lib/content/ContentRegistrar.scala | Scala | mit | 552 |
package org.broadinstitute.dsde.firecloud.dataaccess
import akka.actor.ActorSystem
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.model.{ContentTypes, HttpEntity, HttpResponse}
import akka.stream.scaladsl.Source
import akka.util.... | broadinstitute/firecloud-orchestration | src/test/scala/org/broadinstitute/dsde/firecloud/dataaccess/HttpImportServiceDAOSpec.scala | Scala | bsd-3-clause | 3,949 |
package com.stratio.ioft.serialization
package object json4s {
val librePilotSerializers = ValueSerializer::FieldSerializer::EntrySerializer::Nil
}
| pfcoperez/sparkstream_ioft | src/main/scala/com/stratio/ioft/serialization/json4s/package.scala | Scala | mit | 153 |
package org.jetbrains.plugins.scala.lang.parser.parsing.types
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.parser.ScalaElementTypes
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.util... | gtache/intellij-lsp | intellij-lsp-dotty/src/org/jetbrains/plugins/scala/lang/parser/parsing/types/ParamType.scala | Scala | apache-2.0 | 1,212 |
/*
* 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 ... | ahnqirage/spark | core/src/test/scala/org/apache/spark/JobCancellationSuite.scala | Scala | apache-2.0 | 16,535 |
package com.wlangiewicz
import java.util.concurrent.Future
import org.bitcoinj.core._
import org.bitcoinj.net.discovery.DnsDiscovery
import org.bitcoinj.params.{MainNetParams, TestNet3Params}
import org.bitcoinj.store.{MemoryBlockStore, BlockStore}
import org.bitcoinj.utils.BriefLogFormatter
/**
* Downloads the bloc... | wlk/bitcoinj-scala-examples | src/main/scala/FetchBlock.scala | Scala | apache-2.0 | 1,767 |
/***********************************************************************
* 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-jobs/src/main/scala/org/locationtech/geomesa/jobs/mapreduce/FileStreamInputFormat.scala | Scala | apache-2.0 | 4,904 |
package foo
def bar = 2 // error: bar is a package
| som-snytt/dotty | tests/neg/toplevel-package/moredefs_2.scala | Scala | apache-2.0 | 52 |
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... | mandar2812/DynaML | dynaml-core/src/main/scala/io/github/tailhq/dynaml/optimization/GradientDescent.scala | Scala | apache-2.0 | 5,685 |
/*
* 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/test/scala/org/apache/flink/table/planner/plan/utils/FlinkRexUtilTest.scala | Scala | apache-2.0 | 18,271 |
package com.dwolla.cloudflare
package domain
package model
import com.dwolla.cloudflare.domain.dto.dns.DnsRecordDTO
import scala.util.matching.Regex
sealed trait DnsRecord {
val name: String
val content: String
val recordType: String
val ttl: Option[Int]
val proxied: Option[Boolean]
val priority: Option[... | Dwolla/scala-cloudflare | client/src/main/scala/com/dwolla/cloudflare/domain/model/DnsRecord.scala | Scala | mit | 3,654 |
/*
* Copyright (C) 2012 The Regents of The University California.
* 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/licenses/LICENS... | lzshlzsh/shark | src/test/scala/shark/memstore2/column/NullableColumnBuilderSuite.scala | Scala | apache-2.0 | 4,033 |
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base
package patterns
import com.intellij.lang.ASTNode
import com.intellij.psi._
import com.intellij.psi.scope.PsiScopeProcessor
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.plugins.scala.extensions._
import org.jetbrain... | jastice/intellij-scala | scala/scala-impl/src/org/jetbrains/plugins/scala/lang/psi/impl/base/patterns/ScReferencePatternImpl.scala | Scala | apache-2.0 | 4,071 |
package mesosphere.marathon
package stream
import java.net.URI
import java.nio.file.Paths
import akka.actor.ActorSystem
import akka.http.scaladsl.model.ContentTypes
import akka.stream.Materializer
import akka.stream.alpakka.s3.S3Settings
import akka.stream.alpakka.s3.acl.CannedAcl
import akka.stream.alpakka.s3.auth.A... | natemurthy/marathon | src/main/scala/mesosphere/marathon/stream/UriIO.scala | Scala | apache-2.0 | 5,350 |
package org.jetbrains.plugins.scala.debugger.stepOver
import org.jetbrains.plugins.scala.debugger.{ScalaDebuggerTestCase, ScalaPositionManager}
import org.jetbrains.plugins.scala.extensions._
import org.junit.Assert
import scala.io.Source
/**
* @author Nikolay.Tropin
*/
abstract class StepOverTestBase extends Scal... | whorbowicz/intellij-scala | test/org/jetbrains/plugins/scala/debugger/stepOver/StepOverTestBase.scala | Scala | apache-2.0 | 2,128 |
package org.scalajs.jsenv.test
import org.scalajs.jsenv.phantomjs.PhantomJSEnv
class PhantomJSWithCustomInitFilesTest extends CustomInitFilesTest {
protected def newJSEnv: PhantomJSEnv = new PhantomJSEnv {
override def customInitFiles() = makeCustomInitFiles()
}
}
| lrytz/scala-js | js-envs-test-suite/src/test/scala/org/scalajs/jsenv/test/PhantomJSWithCustomInitFilesTest.scala | Scala | bsd-3-clause | 275 |
package command
class FileIO {
def execute(): Unit = println("Executing File IO operations...")
}
| BBK-PiJ-2015-67/sdp-portfolio | exercises/week10/src/main/scala/command/FileIO.scala | Scala | unlicense | 101 |
/* *\\
** \\ \\ / _) \\ \\ / \\ | **
** \\ \\ / | __ \\ _ \\ __| \\ \\ / |\\/ | **
** \\ \\ / | | | __/ | \\ \\ / | | **
** \\_/ _| .__/ \\___| _| \\_/ _| _| **
** _| ... | hsyl20/Scala_ViperVM | src/main/scala/org/vipervm/profiling/DummyProfiler.scala | Scala | gpl-3.0 | 1,466 |
package com.letstalkdata.hexiles
package game
import com.letstalkdata.hexiles.graphics.Colors
import com.letstalkdata.hexiles.shapes.Hexagon
import utest._
/**
* Author: Phillip Johnson
* Date: 5/27/15
*/
object StateTest extends TestSuite {
val tests = TestSuite {
'empty_board_is_not_terminal {
val b... | SeriousSoftware/ScalaJS-Hexiles-web | src/test/scala-2.11/com/letstalkdata/hexiles/game/StateTest.scala | Scala | mit | 1,466 |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: Spiros Tzavellas
*/
package com.tzavellas.coeus.mvc
package scope
import org.junit.Test
import org.junit.Assert._
import org.springframework.mock.web.MockHttpServletRequest
class ScopeAccessorTest {... | sptz45/coeus | src/test/scala/com/tzavellas/coeus/mvc/scope/ScopeAccessorTest.scala | Scala | apache-2.0 | 781 |
package com.peterpotts.logging
import akka.event.EventStream
/**
* A logging trait that dispatches log events to an event stream.
*/
trait EventStreamLogging {
val eventStream: EventStream
lazy val log: Logger = new EventStreamLogger(eventStream, factory(getClass.getName))
protected[this] def factory(name: S... | peterpotts/logging | src/main/scala/com/peterpotts/logging/EventStreamLogging.scala | Scala | mit | 389 |
package org.senkbeil.debugger.akka.messages
import org.senkbeil.debugger.akka.messages.structures.{JDIThread, JDIReferenceType}
case class ClassPrepareMessage(
referenceType: Option[JDIReferenceType] = None,
thread: Option[JDIThread] = None
) extends MessageLike
| chipsenkbeil/scala-debugger-akka | src/main/scala/org/senkbeil/debugger/akka/messages/ClassPrepareMessage.scala | Scala | apache-2.0 | 287 |
package org.apache.spark.api.ruby
import java.io._
import java.net._
import java.util.{List, ArrayList}
import scala.collection.JavaConversions._
import scala.collection.immutable._
import org.apache.spark._
import org.apache.spark.util.Utils
/**
* Internal class that acts as an `AccumulatorParam` for Ruby accumul... | ondra-m/ruby-spark | ext/spark/src/main/scala/RubyAccumulatorParam.scala | Scala | mit | 2,284 |
package db.migration.hsql
import db.migration.{V1_030__SpillStateToDisk => V1_030__SpillStateToDiskDefinition}
import slick.jdbc.{HsqldbProfile, JdbcProfile}
class V1_030__SpillStateToDisk extends V1_030__SpillStateToDiskDefinition {
override protected lazy val profile: JdbcProfile = HsqldbProfile
} | TouK/nussknacker | ui/server/src/main/scala/db/migration/hsql/V1_030__SpillStateToDisk.scala | Scala | apache-2.0 | 304 |
package com.stripe.bonsai
import org.scalatest.{ WordSpec, Matchers }
import org.scalatest.prop.{ Checkers, PropertyChecks }
class FullBinaryTreeSpec extends WordSpec with Matchers with Checkers with PropertyChecks {
val ops = FullBinaryTreeOps[FullBinaryTree[Int, Int], Int, Int]
type BTII = FullBinaryTree[Int,... | stripe/bonsai | bonsai-core/src/test/scala/com/stripe/bonsai/FullBinaryTreeSpec.scala | Scala | mit | 3,629 |
package helloscala.http
import akka.http.scaladsl.model.Uri
import helloscala.test.HelloscalaSpec
class HttpUtilsTest extends HelloscalaSpec {
"HttpUtils" should {
"Uri.withQuery" in {
val uri = Uri("http://localhost:8080/validate?token=3322")
println(uri)
val uri2 = uri.withQuery(Uri.Query(L... | helloscala/helloscala | hs-akka-http-core/src/test/scala/helloscala/http/HttpUtilsTest.scala | Scala | apache-2.0 | 387 |
/*******************************************************************************
Copyright (c) 2013, KAIST, S-Core.
All rights reserved.
Use is subject to license terms.
This distribution may include materials developed by third parties.
***************************************************************... | daejunpark/jsaf | src/kr/ac/kaist/jsaf/analysis/typing/models/DOMHtml/HTMLMapElement.scala | Scala | bsd-3-clause | 3,852 |
package scala.tools
package testing
import org.junit.Assert._
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import AssertUtil._
import java.lang.ref._
@RunWith(classOf[JUnit4])
class AssertUtilTest {
@Test def reachableIgnoresReferences(): Unit = {
class Holder[A](val r... | felixmulder/scala | test/junit/scala/tools/testing/AssertUtilTest.scala | Scala | bsd-3-clause | 449 |
package scalapb.docs
object CommonProtos {
def row(libName: String, version: String): String = {
s"""### $libName
|ScalaPB 0.11.x:
|```scala
|libraryDependencies ++= Seq(
| "com.thesamet.scalapb.common-protos" %% "${libName}-scalapb_0.11" % "${version}" % "protobuf",
| "com.t... | scalapb/ScalaPB | docs/src/main/scala/scalapb/docs/CommonProtos.scala | Scala | apache-2.0 | 1,370 |
/**
* 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... | lburgazzoli/apache-camel | components/camel-scala/src/main/scala/org/apache/camel/scala/RichMessage.scala | Scala | apache-2.0 | 4,060 |
/*
* 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 ... | foryou2030/incubator-carbondata | integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/TestQueryWithoutDataLoad.scala | Scala | apache-2.0 | 2,054 |
/*
* Copyright 2001-2012 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... | hubertp/scalatest | src/test/scala/org/scalatest/selenium/ScreenshotSpec.scala | Scala | apache-2.0 | 3,261 |
package x7c1.wheat.splicer.android
import sbt.File
trait LineLoadable[A] {
def by(x: LineLoader): A
}
object LineLoadable {
implicit object string extends LineLoadable[String] {
override def by(x: LineLoader): String = {
x.requireSingle()
}
}
implicit object int extends LineLoadable[Int] {
... | x7c1/Wheat | wheat-splicer/src/main/scala/x7c1/wheat/splicer/android/LineLoadable.scala | Scala | mit | 695 |
package com.github.sethereum.evm
import java.math.BigInteger
import scala.language.implicitConversions
final case class EvmWord (val data: Seq[Byte]) {
require(data.length <= EvmWord.BYTES, s"invalid word length ${data.length}")
def bytes: Array[Byte] = data.toArray[Byte]
def padLeft: EvmWord =
if (data... | sethereum/scodec-rlp | src/main/scala/com/github/sethereum/evm/EvmWord.scala | Scala | apache-2.0 | 3,296 |
package pureconfig
import scala.collection.{Factory, mutable}
/** A compatibility layer for creating `CanBuildFrom`-like generic methods that work both on Scala 2.13 and pre-2.13
* versions.
*
* @tparam A
* the type of elements that get added to the builder
* @tparam C
* the type of collection that it... | pureconfig/pureconfig | core/src/main/scala-2.13+/pureconfig/FactoryCompat.scala | Scala | mpl-2.0 | 613 |
/*
* Copyright University of Basel, Graphics and Vision Research Group
*
* 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... | unibas-gravis/landmarks-clicker | src/main/scala/scalismo/faces/gui/controllers/LMClickerViewController.scala | Scala | apache-2.0 | 9,518 |
object G {
def unapply(m: Any): Option[_] = Some("")
}
object H {
def unapplySeq(m: Any): Option[Seq[_]] = None
}
object Test {
(0: Any) match {
case G(v) => v
case H(v) => v
case _ =>
}
}
| lampepfl/dotty | tests/pos/t8128.scala | Scala | apache-2.0 | 211 |
/***
* Copyright 2016 Rackspace US, 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 applica... | wdschei/api-checker | core/src/test/scala/com/rackspace/com/papi/components/checker/wadl/WADLCheckerCompSpecSaxonEE.scala | Scala | apache-2.0 | 4,106 |
package org.openmole.gui.plugin.task.systemexec
/*
* Copyright (C) 19/10/2014 // mathieu.leclaire@openmole.org
*
* This program 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 ... | ISCPIF/PSEExperiments | openmole-src/openmole/gui/plugins/org.openmole.gui.plugin.task.systemexec/src/main/scala/org/openmole/gui/plugin/task/systemexec/Activator.scala | Scala | agpl-3.0 | 1,259 |
package com.socialthingy.plusf.p2p.discovery
import java.net.InetSocketAddress
import akka.actor.ActorSystem
object DiscoveryService extends App {
implicit val system = ActorSystem()
implicit val ec = system.dispatcher
val port = args(0).toInt
val actor = DiscoveryActor(new InetSocketAddress(port))
syste... | alangibson27/plus-f | discovery/src/main/scala/com/socialthingy/plusf/p2p/discovery/DiscoveryService.scala | Scala | mit | 378 |
package scuff
import scala.reflect.ClassTag
import scala.collection.mutable.Buffer
/**
* Monotonic sequencer.
* <p>If your events/messages/whatever can arrive out of sequence, this class can be used to ensure proper sequencing.
* <p>It expects monotonically increasing sequence numbers and will not work if gaps are... | nilskp/scuff | src/main/scala/scuff/MonotonicSequencer.scala | Scala | mit | 6,409 |
package unluac.decompile
trait OutputProvider {
def print(s: String)
def println()
} | danielwegener/unluac-scala | shared/src/main/scala/unluac/decompile/OutputProvider.scala | Scala | mit | 90 |
package com.websudos.phantom.dsl
import scala.concurrent.blocking
import org.scalatest.concurrent.PatienceConfiguration
import org.scalatest.time.SpanSugar._
import com.websudos.phantom.Implicits._
import com.websudos.phantom.testing._
import com.websudos.phantom.tables.{ Article, Articles }
import com.websudos.util... | nosheenzaza/phantom-data-centric | phantom-dsl/src/test/scala/com/websudos/phantom/dsl/SkippingRecordsTest.scala | Scala | gpl-2.0 | 1,708 |
// // Copyright 2011 Foursquare Labs Inc. All Rights Reserved.
// package io.fsq.rogue.indexchecker
// import io.fsq.rogue.MongoHelpers.AndCondition
// import net.liftweb.mongodb.record.{MongoRecord, MongoMetaRecord}
// import net.liftweb.record.Field
// // ***********************************************************... | sgrouples/rogue-fsqio | indexchecker/src/main/scala/IndexEnforcer.scala | Scala | apache-2.0 | 14,695 |
/*
* Copyright 2012 Taro L. Saito
*
* 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 ... | xerial/xerial | xerial-core/src/main/scala/xerial/core/io/text/Scanner.scala | Scala | apache-2.0 | 3,073 |
package no.vestein.purplerain.screens
import com.badlogic.gdx.graphics.g2d.BitmapFont
import com.badlogic.gdx.graphics.{Color, GL20, Pixmap, Texture}
import com.badlogic.gdx.scenes.scene2d.ui._
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.Chang... | WoodStone/PurpleRain | core/src/main/scala/no/vestein/purplerain/screens/MenuScreen.scala | Scala | gpl-3.0 | 3,283 |
package sample.stream.experiments
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl._
import scala.concurrent.duration.DurationInt
object MultiConsumedFlow {
def main(args: Array[String]) {
implicit val actorSystem = ActorSystem("server")
implicit val materiali... | pallavig/akka-examples | src/main/scala/sample/stream/experiments/MultiConsumedFlow.scala | Scala | cc0-1.0 | 1,191 |
/*
* 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 ... | aljoscha/flink | flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/codegen/CalcCodeGenerator.scala | Scala | apache-2.0 | 7,890 |
package drt.shared
import drt.shared.CrunchApi.{CrunchMinute, MinutesContainer}
case class SimulationMinutes(minutes: Iterable[SimulationMinute]) extends PortStateQueueMinutes {
override val asContainer: MinutesContainer[CrunchMinute, TQM] = MinutesContainer(minutes)
override def isEmpty: Boolean = minutes.isEmp... | UKHomeOffice/drt-scalajs-spa-exploration | shared/src/main/scala/drt/shared/SimulationMinutes.scala | Scala | apache-2.0 | 325 |
/*
* Copyright 2012-2014 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... | mattinger/sirius | src/test/scala/com/comcast/xfinity/sirius/uberstore/segmented/SegmentedUberStoreTest.scala | Scala | apache-2.0 | 17,013 |
/*
* Copyright [2014] [Jason Nerothin]
*
* 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 ... | jasonnerothin/gs-scalatest | src/main/scala/com/gigaspaces/toymodel/JobDescription.scala | Scala | apache-2.0 | 778 |
package version3
import scala.language.higherKinds
/** HList 设计大体与 shapeless 相同,无需过度留意。
*/
trait 池塘 {
type 首
def 首: 首
type 尾 <: 池塘
def 尾: 尾
type 目前舀水 <: 舀水
def 目前舀水: 目前舀水
type 目前去水 <: 去水
def 目前去水: 目前去水
type 加水[I] <: 池塘
def 加水[I](i: I): 加水[I]
}
class 池塘之初 extends 池塘 {
self =>
override typ... | djx314/ubw | a21-叹茶/src/main/scala/a21/step3/Chitang.scala | Scala | bsd-3-clause | 1,692 |
package com.campudus.tableaux.controller
import com.campudus.tableaux.ArgumentChecker._
import com.campudus.tableaux.cache.CacheClient
import com.campudus.tableaux.database.domain._
import com.campudus.tableaux.database.model.ServiceModel.ServiceId
import com.campudus.tableaux.database.model.TableauxModel.{ColumnId, T... | campudus/tableaux | src/main/scala/com/campudus/tableaux/controller/SystemController.scala | Scala | apache-2.0 | 11,715 |
/*
* Copyright 2013 Maurício Linhares
*
* Maurício Linhares 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 ... | dripower/postgresql-async | mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/codec/MySQLHandlerDelegate.scala | Scala | apache-2.0 | 1,281 |
package com.jwd.scala.sample.xml
trait Tag extends Print {
val name: String;
def isLeaf : Boolean
def toXML : String
} | williamjwd/learn-scala | learn-scala-sample/src/main/scala/com/jwd/scala/sample/xml/Tag.scala | Scala | apache-2.0 | 128 |
/*
* Copyright (c) 2014-2019 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apach... | RetentionGrid/snowplow | 3-enrich/scala-common-enrich/src/main/scala/com.snowplowanalytics.snowplow.enrich/common/adapters/registry/IgluAdapter.scala | Scala | apache-2.0 | 11,049 |
package io.koff.t_digest
import com.clearspring.analytics.stream.quantile.TDigest
import com.madhukaraphatak.sizeof.SizeEstimator
/**
* Example for stream-lib
*/
object StreamLibExample {
def main(args: Array[String]) {
val oneSecond = 1000
val twoMinutes = 2 * 60 * 1000
val tenMinutes = 10 * 60 * 100... | coffius/koffio-t-digest | src/main/scala/io/koff/t_digest/StreamLibExample.scala | Scala | mit | 1,087 |
package org.apache.spot.netflow.model
import org.apache.spark.broadcast.Broadcast
import org.apache.spot.netflow.{FlowWordCreator, FlowWords}
import org.apache.spot.utilities.data.validation.InvalidDataHandler
/**
* Estimate the probabilities of network events using a [[FlowSuspiciousConnectsModel]]
*
* @param... | kpeiruza/incubator-spot | spot-ml/src/main/scala/org/apache/spot/netflow/model/FlowScoreFunction.scala | Scala | apache-2.0 | 3,622 |
package org.dele.text.maen
import java.util.regex.Pattern
import ErrorHandling.AtomPropMatcherErrorDefinition
import scala.collection.mutable.ListBuffer
/**
* Created by jiaji on 2016-02-16.
*/
object ConfValueStringParser {
private def idxValid(idx:Int):Boolean = idx >= 0
def parseTmplId(matcherDef:String... | new2scala/text-util | maen/src/main/scala/org/dele/text/maen/ConfValueStringParser.scala | Scala | apache-2.0 | 2,514 |
/*
* Copyright 2016 The BigDL 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 agr... | jenniew/BigDL | spark/dl/src/test/scala/com/intel/analytics/bigdl/utils/serializer/DataConverterSpec.scala | Scala | apache-2.0 | 28,992 |
package agilesites.setup
import agilesites.Utils
import sbt._
/**
* Created by msciab on 24/03/15.
*/
trait WeblogicSettings extends Utils {
import agilesites.config.AgileSitesConfigKeys._
import agilesites.setup.AgileSitesSetupKeys._
def weblogicDeployer(args: String*)
(implicit url: St... | agilesites/agilesites2-build | src/main/scala/agilesites/setup/WeblogicSettings.scala | Scala | mit | 2,356 |
object Test {
def main(args: Array[String]): Unit = {
(
(erased x: Int) => {
println("lambda")
42
}
)(foo)
}
def foo = {
println("foo")
42
}
}
| som-snytt/dotty | tests/run-custom-args/erased/erased-18.scala | Scala | apache-2.0 | 194 |
/*
* TabletTest.scala
* (Anemone-Actiniaria)
*
* Copyright (c) 2014-2022 Hanns Holger Rutz. All rights reserved.
*
* This software is published under the GNU General Public License v3+
*
*
* For further information, please contact Hanns Holger Rutz at
* contact@sciss.de
*/
package de.sciss.anemone
im... | Sciss/AnemoneActiniaria | src/main/scala/de/sciss/anemone/TabletTest.scala | Scala | gpl-3.0 | 2,149 |
package breeze.linalg
import org.scalatest.FunSuite
import breeze.stats.mean
/**
* TODO
*
* @author dlwh
**/
class BroadcastedTest extends FunSuite {
test("broadcast DenseMatrix along columns") {
val dm = DenseMatrix((1.0,2.0,3.0),
(4.0,5.0,6.0))
val res = dm(::, *) + DenseVect... | jaredk-porch/breeze | math/src/test/scala/breeze/linalg/BroadcastedTest.scala | Scala | apache-2.0 | 2,813 |
package models
import java.util.UUID
import com.datastax.driver.core.Row
import com.websudos.phantom.dsl._
import helpers._
import models.cassandra._
import org.joda.time.DateTime
import scala.concurrent.Future
/**
* @author zepeng.li@gmail.com
*/
trait RateLimitCanonicalNamed extends CanonicalNamed {
override... | lizepeng/app.io | modules/models/app/models/RateLimits.scala | Scala | apache-2.0 | 1,737 |
/* __ *\\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\\ \\/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\\___/_/... | felixmulder/scala | src/library/scala/collection/TraversableViewLike.scala | Scala | bsd-3-clause | 13,395 |
package com.raquo.domtypes.generic.defs.eventProps
import com.raquo.domtypes.generic.builders.EventPropBuilder
/**
* Most of today's web content assumes the user's pointing device will be a mouse.
* However, since many devices support other types of pointing input devices,
* such as pen/stylus and touch surfaces, ... | raquo/scala-dom-types | shared/src/main/scala/com/raquo/domtypes/generic/defs/eventProps/PointerEventProps.scala | Scala | mit | 4,264 |
import sbt._
import Keys._
object Experimental {
lazy val ProjectSettings = Seq(
libraryDependencies ++= Seq(
// "com.lihaoyi" % "ammonite" % "0.8.2" % "test" cross CrossVersion.full,
"com.github.alexarchambault" %% "argonaut-shapeless_6.2" % "1.2.0-M4",
"com.chuusai" %% "shapeless" % "2.3.2",... | mouchtaris/jleon | project/Experimental.scala | Scala | mit | 2,087 |
package org.fathens.colorworks.iccprofile.tag
import java.io._
import _root_.org.specs2.mutable._
class TagElementTest extends Specification {
implicit def charToInt(c: Char) = c.toInt
implicit def intsToBytes(ints: Seq[Int]) = new {
def toBytes = ints map { _.toByte }
}
def input(ints: Int*) = new ByteAr... | sawatani/ColorWorks | src/test/scala/org/fathens/colorworks/iccprofile/tag/TagElementTest.scala | Scala | mit | 1,421 |
package polynomial
import core.{EuclideanDomain, ExtendedInteger, Field}
import polynomial.AdjoiningOperations._
import core.InfixOps._
trait PolynomialRingOverField[A] extends EuclideanDomain[Polynomial[A]] with PolynomialRing[A] {
def parameter: FormalParameter
def coefficients: Field[A]
private implicit v... | dkettlestrings/thunder | src/main/scala/polynomial/PolynomialRingOverField.scala | Scala | gpl-3.0 | 874 |
/*
MET-API
Copyright (C) 2014 met.no
Contact information:
Norwegian Meteorological Institute
Box 43 Blindern
0313 OSLO
NORWAY
E-mail: met-api@met.no
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publ... | metno/metapi-sources | test/TestUtil.scala | Scala | gpl-2.0 | 1,466 |
package algorithms
import application.Configuration
import application.Misc
import application.Benchmark
import scala.collection.mutable.ArrayBuffer
import scala.util.Random
import scala.util.control.Breaks._
/**
* Created by qmha on 10/28/14.
*/
class BinaryGA {
def initialization_ga = {
var i = 0
var k ... | minhprg/binary-hpsowm | src/algorithms/BinaryGA.scala | Scala | mit | 7,577 |
package com.peterpotts.cityscape
import scala.annotation.tailrec
object Cityscape {
implicit val blockOrdering = Ordering.by[Block, Int](_.left)
def apply(buildings: List[Block]): List[Block] = merge(shred(buildings.sorted))
private def shred(blocks: List[Block]): List[Block] = shred(Vector.empty, bl... | peterpotts/cityscape | src/main/scala/com/peterpotts/cityscape/Cityscape.scala | Scala | mit | 1,531 |
package processes.freeMonads.vanillaScala.multiple
import scala.concurrent.Future
import play.api.mvc.AnyContent
import play.api.mvc.Request
import play.api.mvc.Result
import processes.PatchAssignment
import processes.Services
import processes.freeMonads.multiple.CompleteProgramParts
import processes.freeMonads.Id
imp... | EECOLOR/scala-clean-code-patterns | src/main/scala/processes/freeMonads/vanillaScala/multiple/Complete.scala | Scala | mit | 3,774 |
/**
* Copyright (C) 2012 LShift 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 a... | aprescott/diffa | agent/src/test/scala/net/lshift/diffa/agent/rest/ScanRequestWriterTest.scala | Scala | apache-2.0 | 2,168 |
/*
* 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 ... | sachintyagi22/spark | repl/scala-2.11/src/test/scala/org/apache/spark/repl/ReplSuite.scala | Scala | apache-2.0 | 18,359 |
package org.deepdive.test.unit
import com.typesafe.config._
import org.deepdive.settings._
import org.deepdive.Context
import org.scalatest._
class SettingsParserSpec extends FunSpec with PrivateMethodTester {
val defaultConfig = ConfigFactory.load().getConfig("deepdive")
describe("Parsing Schema Settings")... | feiranwang/deepdive | src/test/scala/unit/settings/SettingsParserSpec.scala | Scala | apache-2.0 | 6,713 |
package jp.kenichi.pdf
import scala.collection.mutable.Buffer
import java.io.InputStream
import java.lang.Math
/** The common operations of Java IO and HTML 5 File API */
trait PdfInput {
def len: Long
def read(from: Long, until: Long): Seq[Byte]
def inflate(in: InputStream): InputStream
}
/** Buffered Input for... | ken1ma/pades-scala-js | shared/src/main/scala/jp.kenichi/pdf/PdfParser.scala | Scala | apache-2.0 | 8,978 |
package git
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
class Total(list: List[PullRequest]) extends TotalList {
override def get: Future[List[PullRequest]] = Future(list)
}
| PRioritizer/PRioritizer-analyzer | src/main/scala/git/Total.scala | Scala | mit | 223 |
package me.yingrui.segment.concept
import scala.collection.mutable.Map
class ConceptTree {
var rootConcept: Concept = null
var mapIntConcept = Map[Long, Concept]()
var mapStringConcept = Map[String, Concept]()
var mapDescriptionConcept = Map[String, Concept]()
def getRootConcept(): Concept = {
return ... | yingrui/mahjong | lib-segment/src/main/scala/me/yingrui/segment/concept/ConceptTree.scala | Scala | gpl-3.0 | 1,658 |
package com.twitter.finagle.service
import com.twitter.conversions.time._
import com.twitter.finagle._
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.finagle.util.Updater
import com.twitter.util.{Future, Duration, Time, Throw, Return, Timer, TimerTask, Promise}
import scala.util.Random
object FailF... | fengshao0907/finagle | finagle-core/src/main/scala/com/twitter/finagle/service/FailFastFactory.scala | Scala | apache-2.0 | 6,753 |
/*
* Copyright 2015 Nicolas Rinaudo
*
* 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... | nrinaudo/tabulate | java8/src/main/scala/kantan/csv/java8/package.scala | Scala | mit | 3,159 |
package l3
import scala.util.parsing.input.Positional
import scala.text.Document
import Document._
/**
* A module for CL₃ trees.
*
* @author Michel Schinz <Michel.Schinz@epfl.ch>
*/
trait CL3TreeModule {
type Name
type Primitive
private implicit def nameToDoc(n: Name): Document = text(n.toString)
privat... | sana/WorkAtEPFL | l3-compiler/compiler-optimizations/compiler/src/l3/CL3Tree.scala | Scala | gpl-3.0 | 2,512 |
/*
* Copyright (c) 2014-2018 by The Monix Project Developers.
* See the project homepage at: https://monix.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | Wogan/monix | monix-reactive/shared/src/main/scala/monix/reactive/internal/builders/StateActionObservable.scala | Scala | apache-2.0 | 2,754 |
package sbt
import java.io.{ File, FileNotFoundException, IOException }
object exit {
def main(args: Array[String]) {
System.exit(java.lang.Integer.parseInt(args(0)))
}
}
object cat {
def main(args: Array[String]) {
try {
if (args.length == 0)
IO.transfer(System.in, System.out)
else
... | pdalpra/sbt | util/process/src/test/scala/TestedProcess.scala | Scala | bsd-3-clause | 1,185 |
package net.tomasherman.specus.server.api.di
import net.tomasherman.specus.common.api.di.GenericDependencyConfigRepository
/**
* This file is part of Specus.
*
* Specus 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 Softwa... | tomasherman/specus | server_api/src/main/scala/di/DependencyConfigRepository.scala | Scala | gpl-3.0 | 997 |
package com.twitter.finagle
import com.twitter.util.{Closable, Future, Promise, Return, Time, Throw, Try}
import scala.util.control.{NonFatal, NoStackTrace}
object Service {
/**
* Wrap the given service such that any synchronously thrown `NonFatal`
* exceptions are lifted into `Future.exceptions`.
*/
de... | twitter/finagle | finagle-core/src/main/scala/com/twitter/finagle/Service.scala | Scala | apache-2.0 | 5,141 |
package com.dt.scala.type_parameterization
import scala.collection.immutable.Queue
/**
* Author: Wang Jialin
* Date 2015/7/4
* Contact Information:
* WeChat: 18610086859
* QQ: 1740415547
* Email: 18610086859@126.com
* Tel: 18610086859
*/
class Triple[F, S, T](val first: F, val second: S, v... | slieer/scala-tutorials | src/main/scala/com/dt/scala/type_parameterization/Hello_Type_Parameterization.scala | Scala | apache-2.0 | 893 |
package com.softwaremill.macwire
package akkasupport
import akka.actor.{ActorRef, Props}
import com.softwaremill.macwire.internals.Logger
import scala.reflect.macros.blackbox
object MacwireAkkaMacros {
private val log = new Logger()
def wireProps_Impl[T: c.WeakTypeTag](c: blackbox.Context): c.Expr[Props] =
... | adamw/macwire | macrosAkka/src/main/scala/com/softwaremill/macwire/akkasupport/MacwireAkkaMacros.scala | Scala | apache-2.0 | 1,809 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | tophua/spark1.52 | examples/src/main/scala/org/apache/spark/examples/ml/MovieLensALS.scala | Scala | apache-2.0 | 9,759 |
package frameless
package ops
import org.apache.spark.sql.catalyst.analysis.UnresolvedAlias
import org.apache.spark.sql.catalyst.plans.logical.{MapGroups, Project}
import org.apache.spark.sql.{Column, Dataset, FramelessInternals, RelationalGroupedDataset}
import shapeless._
import shapeless.ops.hlist.{Length, Mapped, ... | imarios/frameless | dataset/src/main/scala/frameless/ops/GroupByOps.scala | Scala | apache-2.0 | 10,904 |
package org.scalajs.core.tools.linker.backend.closure
import scala.annotation.switch
import org.scalajs.core.ir
import ir.Position
import ir.Position.NoPosition
import org.scalajs.core.tools.javascript.Trees._
import com.google.javascript.rhino._
import com.google.javascript.jscomp._
import scala.collection.mutabl... | lrytz/scala-js | tools/jvm/src/main/scala/org/scalajs/core/tools/linker/backend/closure/ClosureAstTransformer.scala | Scala | bsd-3-clause | 13,410 |
object Alarm {
import probability._
import Probability._
case class Bulgary(s:Boolean)
case class Earthquake(s:Boolean)
case class Alarm(s:Boolean)
case class John(s:Boolean)
case class Mary(s:Boolean)
case class State(b:Bulgary, e:Earthquake, a:Alarm, j:John, m:Mary)
def mkProb... | urso/scala_mprob | examples/Alarm.scala | Scala | bsd-3-clause | 1,763 |
package se.media4u101.snippet
import se.media4u101.lib._
import se.media4u101.lib.EmptyRoundTrip
import net.liftweb._
import common._
import http.{RoundTripInfo, RoundTripHandlerFunc, S}
import json.JsonAST.{JString, JArray, JValue}
import net.liftweb.util.Schedule
import net.liftweb.util.Helpers._
import net.liftwe... | karma4u101/BTC-Stat | src/main/scala/se/media4u101/snippet/RoundTrips.scala | Scala | apache-2.0 | 3,062 |
package org.scalgebra.generation
import algebra.ring.{MultiplicativeMonoid, Ring, Semiring}
import org.scalacheck.{Arbitrary, Gen}
import org.scalgebra.Vector
import scala.reflect.ClassTag
/**
* Generates Vectors.
*
* @author Daniyar Itegulov
*/
object VectorGen {
def genZeroVector[T: Arbitrary : Semiring ... | itegulov/scalgebra | src/test/scala/org/scalgebra/generation/VectorGen.scala | Scala | mit | 962 |
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.